1.7.0 2021-04-16 18:33 UTC


The new Dwolla API V2 SDK, as generated by this fork of swagger-codegen.

Additionally, temporary PHP 7.4 support was added using these replaces:

  • \$this\->([a-z0-9\_]+) = \$data\["([a-z0-9\_]+)"\]\; into \$this->$1 = \$data\["$2"\] ?? null;




DwollaSwagger is available on Packagist, and can therefore be installed with Composer.

composer require dwolla/dwollaswagger
composer install

To use, just require your composer autoload.php file.



DwollaSwagger makes it easy for developers to hit the ground running with our API. Before attempting the following, you should ideally create an application key and secret.

Configuring a client

To get started, you need to set the username(API Key), password (API Secret) and host values.

DwollaSwagger\Configuration::$username = 'API_KEY';
DwollaSwagger\Configuration::$password = 'API_SECRET';

# For Sandbox
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com");

# For production
$apiClient = new DwollaSwagger\ApiClient("https://api.dwolla.com");

Obtaining an access token

All requests to the API require a valid OAuth access token in order authenticate succesfully. Refer to the section above on configuring a client before making this request.

$tokensApi = new DwollaSwagger\TokensApi($apiClient);

$appToken = $tokensApi->token();

List 10 customers

Now that we've set up our client, we can use it to make requests to the API. Let's retrieve 10 customer records associated with the authorization token used.

DwollaSwagger\Configuration::$access_token = 'app token';
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com/");

$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$customers = $customersApi->_list(10);

Creating a new customer

To create a customer, we can either provide an (associative) array with the expected values, or a CreateCustomer object.

