Making a Transfer between Accounts
3 minute read
An important feature of Liquidity Accounts is the ability to transfer funds between different accounts, enabling a bank-like experience. Transfers are implemented using the Ping Credit payment provider method and reuse the same Payments API.
How Account Transfers Work
To transfer funds between two Liquidity Accounts, create a Payment with:
provider: "ping"method: "credit"
Each transfer involves at least two accounts:
- Destination account: Specified in
order_items[].liquidity_account_id - Source account: Specified in
provider_method_parameters.liquidity_account_id
Example
Let's assume we have two Liquidity Accounts
- Account A -
aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa" - Account B -
bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb"
We want to transfer 299 SEK from Account A to Account B. We do this by creating a Payment with the provider ping and method credit.
Request
curl --location 'https://sandbox.pingpayments.com/payments/api/v1/payment_orders/<YOUR-PAYMENT-ORDER-ID>/payments' \
--header 'x-api-secret: <YOUR-API-SECRET>' \
--header 'tenant_id: <YOUR-TENANT-ID>' \
--header 'Content-Type: application/json' \
--data-raw '{
"order_items": [
{
"amount": 29900,
"metadata": {},
"name": "Transfer",
"liquidity_account_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbb",
"vat_rate": "0",
"tags": []
}
],
"provider_method_parameters": {
"liquidity_account_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa"
},
"metadata": {},
"currency": "SEK",
"method": "credit",
"provider": "ping",
"status_callback_url": "https://<YOUR-DOMAIN>/ping-callback/payment_status",
"total_amount": 29900
}'After this, the Payment Order must be settled like any other Payment. Once that is done:
- Account A is debited 299 SEK.
- Account B is credited 299 SEK.
NOTE: In most cases Ping will provide a special split tree for this specific use case
Updated 2 days ago