Swaps
Swap webhook events and example payloads.
Swap webhooks tell you when a swap between two of your balances completes or fails.
Field descriptions
Swap webhook events use data.swap. It has the same shape as the swap returned by the API.
data.swap.id
string
Unique swap identifier.
data.swap.fromCurrency
string
Currency taken from your balance, such as USDT.
data.swap.toCurrency
string
Currency added to your balance, such as NGN.
data.swap.sourceAmount
string
Amount taken, as a decimal string.
data.swap.targetAmount
string
Amount added, as a decimal string.
data.swap.rate
string
Exchange rate used, as a decimal string.
data.swap.status
string
Swap status. See each event below.
data.swap.completedAt
string | null
When the swap completed. Null for failed swaps.
data.swap.createdAt
string
When the swap was created (ISO 8601).
data.swap.quotation
object
The quote the swap was made from.
data.swap.quotation.id
string
Unique quotation identifier.
data.swap.quotation.fromCurrency
string
Quoted source currency.
data.swap.quotation.toCurrency
string
Quoted target currency.
data.swap.quotation.sourceAmount
string
Quoted source amount.
data.swap.quotation.targetAmount
string
Quoted target amount.
data.swap.quotation.rate
string
Quoted rate.
data.swap.quotation.executed
boolean
Whether the quote was used for a swap.
data.swap.quotation.expiresAt
string
When the quote expires (ISO 8601).
data.swap.quotation.createdAt
string
When the quote was created (ISO 8601).
data.failureReason
string
Why the swap failed. Sent only with swap.failed.
Events
swap.completedswap.failed
swap.completed
Sent when a swap completes and both balances are updated. data.swap.status is completed.
swap.failed
Sent when a swap fails after it has started. data.swap.status is failed.
Requests that are rejected before the swap starts, such as invalid input, do not send this event.