Convert funds atomically between two HoneyCoin merchant balance ledgers using a locked quoteId or a live FX rate.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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
| Mode | Send in the body |
|---|---|
| Quoted | quoteId and externalReference. The quote fixes both amounts, currencies, and countries. |
| Direct | senderAmount, 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 data | Meaning |
|---|---|
id | Transaction ID for GET /api/b2b/transactions/{id}. |
quoteId | Quote used for settlement. Direct swaps return null. |
senderBalanceBefore, senderBalanceAfter | Source ledger balance on either side of the debit. |
receiverBalanceBefore, receiverBalanceAfter | Destination 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
