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

v0.0.1-beta.1 2026-01-20 18:43 UTC

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
clientID
clientSecret
tokenURL
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

  • list - List exchanges for an account
  • create - Create an exchange for an account

Accounts.FundingSources

  • create - Create a funding source for an account
  • list - List funding sources for an account

Accounts.MassPayments

  • list - List account mass payments

Accounts.Transfers

  • list - List and search account transfers

BeneficialOwners

  • get - Retrieve beneficial owner
  • update - Update beneficial owner
  • delete - Remove beneficial owner

BeneficialOwners.Documents

  • list - List documents for beneficial owner
  • create - Create a document for beneficial owner

BusinessClassifications

  • list - List business classifications
  • get - Retrieve a business classification

ClientTokens

  • create - Create a client token

Customers

Customers.BeneficialOwners

  • list - List customer beneficial owners
  • create - Create customer beneficial owner

Customers.BeneficialOwnership

  • get - Retrieve beneficial ownership status
  • certify - Certify beneficial ownership

Customers.Documents

  • list - List documents for customer
  • create - Create a document for customer

Customers.Exchanges

  • list - List exchanges for a customer
  • create - Create an exchange for a customer

Customers.ExchangeSessions

  • create - Create customer exchange session

Customers.FundingSources

  • list - List customer funding sources
  • create - Create customer funding source

Customers.Kba

Customers.Labels

  • list - List labels for a customer
  • create - Create a label for a customer

Customers.MassPayments

  • list - List mass payments for customer

Customers.Transfers

  • list - List and search transfers for a customer

Documents

  • get - Retrieve a document

Events

  • list - List events
  • get - Retrieve event

ExchangePartners

  • list - List exchange partners
  • get - Retrieve exchange partner

Exchanges

  • get - Retrieve exchange resource

Exchanges.ExchangeSessions

ExchangeSessions

  • get - Retrieve exchange session

FundingSources

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

Labels

  • get - Retrieve a label
  • remove - Remove a label

Labels.LedgerEntries

  • list - List label ledger entries
  • create - Create a label ledger entry
  • get - Retrieve a label ledger entry

Labels.Reallocations

  • create - Create a label reallocation
  • get - Retrieve a label reallocation

MassPayments

  • create - Initiate a mass payment
  • get - Retrieve a mass payment
  • update - Update a mass payment

MassPayments.Items

  • list - List items for a mass payment
  • get - Retrieve mass payment item

Root

SandboxSimulations

  • simulate - Simulate bank transfer processing (Sandbox only)

Tokens

  • create - Create an application access token

Transfers

  • create - Initiate a transfer
  • get - Retrieve a transfer
  • cancel - Cancel a transfer

Transfers.Failure

  • get - Retrieve a transfer failure reason

Transfers.Fees

  • list - List fees for a transfer

Webhooks

  • get - Retrieve a webhook
  • retry - Retry a webhook

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.