Skip to main content
POST
Create Peer To Peer Transfer

How it works

  • Both end users must belong to your account, and they must be different end users.
  • Both of them need a balance in currency. The sender needs at least amount available.
  • The transfer is final as soon as the response comes back: the sender’s balance is debited and the receiver’s is credited in the same operation. If any check fails, no balance moves.
  • Only the sender is checked against KYC. A receiver whose KYC is still pending can be paid.
  • A banned end user cannot send or receive.
Each transfer creates two transactions of operation type PEER_TO_PEER, one for each end user: sender_transaction_id and receiver_transaction_id. Both show up in List Transactions and in the daily transactions report.
No webhook (IPN) is sent for peer to peer transfers. The response of this request already carries the final result.

Idempotency

external_ref is your idempotency key and it is required. It is unique within your account. If you send an external_ref that already exists, the response is the original transfer, with status 201, and no balance moves. This makes it safe to retry a request that timed out or whose response you did not get: send it again with the same external_ref.
Only external_ref identifies the transfer. A repeated external_ref returns the original transfer even when sender, receiver, currency or amount are different, and the new values are ignored. Generate a new external_ref for every transfer you want to make.
To check whether a transfer went through, list it by its key: GET /api/v1/peer-to-peer/?external_ref=<your external_ref>.

Authorizations

Authorization
string
header
required

B2B’s White Label API uses OAuth2. Currently there is only one supported authentication flow:

  • clientCredentials allows you to access your own B2B account (First-Party Integration) and performs transactions against the public API. This oauth2 flow is well suited for this API, as it allows machine-to-machine communication.

Every call to the API has to be authenticated with an OAuth2 Token. In order to request this token, you will need to have sandbox or production API Keys (client id and client secret) that will be needed to generate a credential in order to negotiate an ephemeral access token.

Every request must be accompianed by an Authorization header with a value that follows the following schema: Bearer ACCESS_TOKEN

Body

application/json
external_ref
string
required

Your idempotency key for the transfer, unique within your account. Sending an external_ref that already exists returns the original transfer and moves no balance, whatever the other fields say: use a new one for every transfer.

Maximum string length: 320
sender
string
required

External ref of the end user that sends the funds.

Maximum string length: 250
receiver
string
required

External ref of the end user that receives the funds. Must be a different end user than sender.

Maximum string length: 250
currency
string
required

Symbol of the currency to transfer. Both end users must have a balance in it.

Maximum string length: 10
amount
string<decimal>
required

Amount to transfer, greater than zero and with up to 8 decimals.

Response

Transfer created, or the original transfer when the external_ref already existed.

id
string<uuid>

UUID that identifies the peer to peer transfer.

external_ref
string | null

Your idempotency key for the transfer, unique within your account. null only on transfers created before it became required.

sender
string

External ref of the end user that sent the funds.

receiver
string

External ref of the end user that received the funds.

sender_transaction_id
string<uuid>

ID of the PEER_TO_PEER transaction that debited the sender.

receiver_transaction_id
string<uuid>

ID of the PEER_TO_PEER transaction that credited the receiver.

currency
string

Symbol of the transferred currency.

amount
string<decimal>

Transferred amount, with up to 8 decimals.

created_at
string<date-time>

ISO format creation datetime.