Skip to content

Latest commit

 

History

History
128 lines (90 loc) · 8.69 KB

File metadata and controls

128 lines (90 loc) · 8.69 KB

Customers.Exchanges

Overview

Available Operations

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

list

Returns all exchanges for a specific customer. Exchanges represent connections between the customer's external bank accounts and open banking partners. Includes exchange status, creation date, and links to associated funding sources and partners.

Example Usage

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->customers->exchanges->list(
    id: '<id>'
);

if ($response->exchanges !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The ID of the Customer to list exchanges for

Response

?Operations\ListCustomerExchangesResponse

Errors

Error Type Status Code Content Type
Errors\ListCustomerExchangesDwollaV1HalJSONException 404 application/vnd.dwolla.v1.hal+json
Errors\APIException 4XX, 5XX */*

create

Creates an exchange connection between a customer and Dwolla. Request body varies by partner (Plaid, MX, Flinks, Finicity, Checkout.com). For bank accounts, use Plaid, MX, Flinks, or Finicity to establish secure access to the customer's bank account data. For debit cards (Push to Card), use Checkout.com and pass the payment ID from Checkout.com Flow.

Example Usage

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->customers->exchanges->create(
    id: '<id>',
    body: new Components\CreatePlaidOpenBankingExchange(
        links: new Components\CreatePlaidOpenBankingExchangeLinks(
            exchangePartner: new Components\CreatePlaidOpenBankingExchangeExchangePartner(
                href: 'https://api.dwolla.com/exchange-partners/f53ffb32-c84f-496a-9d9d-acd100d396ef',
            ),
        ),
        plaid: new Components\Plaid(
            publicToken: 'public-production-d5456acb-01d5-4932-9783-e4c883cf1c0c',
        ),
    )

);

if ($response->statusCode === 200) {
    // handle response
}

Parameters

Parameter Type Required Description
id string ✔️ The ID of the customer to create an exchange for
body Components\CreateFinicitySecureExchange|Components\CreateTokenBasedExchange|Components\CreateMXOpenBankingExchange|Components\CreatePlaidOpenBankingExchange ✔️ N/A

Response

?Operations\CreateCustomerExchangeResponse

Errors

Error Type Status Code Content Type
Errors\InvalidExchangeTokenException 400 application/vnd.dwolla.v1.hal+json
Errors\InvalidExchangeException 400 application/vnd.dwolla.v1.hal+json
Errors\CreateCustomerExchangeResponseBodyException1 401 application/vnd.dwolla.v1.hal+json
Errors\CreateCustomerExchangeResponseBodyException2 401 application/vnd.dwolla.v1.hal+json
Errors\NotFoundError 404 application/vnd.dwolla.v1.hal+json
Errors\APIException 4XX, 5XX */*