formancehq / formance-sdk-php
Requires
- php: ^8.1
- brick/date-time: ^0.7.0
- guzzlehttp/guzzle: ^7.0
- phpdocumentor/type-resolver: ^1.8
- speakeasy/serializer: ^3.40.0
Requires (Dev)
- laravel/pint: ^1.15
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^10
- rector/rector: ^0.18.13
- roave/security-advisories: dev-latest
- dev-main
- v3.1.0
- v3.0.0
- v2.4.4
- v2.4.3
- v2.3.2
- v2.2.5
- v2.2.2
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0-rc.15
- v2.0.0-rc.14
- v2.0.0-rc.13
- v2.0.0-rc.12
- v2.0.0-rc.11
- v2.0.0-rc.10
- v2.0.0-rc.9
- v2.0.0-rc.8
- v2.0.0-rc.7
- v2.0.0-rc.4
- v2.0.0-rc.3
- v2.0.0-rc.2
- v2.0.0-rc.1
- v2.0.0-beta.16
- v2.0.0-beta.15
- v2.0.0-beta.14
- v2.0.0-beta.13
- v2.0.0-beta.12
- v2.0.0-beta.11
- v2.0.0-beta.10
- v2.0.0-beta.9
- v2.0.0-beta.8
- v2.0.0-beta.6
- v2.0.0-beta.5
- v2.0.0-beta.4
- v2.0.0-beta.2
- v2.0.0-beta.1
- v1.0.202307124
- v1.0.20230915
- v1.0.20230725
- v1.0.20230724
- v1.0.20230718.1
- v1.0.20230718
- v1.0.20230714
- v1.0.20230713
- v1.0.20230710
- v1.0.20230627
- v1.0.20230623-beta.1
- v1.0.20230301
- v1.0.20230228
- v1.0.20230227
- v1.0.0-rc.1
- dev-speakeasy-sdk-regen-1732234037
- dev-speakeasy-sdk-regen-1726618004
- dev-feat/upgrade-speakeasy
- dev-speakeasy-sdk-regen-1710763459
- dev-release/v2.0.0-rc.15
- dev-release/v2.0.0-rc.14
- dev-release/v2.0.0-rc.13
- dev-release/v2.0.0-rc.12
- dev-release/v2.0.0-rc.11
- dev-release/v2.0.0-rc.10
- dev-release/v2.0.0-rc.9
- dev-release/v2.0.0-rc.8
- dev-release/v2.0.0-rc.7
- dev-release/v2.0.0-rc.4
- dev-release/v2.0.0-rc.3
- dev-release/v2.0.0-rc.2
- dev-release/v2.0.0-rc.1
- dev-release/v2.0.0-beta.16
- dev-release/v2.0.0-beta.15
- dev-release/v2.0.0-beta.14
- dev-release/v2.0.0-beta.13
- dev-release/v2.0.0-beta.12
- dev-release/v2.0.0-beta.11
- dev-release/v2.0.0-beta.10
- dev-release/v2.0.0-beta.9
- dev-release/v2.0.0-beta.8
- dev-release/v2.0.0-beta.6
- dev-release/v2.0.0-beta.5
- dev-release/v2.0.0-beta.4
- dev-release/v2.0.0-beta.2
- dev-release/v2.0.0-beta.1
- dev-release/v1.0.3
- dev-beta
- dev-release/v1.0.20230301
- dev-release/v1.0.20230228
- dev-release/v1.0.20230227
- dev-21/merge
- dev-20/merge
- dev-18/merge
- dev-feat/wallets
- dev-feat/add_search_in_monorepo
- dev-release/v1.0.0-rc.5
- dev-release/v1.0.0-rc.4
- dev-feat/update-webhooks
- dev-release/v1.0.0-rc.3
- dev-release/v1.0.0-rc.2
- dev-feat/num-1287-stack-update-sdk-with-wallet-component
- dev-feat/feature-branches
- dev-release/v1.0.0-beta.3
This package is auto-updated.
Last update: 2024-12-02 00:09:00 UTC
README
🏗 Welcome to your new SDK! 🏗
It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps:
- 🛠 Make your SDK feel handcrafted by customizing it
- ♻️ Refine your SDK quickly by iterating locally with the Speakeasy CLI
- 🎁 Publish your SDK to package managers by configuring automatic publishing
- ✨ When ready to productionize, delete this section from the README
Summary
Formance Stack API: Open, modular foundation for unique payments flows
Introduction
This API is documented in OpenAPI format.
Authentication
Formance Stack offers one forms of authentication:
- OAuth2 OAuth2 - an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications.
Table of Contents
SDK Installation
The SDK relies on Composer to manage its dependencies.
To install the SDK and add it as a dependency to an existing composer.json
file:
composer require "formance/formance-sdk"
SDK Example Usage
Example
declare(strict_types=1); require 'vendor/autoload.php'; use formance\stack; use formance\stack\Models\Operations; $sdk = stack\SDK::builder()->build(); try { $requestSecurity = new Operations\GetVersionsSecurity( authorization: "<YOUR_AUTHORIZATION_HERE>", ); $response = $sdk->getVersions($requestSecurity); if ($response->getVersionsResponse !== null) { // handle response } } catch (Throwable $e) { // handle exception }
Available Resources and Operations
Available methods
Auth
Ledger
Orchestration
Payments
Reconciliation
SDK
- getVersions - Show stack version information
SDKOrchestrationV1
- cancelEvent - Cancel a running workflow
- createTrigger - Create trigger
- createWorkflow - Create workflow
- deleteTrigger - Delete trigger
- deleteWorkflow - Delete a flow by id
- getInstance - Get a workflow instance by id
- getInstanceHistory - Get a workflow instance history by id
- getInstanceStageHistory - Get a workflow instance stage history
- getWorkflow - Get a flow by id
- listInstances - List instances of a workflow
- listTriggers - List triggers
- listTriggersOccurrences - List triggers occurrences
- listWorkflows - List registered workflows
- orchestrationgetServerInfo - Get server info
- readTrigger - Read trigger
- runWorkflow - Run workflow
- sendEvent - Send an event to a running workflow
SDKPaymentsV1
- addAccountToPool - Add an account to a pool
- connectorsTransfer - Transfer funds between Connector accounts
- createAccount - Create an account
- createBankAccount - Create a BankAccount in Payments and on the PSP
- createPayment - Create a payment
- createPool - Create a Pool
- createTransferInitiation - Create a TransferInitiation
- deletePool - Delete a Pool
- deleteTransferInitiation - Delete a transfer initiation
- forwardBankAccount - Forward a bank account to a connector
- getAccountBalances - Get account balances
- getBankAccount - Get a bank account created by user on Formance
getConnectorTask- Read a specific task of the connector ⚠️ Deprecated- getConnectorTaskV1 - Read a specific task of the connector
- getPayment - Get a payment
- getPool - Get a Pool
- getPoolBalances - Get pool balances
- getTransferInitiation - Get a transfer initiation
- installConnector - Install a connector
- listAllConnectors - List all installed connectors
- listBankAccounts - List bank accounts created by user on Formance
- listConfigsAvailableConnectors - List the configs of each available connector
listConnectorTasks- List tasks from a connector ⚠️ Deprecated- listConnectorTasksV1 - List tasks from a connector
- listPayments - List payments
- listPools - List Pools
- listTransferInitiations - List Transfer Initiations
- paymentsgetAccount - Get an account
- paymentsgetServerInfo - Get server info
- paymentslistAccounts - List accounts
readConnectorConfig- Read the config of a connector ⚠️ Deprecated- readConnectorConfigV1 - Read the config of a connector
- removeAccountFromPool - Remove an account from a pool
resetConnector- Reset a connector ⚠️ Deprecated- resetConnectorV1 - Reset a connector
- retryTransferInitiation - Retry a failed transfer initiation
- reverseTransferInitiation - Reverse a transfer initiation
- udpateTransferInitiationStatus - Update the status of a transfer initiation
uninstallConnector- Uninstall a connector ⚠️ Deprecated- uninstallConnectorV1 - Uninstall a connector
- updateBankAccountMetadata - Update metadata of a bank account
- updateConnectorConfigV1 - Update the config of a connector
- updateMetadata - Update metadata
SDKReconciliationV1
- createPolicy - Create a policy
- deletePolicy - Delete a policy
- getPolicy - Get a policy
- getReconciliation - Get a reconciliation
- listPolicies - List policies
- listReconciliations - List reconciliations
- reconcile - Reconcile using a policy
- reconciliationgetServerInfo - Get server info
SDKSearchV1
- search - search.v1
- searchgetServerInfo - Get server info
SDKV1
- createTransactions - Create a new batch of transactions to a ledger
- addMetadataOnTransaction - Set the metadata of a transaction by its ID
- addMetadataToAccount - Add metadata to an account
- countAccounts - Count the accounts from a ledger
- countTransactions - Count the transactions from a ledger
- createTransaction - Create a new transaction to a ledger
- getAccount - Get account by its address
- getBalances - Get the balances from a ledger's account
- getBalancesAggregated - Get the aggregated balances from selected accounts
- getInfo - Show server information
- getLedgerInfo - Get information about a ledger
- getMapping - Get the mapping of a ledger
- getTransaction - Get transaction from a ledger by its ID
- listAccounts - List accounts from a ledger
- listLogs - List the logs from a ledger
- listTransactions - List transactions from a ledger
- readStats - Get statistics from a ledger
- revertTransaction - Revert a ledger transaction by its ID
runScript- Execute a Numscript ⚠️ Deprecated- updateMapping - Update the mapping of a ledger
SDKV2
- cancelEvent - Cancel a running workflow
- createTrigger - Create trigger
- createWorkflow - Create workflow
- deleteTrigger - Delete trigger
- deleteWorkflow - Delete a flow by id
- getInstance - Get a workflow instance by id
- getInstanceHistory - Get a workflow instance history by id
- getInstanceStageHistory - Get a workflow instance stage history
- getServerInfo - Get server info
- getWorkflow - Get a flow by id
- listInstances - List instances of a workflow
- listTriggers - List triggers
- listTriggersOccurrences - List triggers occurrences
- listWorkflows - List registered workflows
- readTrigger - Read trigger
- runWorkflow - Run workflow
- sendEvent - Send an event to a running workflow
- testTrigger - Test trigger
SDKWalletsV1
- confirmHold - Confirm a hold
- createBalance - Create a balance
- createWallet - Create a new wallet
- creditWallet - Credit a wallet
- debitWallet - Debit a wallet
- getBalance - Get detailed balance
- getHold - Get a hold
- getHolds - Get all holds for a wallet
- getTransactions
- getWallet - Get a wallet
- getWalletSummary - Get wallet summary
- listBalances - List balances of a wallet
- listWallets - List all wallets
- updateWallet - Update a wallet
- voidHold - Cancel a hold
- walletsgetServerInfo - Get server info
SDKWebhooksV1
- activateConfig - Activate one config
- changeConfigSecret - Change the signing secret of a config
- deactivateConfig - Deactivate one config
- deleteConfig - Delete one config
- getManyConfigs - Get many configs
- insertConfig - Insert a new config
- testConfig - Test one config
Search
V1
- createClient - Create client
- createSecret - Add a secret to a client
- deleteClient - Delete client
- deleteSecret - Delete a secret from a client
- getOIDCWellKnowns - Retrieve OpenID connect well-knowns.
- getServerInfo - Get server info
- listClients - List clients
- listUsers - List users
- readClient - Read client
- readUser - Read user
- updateClient - Update client
V2
- addMetadataOnTransaction - Set the metadata of a transaction by its ID
- addMetadataToAccount - Add metadata to an account
- countAccounts - Count the accounts from a ledger
- countTransactions - Count the transactions from a ledger
- createBulk - Bulk request
- createLedger - Create a ledger
- createTransaction - Create a new transaction to a ledger
- deleteAccountMetadata - Delete metadata by key
- deleteLedgerMetadata - Delete ledger metadata by key
- deleteTransactionMetadata - Delete metadata by key
- exportLogs - Export logs
- getAccount - Get account by its address
- getBalancesAggregated - Get the aggregated balances from selected accounts
- getInfo - Show server information
- getLedger - Get a ledger
- getLedgerInfo - Get information about a ledger
- getTransaction - Get transaction from a ledger by its ID
- getVolumesWithBalances - Get list of volumes with balances for (account/asset)
- importLogs
- listAccounts - List accounts from a ledger
- listLedgers - List ledgers
- listLogs - List the logs from a ledger
- listTransactions - List transactions from a ledger
- readStats - Get statistics from a ledger
- revertTransaction - Revert a ledger transaction by its ID
- updateLedgerMetadata - Update ledger metadata
Wallets
Webhooks
Server Selection
Server Selection
Select Server by Index
You can override the default server globally by passing a server index to the server_idx: int
optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:
Variables
Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance:
environment: stack\ServerEnvironment
organization: string
Override Server URL Per-Client
The default server can also be overridden globally by passing a URL to the server_url: str
optional parameter when initializing the SDK client instance. For example:
Development
Maturity
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally looking for the latest version.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!