Creating a Payment Destination

What is a Destination?

A Destination is a bank account that you want your customer to be able transfer money into.

Create a new Destination

Call the Destinations endpoint in the Payments API to create a new Destination resource:

Call:

curl -X POST 'https://sandbox.leantech.me/payments/v1/destinations' \
  --header 'Content-Type: application/json' \
  --header 'lean-app-token: YOUR_APP_TOKEN' \
  --data-raw '{
    "display_name": "Acme USD Account",
    "name": "Acme Inc",
    "bank_identifier": "ENBD_UAE",
    "address": "123 Fake St",
    "city": "Dubai",
    "country": "ARE",
    "account_number": "1008223921001",
    "swift_code": "EBILAEAD"
    "iban": "AE260260001008223921001",
  }'

Response:

{
  "id": "266733cc-6f46-4e87-af7e-9bb46b99601d"
  "display_name": "Acme USD Account",
  "name": "Acme Inc.",
  "bank_identifier": "ENBD_UAE",
  "address": "123 Fake St.",
  "city": "Dubai",
  "country": "ARE",
  "account_number": "1008223921001",
  "swift_code": "EBILAEAD"
  "iban": "AE260260001008223921001",
}

You should store the ID of this Destination resource - as it will be used to determine where you route customer funds to in later stages.

Fetch a list of all destinations

If you would like to retrieve a list of all created Destinations in your application, you can make a GET request to the Destinations endpoint:

GET https://sandbox.leantech.me/payments/v1/destinations

Did this page help you?