Payment liquidity
Payment liquidity represents:
- The value received from a completed incoming payment
- The value available to send in an outgoing payment
Because Rafiki doesn’t hold funds, anything you receive in an incoming payment must be withdrawn and then credited to the recipient’s account on your ledger. Listen for the incoming payments webhook events to know when you need to interact with Rafiki.
Any excess liquidity that remains after an outgoing payment completes must be withdrawn. You may also find that you must deposit liquidity into Rafiki to fund an outgoing payment. Listen for Rafiki’s outgoing payments webhook events to know when action is required on your part.
For more information about how Rafiki handles liquidity, see the Accounting concepts page.
Manage payment liquidity using the Backend Admin API
Withdraw incoming payment liquidity
mutation CreateIncomingPaymentWithdrawal($input: CreateIncomingPaymentWithdrawalInput!) {createIncomingPaymentWithdrawal(input: $input) { success }}
{"input": { "incomingPaymentId": "b4f85d5c-652d-472d-873c-4ba2a5e39052", "idempotencyKey": "a09b730d-8610-4fda-98fa-ec7acb19c775", "timeoutSeconds": 0 }}
For more information about this mutation’s input object, see CreateIncomingPaymentWithdrawalInput
.
When an incoming payment liquidity withdrawal is successful, CreateIncomingPaymentWithdrawal
returns true
.
{ data: { success: true }}
Deposit outgoing payment liquidity
mutation DepositOutgoingPaymentLiquidity($input: DepositOutgoingPaymentLiquidityInput!) {depositOutgoingPaymentLiquidity(input: $input) { success }}
{"input": { "outgoingPaymentId": "b4f85d5c-652d-472d-873c-4ba2a5e39052", "idempotencyKey": "a09b730d-8610-4fda-98fa-ec7acb19c775" }}
For more information about this mutation’s input object, see DepositOutgoingPaymentLiquidityInput
.
When an outgoing payment liquidity deposit is successful, DepositOutgoingPaymentLiquidity
returns true
.
{ data: { success: true }}
Withdraw outgoing payment liquidity
mutation CreateOutgoingPaymentWithdrawal($input: CreateOutgoingPaymentWithdrawalInput!) {createOutgoingPaymentWithdrawal(input: $input) { success }}
{"input": { "outgoingPaymentId": "b4f85d5c-652d-472d-873c-4ba2a5e39052", "idempotencyKey": "a09b730d-8610-4fda-98fa-ec7acb19c775", "timeoutSeconds": 0 }}
For more information about this mutation’s input object, see CreateOutgoingPaymentWithdrawalInput
.
When an outgoing payment liquidity withdrawal is successful, CreateOutgoingPaymentWithdrawal
returns true
.
{ data: { success: true }}