Get a swap
Return the current state of a swap by its ID. Poll this endpoint to track progress, or rely on Callbacks to be notified of status changes.
Endpoint
GET /2.0/swap/get
Query parameters
Parameter
Type
Required
Description
id
string
yes
UUID of the swap to retrieve.
cURL
curl "/2.0/swap/get?id={swap-uuid}" \
-H "apiKey: <yourApiKey>"Response (200 OK)
{
"id": "{swap-uuid}", // Swap ID
"amountFrom": "100000000", // Source amount in base units
"amountFromInUsd": "100.00", // Source amount in USD (or null)
"amountTo": "99500000", // Received amount in base units (null until finished)
"amountToInUsd": "99.50", // Received amount in USD (or null)
"assetIdFrom": "{assetIdFrom}", // Source merchant asset ID
"assetIdTo": "{assetIdTo}", // Target merchant asset ID
"cryptoIdFrom": "{cryptoIdFrom}", // Source cryptocurrency ID
"cryptoIdTo": "{cryptoIdTo}", // Target cryptocurrency ID
"hashFrom": "0x6d2f...e91a", // Source transaction hash (or null)
"hashTo": "0x9a1c...7b30", // Target transaction hash (or null)
"status": "finished", // new | in_progress | finished | rejected
"fee": { // See API Reference Docs
"network": [
{
"amount": "2650000000000000",
"amountFormatted": "0.00265",
"currency": "BNB",
"cryptoId": "{cryptoId}",
"networkId": "{networkId}",
"amountInUsd": null,
"isChargedToMerchant": false
}
],
"service": {
"amount": "1000000000000000000",
"amountFormatted": "1",
"currency": "USDT",
"cryptoId": "{cryptoId}",
"networkId": "{networkId}",
"amountInUsd": "1.00",
"isChargedToMerchant": true
},
"exchange": null,
"totalInUsd": "1.00"
}
"createdAt": "2025-03-11T14:30:16+00:00" // RFC3339, UTC+0
}See Swaps → Swap statuses for the full status lifecycle.
Errors
404 Not Found— no swap with this ID belongs to your merchant (the response body is empty).403 Forbidden/400 Bad Request/500 Internal Server Error— see Error format.
Last updated