Overview
Payments are instructions that Payable sends to the bank to send money from your account.
We support different schemes for the UK, Europe and the Nordics. This includes SEPA Credit Transfers and Danish schemes.
Let's assume you want to send €15 using SEPA Credit transfer. This could be a customer withdrawing the funds, paying a user or moving funds between corporate accounts, etc.
To do so, you will need to create Payment Order Webhooks with a Create a counterparty.
Before making requests, you will need your API Key, and source account ID.
1. Retrieve your account ID
Sources & Account IDs
Payable uses the term accounts or sources to refer to your bank accounts.
When you create a payment order, you must tell us your originating bank account. If you are sending funds to someone, this is the account that the money will be taken out of.
If you want to Get an account, you can use the following request:
curl --request GET \
--url https://api.payable.co/accounts/id \
--header 'accept: application/json'
{
"id": "acc_buqtzoruk7x44iqdn3zmxt26iu",
"label": "string",
"currency": "EUR",
"type": "bank",
"references": [
"customer-loan-123"
],
"institution_id": "string",
"connection_ids": [
"con_buea4ma3bszo5vojc46jsv7rcm"
],
"links": [
{
"href": "https://api.payable.co/accounts/acc_buqtzoruk7x44iqdn3zmxt26iu",
"rel": "self",
"method": "GET"
}
]
}
2. Create a Counterparty
Counterparties are your users, customers or vendors and it is how Payable helps you store their information to speed up making a payment instruction to a bank.
curl --request POST \
--url https://api.payable.co/counterparties \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"bank_details": {
"type": "business",
"iban": "DE1420041010050500013M02606",
"bic": "CHASUS33XXX"
},
"name": "Jon Doe",
"address": "Hauptstraße 1, 10010 Berlin, Germany",
"email_address": "[email protected]"
}
'
{
"id": "cou_anoc3zzw2miuultdybdtmmwmwq",
"bank_details_id": "ban_lbpca6sai559avqigf70p7yftn",
"created_at": "2022-10-25T00:00:00.000Z",
"links": [
{
"href": "https://api.payable.co/counterparties/cou_anoc3zzw2miuultdybdtmmwmwq",
"rel": "self",
"method": "GET"
}
]
}
The response returns a new Counterparty object. You will need the counterparty_id
and bank_details_id
for the next step as the destination account.
3. Create a Payment Order
To create a payment order, you can use the counterparty_id
as the Destination Account, or pass the bank account details on the request.
Different bank details will be required depending on the payment scheme - for example SEPA payment requests are different to Faster Payments.
curl --request POST \
--url https://api.payable.co/payment-orders \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"amount": {
"value": 1000,
"currency": "EUR"
},
"destination_account": {
"counterparty_id": "cou_anoc3zzw2miuultdybdtmmwmwq",
"bank_details_id": "ban_lbpca6sai559avqigf70p7yftn"
},
"entity_id": "ent_bjec24xmzi4tr4g7m4lliotzz4",
"type": "SEPA_CT",
"source_id": "acc_atfgyrg34hws7gidwwxqi2haie",
"reference": "reference123",
"source_account_id": "acc_buqtzoruk7x44iqdn3zmxt26iu"
}
{
"id": "pay_r28xivvv1sb9e1xt1uj0v8aiyc",
"status": "submitted",
"created_at": "2022-10-25T00:00:00.000Z",
"links": [
{
"href": "https://api.payable.co/payment-orders/pay_r28xivvv1sb9e1xt1uj0v8aiyc",
"rel": "self",
"method": "GET"
}
]
}
You can track the lifecycle of a payment by polling for the status or listening to the Payment Order Webhooks.
Updated 3 months ago