Payment Destinations

A Payment Destination is a representation of an account that you want customers to be able to transfer money to using the Payments API. Destinations can be owned by Customers or Applications - allowing bank-to-bank transfers between users and your business or between customers themselves without taking custody of funds.

ENDPOINTS

POST /payments/v1/destinations
GET /payments/v1/destinations
GET /payments/v1/destinations/:payment_destination_id

The Payment Destination object

Attributes

id string

The unique identifier for the Payment Destination object.


bank_identifer string

The Lean identifier for the bank that controls the Payment Destination.


name string

The name of the legal entity that owns the account.


iban string

The IBAN for the account.


display_name string

The friendly name of the account holder (to be displayed to customers during payments).


account_number string

The account number for the associated account.


swift_code string

The swift code for the associated account.


address string

The address the owner of the destination bank account has registered with the bank.


city string

The city that the holding financial institution is located in.


country string

The three letter ISO code that the holding financial institution is located in.


default bool

When true this Destination is automatically populated into Payment Intents where an alternative payment_destination_id is not provided.


customer_id String

The Customer who owns the account (can be null if not attached to a customer).


owner_type enum

Indicates the underlying owner of the account. Can be APPLICATION for business owned account or CUSTOMER for user owned accounts.


json

{
"id": "1eca66c3-1661-498a-a9fb-bc2bbd9a67b8",
"bank_identifier": "ENBD_UAE",
"name": "Al Fulani",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Al Fulani",
"account_number": "XXXXXXXXXXXX",
"swift_code": "EBILAEADXXX",
"status": "CONFIRMED",
"address": "1234 Sky Bldg.",
"country": "ARE",
"city": "Abu Dhabi",
"default": false,
"customer_id": "f08fb010-878f-407a-9ac2-a7840fb56185",
"owner_type": "CUSTOMER"
}

Create a Payment Destination

Parameters

bank_identifier string

The Lean bank identifier for the holding financial institution. A list of bank identifiers can be retrieved from the Banks endpoint.


name string

The name of the legal entity that owns the account.


iban string

The IBAN for the account.


display_name string

The friendly display name for the account. This is rendered in the LinkSDK when referencing the Destination.


status enum

The status of the Destination

address string

The address the owner of the destination bank account has registered with the bank.

city string

The city that the holding financial institution is located in.

country string

The three letter ISO code for the holding financial institution's country.

swift_code string

The swift code for the account

account_number string

The account number for the account.

customer_id string

The Customer object associated with this account. This field is optional, and will designate the Destination as owned by the application if not provided.

bash

curl -X POST 'https://sandbox.leantech.me/payments/v1/destinations' \
--header 'lean-app-token: YOUR_APP_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"bank_identifier": "ENBD_UAE",
"name": "Al Fulani",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Al Fulani",
"address": "1234 Sky Bldg.",
"city": "Abu Dhabi",
"country": "ARE",
"swift_code": "EBILAEADXXX",
"account_number": "XXXXXXXXXXXX",
"customer_id": "f08fb010-878f-407a-9ac2-a7840fb56185"
}'

json

{
"id": "1eca66c3-1661-498a-a9fb-bc2bbd9a67b8",
"bank_identifier": "ENBD_UAE",
"name": "Al Fulani",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Al Fulani",
"account_number": "XXXXXXXXXXXX",
"swift_code": "EBILAEADXXX",
"status": "CONFIRMED",
"address": "1234 Sky Bldg.",
"country": "ARE",
"city": "Abu Dhabi",
"default": false,
"customer_id": "f08fb010-878f-407a-9ac2-a7840fb56185",
"owner_type": "CUSTOMER"
}

Retrieve a list of all Payment Destinations

You can retrieve a list of all Payment Destinations you have in Lean by making a GET request to the destinations endpoint.

bash

curl -X GET 'https://sandbox.leantech.me/payments/v1/destinations' \
--header 'lean-app-token: YOUR_APP_TOKEN' \
--header 'Content-Type: application/json'

json

[
{
"id": "517f416f-6632-407f-9110-18e11a4fd4d2",
"bank_identifier": "ENBD_UAE",
"name": "Acme Corp.",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Acme Corp.",
"account_number": "XXXXXXXXXXXX",
"swift_code": "FGBMAEAA",
"status": "CONFIRMED",
"address": "1234 1234",
"country": "ARE",
"city": "Abu Dhabi",
"default": false,
"customer_id": "f08fb010-878f-407a-9ac2-a7840fb56185",
"owner_type": "CUSTOMER"
},
{
"id": "4cd7a53a-6bb5-4562-9433-8a24a4558551",
"bank_identifier": "FAB_UAE",
"name": "Al Fulani",
"iban": "AE060357771004664528001",
"display_name": "Al Fulani",
"account_number": "7771004664528001",
"swift_code": "FGBMAEAA",
"status": "CONFIRMED",
"address": "Level 4, WeWork Hub71",
"country": "ARE",
"city": "Abu Dhabi",
"default": true,
"customer_id": null,
"owner_type": "APPLICATION"
}
]

Retrieve a single Payment Destination

You can retrieve a single Payment Destination from Lean by making a GET request to the destinations endpoint and specifying the id.

bash

curl -X GET 'https://sandbox.leantech.me/payments/v1/destinations/517f416f-6632-407f-9110-18e11a4fd4d2' \
--header 'lean-app-token: YOUR_APP_TOKEN' \
--header 'Content-Type: application/json'

json

{
"id": "517f416f-6632-407f-9110-18e11a4fd4d2",
"bank_identifier": "ENBD_UAE",
"name": "Acme Corp.",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Acme Corp.",
"account_number": "XXXXXXXXXXXX",
"swift_code": "FGBMAEAA",
"status": "CONFIRMED",
"address": "1234 1234",
"country": "ARE",
"city": "Abu Dhabi",
"default": false,
"customer_id": "f08fb010-878f-407a-9ac2-a7840fb56185",
"owner_type": "CUSTOMER"
}

Retrieve all Destinations attached to a Customer

Responds with an Array of Destination objects that are owned by the Customer (i.e. their own bank accounts)

bash

curl -X GET 'https://sandbox.leantech.me/customers/v1/:customer_id/destinations' \
--header 'lean-app-token: YOUR_APP_TOKEN' \
--header 'Content-Type: application/json'

json

[
{
"id": "517f416f-6632-407f-9110-18e11a4fd4d2",
"bank_identifier": "ENBD_UAE",
"name": "Acme Corp.",
"iban": "AE870200000XXXXXXXXXXXX",
"display_name": "Acme Corp.",
"account_number": "XXXXXXXXXXXX",
"swift_code": "FGBMAEAA",
"status": "CONFIRMED",
"address": "1234 1234",
"country": "ARE",
"city": "Abu Dhabi",
"default": false
}
]