Charge and Transfer Connected Accounts

Overview

Move money between your main account balance and a connected account balance with the Charge and Transfer endpoints.

  • Charge takes money from the connected account and adds it to the main account.
  • Transfer takes money from the main account and adds it to the connected account.

Both sides use the same currency. The API completes the money movement before returning a successful HTTP response. Send the connected account ID in the request body. The API ignores X-On-Behalf.

Charge

POST /api/v1/ConnectedAccounts/Charge

Removes money from the connected account balance (debit) and adds it to the main account balance (credit).

Transfer

POST /api/v1/ConnectedAccounts/Transfer

Removes money from the main account balance and adds it to the connected account balance.

Request

{
  "connectedAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "currency": "USD",
  "amount": 100.00
}
FieldRequiredRule
connectedAccountIdYesConnected account that belongs to the caller.
currencyYes3-letter ISO currency code.
amountYesGreater than zero. At most two decimal places.

There is no conversion. The debit and the credit are both in currency.

Response

200 OK

{
  "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  "connectedAccountId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "direction": "Charge",
  "currency": "USD",
  "amount": 100.00,
  "debitedBalanceId": "11111111-1111-1111-1111-111111111111",
  "debitedBalanceAmount": 400.00,
  "creditedBalanceId": "22222222-2222-2222-2222-222222222222",
  "creditedBalanceAmount": 250.00
}
FieldMeaning
idId of this move. Use it to match the webhooks.
directionCharge or Transfer.
debitedBalanceIdID of the balance the money left.
debitedBalanceAmountAmount remaining in that balance after removing the money.
creditedBalanceIdID of the balance that received the money.
creditedBalanceAmountAmount in that balance after adding the money.

Available money is the balance amount minus any locked amount. The debit uses available money. Locked funds stay locked.

Balances

If the balance that receives the money does not exist, the API creates it in currency and adds the money.

If the balance that pays the money does not exist, the API rejects the request with Balance.NotEnoughMoney. The API does not save a balance.

Who can call

The access token must belong to a main account.

The connected account must:

  • belong to that main account
  • be approved

Did this page help you?