dwolla / dwolla-php
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/dwolla/dwolla-php
Requires
- php: >=8.2
- brick/date-time: >=0.7.0
- brick/math: >=0.12.1
- galbar/jsonpath: >=3.0
- guzzlehttp/guzzle: ^7.0
- phpdocumentor/type-resolver: >=1.8
- speakeasy/serializer: ^4.0.3
Requires (Dev)
- laravel/pint: >=1.21.2
- phpstan/phpstan: >=2.1.0
- phpunit/phpunit: >=10
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2026-01-21 15:15:50 UTC
README
The official PHP SDK for the Dwolla API. Supports server-side PHP calls to Dwolla’s endpoints with typed models, simple client helpers, and OAuth token handling to manage customers, funding sources, transfers, webhooks, and more.
Important
Beta Release – This SDK is currently in beta. We have run smoke coverage (SDK build/clients) and a sandbox getting-started flow (root, list customers, create unverified customer, add funding source). Broader operation coverage and retry wiring are still in progress. Breaking changes may occur as we continue hardening and expanding tests; use with caution in production. We welcome beta users to integrate, report issues, and help us catch edge cases.
Summary
Dwolla API: Dwolla API Documentation
Table of Contents
SDK Installation
Tip
To finish publishing your SDK you must run your first generation action.
The SDK relies on Composer to manage its dependencies.
To install the SDK first add the below to your composer.json file:
{
"repositories": [
{
"type": "github",
"url": "<UNSET>.git"
}
],
"require": {
"dwolla/dwolla-php": "*"
}
}
Then run the following command:
composer update
SDK Example Usage
Example
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Operations; $sdk = Dwolla\Dwolla::builder()->build(); $request = new Operations\CreateApplicationAccessTokenRequest( grantType: Operations\GrantType::ClientCredentials, ); $requestSecurity = new Operations\CreateApplicationAccessTokenSecurity( basicAuth: '<YOUR_API_KEY_HERE>', ); $response = $sdk->tokens->create( request: $request, security: $requestSecurity ); if ($response->object !== null) { // handle response }
Authentication
Per-Client Security Schemes
This SDK supports the following security scheme globally:
| Name | Type | Scheme |
|---|---|---|
clientIDclientSecrettokenURL |
oauth2 | OAuth2 Client Credentials Flow |
You can set the security parameters through the setSecurity function on the SDKBuilder when initializing the SDK. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Components; $sdk = Dwolla\Dwolla::builder() ->setSecurity( new Components\Security( clientID: '<YOUR_CLIENT_ID_HERE>', clientSecret: '<YOUR_CLIENT_SECRET_HERE>', ) ) ->build(); $response = $sdk->root->get( ); if ($response->root !== null) { // handle response }
Per-Operation Security Schemes
Some operations in this SDK require the security scheme to be specified at the request level. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Operations; $sdk = Dwolla\Dwolla::builder()->build(); $request = new Operations\CreateApplicationAccessTokenRequest( grantType: Operations\GrantType::ClientCredentials, ); $requestSecurity = new Operations\CreateApplicationAccessTokenSecurity( basicAuth: '<YOUR_API_KEY_HERE>', ); $response = $sdk->tokens->create( request: $request, security: $requestSecurity ); if ($response->object !== null) { // handle response }
Available Resources and Operations
Available methods
Accounts
- get - Retrieve account details
Accounts.Exchanges
Accounts.FundingSources
Accounts.MassPayments
- list - List account mass payments
Accounts.Transfers
- list - List and search account transfers
BeneficialOwners
BeneficialOwners.Documents
BusinessClassifications
ClientTokens
- create - Create a client token
Customers
- list - List and search customers
- create - Create a customer
- get - Retrieve a customer
- update - Update a customer
- listAvailableConnections - List available exchange connections
Customers.BeneficialOwners
Customers.BeneficialOwnership
Customers.Documents
Customers.Exchanges
Customers.ExchangeSessions
- create - Create customer exchange session
Customers.FundingSources
Customers.Kba
- initiate - Initiate a KBA session
Customers.Labels
Customers.MassPayments
- list - List mass payments for customer
Customers.Transfers
- list - List and search transfers for a customer
Documents
- get - Retrieve a document
Events
ExchangePartners
Exchanges
- get - Retrieve exchange resource
Exchanges.ExchangeSessions
- createReAuth - Create re-authentication exchange session
ExchangeSessions
- get - Retrieve exchange session
FundingSources
- get - Retrieve a funding source
- updateOrRemove - Update or remove a funding source
- getVanRouting - Retrieve VAN account and routing numbers
FundingSources.Balance
- get - Retrieve funding source balance
FundingSources.MicroDeposits
- get - Retrieve micro-deposits details
- initiate - Initiate micro-deposits
- verify - Verify micro-deposits
FundingSources.OnDemandTransferAuthorizations
- create - Create an on-demand transfer authorization
Kba
- getQuestions - Retrieve KBA Questions
- verify - Verify KBA Questions
Labels
Labels.LedgerEntries
- list - List label ledger entries
- create - Create a label ledger entry
- get - Retrieve a label ledger entry
Labels.Reallocations
MassPayments
MassPayments.Items
Root
- get - root
SandboxSimulations
- simulate - Simulate bank transfer processing (Sandbox only)
Tokens
- create - Create an application access token
Transfers
Transfers.Failure
- get - Retrieve a transfer failure reason
Transfers.Fees
- list - List fees for a transfer
Webhooks
Webhooks.Retries
- list - List retries for a webhook
WebhookSubscriptions
- list - List webhook subscriptions
- create - Create a webhook subscription
- get - Retrieve a webhook subscription
- update - Update a webhook subscription
- delete - Delete a webhook subscription
WebhookSubscriptions.Webhooks
- list - List webhooks for a webhook subscription
Error Handling
Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an exception.
By default an API error will raise a Errors\APIException exception, which has the following properties:
| Property | Type | Description |
|---|---|---|
$message |
string | The error message |
$statusCode |
int | The HTTP status code |
$rawResponse |
?\Psr\Http\Message\ResponseInterface | The raw HTTP response |
$body |
string | The response content |
When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective Errors tables in SDK docs for more details on possible exception types for each operation. For example, the create method throws the following exceptions:
| Error Type | Status Code | Content Type |
|---|---|---|
| Errors\UnauthorizedException | 401 | application/json |
| Errors\APIException | 4XX, 5XX | */* |
Example
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Errors; use Dwolla\Models\Operations; $sdk = Dwolla\Dwolla::builder()->build(); try { $request = new Operations\CreateApplicationAccessTokenRequest( grantType: Operations\GrantType::ClientCredentials, ); $requestSecurity = new Operations\CreateApplicationAccessTokenSecurity( basicAuth: '<YOUR_API_KEY_HERE>', ); $response = $sdk->tokens->create( request: $request, security: $requestSecurity ); if ($response->object !== null) { // handle response } } catch (Errors\UnauthorizedExceptionThrowable $e) { // handle $e->$container data throw $e; } catch (Errors\APIException $e) { // handle default exception throw $e; }
Server Selection
Select Server by Name
You can override the default server globally using the setServer(string $serverName) builder method 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 names associated with the available servers:
| Name | Server | Description |
|---|---|---|
prod |
https://api.dwolla.com |
Production server |
sandbox |
https://api-sandbox.dwolla.com |
Sandbox server |
Example
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Operations; $sdk = Dwolla\Dwolla::builder() ->setServer('prod') ->build(); $request = new Operations\CreateApplicationAccessTokenRequest( grantType: Operations\GrantType::ClientCredentials, ); $requestSecurity = new Operations\CreateApplicationAccessTokenSecurity( basicAuth: '<YOUR_API_KEY_HERE>', ); $response = $sdk->tokens->create( request: $request, security: $requestSecurity ); if ($response->object !== null) { // handle response }
Override Server URL Per-Client
The default server can also be overridden globally using the setServerUrl(string $serverUrl) builder method when initializing the SDK client instance. For example:
declare(strict_types=1); require 'vendor/autoload.php'; use Dwolla; use Dwolla\Models\Operations; $sdk = Dwolla\Dwolla::builder() ->setServerURL('https://api.dwolla.com') ->build(); $request = new Operations\CreateApplicationAccessTokenRequest( grantType: Operations\GrantType::ClientCredentials, ); $requestSecurity = new Operations\CreateApplicationAccessTokenSecurity( basicAuth: '<YOUR_API_KEY_HERE>', ); $response = $sdk->tokens->create( request: $request, security: $requestSecurity ); if ($response->object !== null) { // handle response }
Maturity
This SDK is currently in beta; expect potential breaking changes while we stabilize. We follow Semantic Versioning for published versions, but until GA we recommend pinning to an exact version and validating in your environment.
Contributions
While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release.