$location = $customersApi->create([
    'firstName' => 'Jennifer',
    'lastName' => 'Smith',
    'email' => 'jsmith@gmail.com',
    'phone' => '7188675309'
    'Idempotency-Key' => '9051a62-3403-11e6-ac61-9e71128cae77'


$jenny = new DwollaSwagger\CreateCustomer();
$jenny->firstName = 'Jennifer';
$jenny->lastName = 'Smith';
$jenny->email = 'jsmith@gmail.com';
$jenny->phone = '7188675309'

$location = $customersApi->create($jenny);

$location will contain a URL to your newly created resource (HTTP 201 / Location header).

Searching and filtering Customers

When searching for Customers, you can pass in optional query string parameters to narrow down and filter the list of Customers returned. For more information check out the Dwolla API reference documentation. The schema for adding optional query string parameters to the List Customers endpoint is as follows -
$customersApi->_list(limit, offset, search, status, headers, email)

Here are some examples:

Let's retrieve 10 customer records that have a status of document.

DwollaSwagger\Configuration::$access_token = 'a token';
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com/");

$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$customers = $customersApi->_list(10, 0, null, 'document');

Let's retrieve a list of customer records and filter them based on the email query string parameter. We're also passing in a custom Idempotency-key header. You can pass in null if you're not adding any custom headers.

DwollaSwagger\Configuration::$access_token = 'a token';
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com/");

$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$customers = $customersApi->_list(10, 0, null, null, [
    'Idempotency-Key' => '51a62-3403-11e6-ac61-9e71128cae77'
], 'jane@email.com');


DwollaSwagger contains API modules which allow the user to make requests, as well as models which are DAOs that the library uses to serialize responses.


Each API module is named in accordance to (Dwolla's API Spec and encapsulates all of the documented functionality.

  • AccountsApi
  • BusinessclassificationsApi
  • CustomersApi
  • DocumentsApi
  • EventsApi
  • FundingsourcesApi
  • KbaApi
  • LabelsApi
  • LabelreallocationsApi
  • LedgerentriesApi
  • MasspaymentitemsApi
  • MasspaymentsApi
  • OndemandauthorizationsApi
  • RootApi
  • SandboxApi
  • TokensApi
  • TransfersApi
  • WebhooksApi
  • WebhooksubscriptionsApi

API objects take an ApiClient argument, which you created here.

$documentsApi = new DwollaSwagger\DocumentsApi($apiClient);


Each model represents the different kinds of requests and responses that can be made with the Dwolla API. View the full list in the models directory.



  • New getCustomerCardToken method added to CustomersAPI for creating a card funding sources token for a customer.


  • New TokenApi adding support for application access token and client token requests.


  • API schema updated, CustomersApi updated to add support for email parameter on list customers.


  • Fix bug in #43 to replace null-coalesce operator with backwards-compatible ternary.


  • Add temporary support fix for PHP 7.4. Issue #41. (Thanks @oprypkhantc!)


  • Add support for custom headers on all requests. (e.g. Idempotency-Key header)


  • API schema updated, CustomersApi updated to support KBA related endpoint.
  • New KbaApi.
  • Existing Document model updated.
  • New AnswerKbaQuestionsRequest, AnswerKbaQuestionsResponse, AnsweredKbaQuestion, KbaQuestion.php, KbaAnswer models.


  • API schema updated, CustomersApi updated to support Labels related endpoints.
  • New LabelsApi, LabelreallocationsApi, and LedgerentriesApi.
  • Existing CreateCustomer, Customer, MassPaymentRequestBody, MassPaymentRequestBody, Owner, Transfer, TransferRequestBody and UpdateCustomer models updated.
  • New AddLabelLedgerEntryRequest, CreateCustomerLabelRequest, Label, LabelListResponse, LabelReallocation, LabelReallocationRequest, LedgerEntry, and LedgerEntryListResponse models.


  • Fix previously patched issue with parsing Location header in 201 response in ApiClient.


  • Patch 201 response in ApiClient.


  • Patch controller in CreateCustomer model.


  • API schema updated, CustomersApi updated to support beneficial owner related endpoints, as well as support added for status filter on Customer search.
  • New BeneficialownersApi.
  • Existing CreateCustomer, CreateFundingSourceRequest, Customer, FundingSourceBalance, TransferFailure, and UpdateCustomer models updated.
  • New Address, BeneficialOwnerListResponse, CertifyRequest, CreateOwnerRequest, FullAccountInfo, Owner, Ownership, Passport, and UpdateOwnerRequest models.


  • API schema updated, FundingsourcesApi updated to support update a funding source. MasspaymentsApi and MasspaymentitemsApi updated to support filtering by correlationId.
  • New SandboxApi which is used to simulate bank transfer processing in the Sandbox.
  • Existing CreateFundingSourceRequest, FundingSource, MassPayment, MassPaymentItem, MassPaymentItemRequestBody, MassPaymentRequestBody, Transfer, TransferFailure, and TransferRequestBody models updated.
  • New ProcessResult, UpdateBankRequest, and UpdateJobRequestBody models.


  • Optional parameters set to null.


  • Trim trailing slash from host url on initialization.


  • Add control over IPV4 and V6 connections.


  • API schema updated, CustomersApi updated to allow for null limit, offset, and search. Existing CreateFundingSourceRequest, FundingSource, HalLink, MicroDepositsInitiated, Transfer, and TransferRequestBody models updated. New Clearing and FailureDetails models.
  • Fix README example for creating a Customer.


  • API schema updated, WebhooksubscriptionsApi supports pause a webhook subscription. FundingsourcesApi contains support for removed parameter on list funding sources.
  • Fix getFeesBySource to support deserialization with new FeesBySourceResponse model.


  • Patch soft delete to deserialize with FundingSource model.


  • Add boolean type to fix deserialization


  • API schema updated, FundingSourcesApi supports balance check endpoint
  • Fix transfer failure to support deserialization with new transfer failure model.


  • API schema updated, CustomersAPI supports Customer search, new softDelete method in FundingSourcesApi.


  • API schema updated, TransfersApi has new endpoints for cancel a transfer and get a transfer's fees, new OndemandauthorizationsApi, new MasspaymentsApi.
  • Existing Document, CreateFundingSourceRequest, and TransferRequestBody models updated, new MassPayment, Authorization, UpdateTransfer, and FacilitatorFeeRequest models.


  • API schema error fixed, FundingSource object now has _embedded key to fix serialization issues.


  • Avoid use of function names if found in list of PHP reserved words.
  • API schema updated, CustomersApi has new endpoints for IAV verification.
  • Existing Customer related models updated, new VerificationToken model.
  • (release skipped, features in 1.0.5)


  • API schema updated, RootApi now added.
  • Changed auth_token to access_token in compliance with RFC-6749 recommended nomenclature.


  • API schema updated, new methods in FundingsourcesApi.
  • All methods which take Swagger variables in path (e.g, /resource/{id}) can now be passed a resource URL to make it easier for HAL-styled API consumption.
  • More idiomatic response logic for HTTP 201 responses.


  • API schema updated, new methods in CustomersApi and TransfersApi


  • Initial release.


This wrapper is semantically generated by a fork of swagger-codegen.


Copyright 2018 Swagger Contributors, David Stancu

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at


Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.