Create a Swap

Convert funds atomically between two HoneyCoin merchant balance ledgers using a locked quoteId or a live FX rate.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Convert funds between two account balances. A 201 Created response with data.status: "successful" confirms that both the debit and credit have settled.

Choose the request body

ModeSend in the body
QuotedquoteId and externalReference. The quote fixes both amounts, currencies, and countries.
DirectsenderAmount, senderCurrency, receiverCurrency, and externalReference. Supply a country for each XOF leg.

Both modes accept a note of 1–500 characters and a metadata object. Use a unique external reference per swap. Send X-Idempotency-Key as a header with 16–255 letters, digits, hyphens, or underscores. Keep that key and the exact body for retries.

Read the receipt

Field in dataMeaning
idTransaction ID for GET /api/b2b/transactions/{id}.
quoteIdQuote used for settlement. Direct swaps return null.
senderBalanceBefore, senderBalanceAfterSource ledger balance on either side of the debit.
receiverBalanceBefore, receiverBalanceAfterDestination ledger balance on either side of the credit.

Access and recovery

Production requires Swaps to be enabled on an onboarded, approved account, an allowed source IP, and sufficient available funds. Both ledgers must be active. Sandbox accepts unfunded balances at POST /api/sandbox/b2b/swaps.

If the response is lost, retry with the same body and key. For a consumed quote, follow consumedById to the settled transaction. For a duplicate external reference, look up the original transaction by that reference. Recovery guide · Testing Swaps

Body Params
string
required
^[A-Za-z0-9_-]{1,128}$

Active, unexpired single-use swap quote ID from POST /api/b2b/quotes. Do not send senderAmount, currencies, or countries when quoteId is supplied.

string
required
length between 1 and 128

Merchant-supplied unique reference per account.

string
length between 1 and 500

Optional human-readable note stored on the swap transaction.

metadata
object

Optional custom key-value metadata object.

Headers
string
required
length between 16 and 255
^[A-Za-z0-9_-]{16,255}$

Idempotency key (16-255 characters: letters, digits, "-" or "_"). Always send a unique key per logical swap; retries with the same key and payload replay the original response for 1 hour (409 IDEMPOTENCY_IN_PROGRESS while in flight; 422 IDEMPOTENCY_KEY_REUSED on payload mismatch).

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json