What SwapWallet sends to your webhook URL, field by field.
INVOICESwapWallet sends a POST request to the invoice's webhookUrl, or to your business webhook URL if the invoice has none, whenever a payment for the invoice is processed:
status is still ACTIVE) and one that arrives after it's paid;event.invoice is the invoice as it was when the payment was processed. Its status is PAID once the invoice is paid, or SETTLED if the funds had already moved to your SwapWallet account.
Responding. Answer with a 2xx status within 10 seconds. A 4xx or 5xx status, a timeout or a connection error is a failure; when SwapWallet can't connect at all, it tries once more right away through its server in Iran. Failed deliveries are retried after 1, 2, 4, 8, 16 and 32 minutes, then every hour, up to 72 attempts over about three days. Each attempt has a new requestId, event.time and hmac; the invoice in it stays the same.
Verifying. There's no signature header. hmac is HMAC-SHA256 of the event object, keyed with your business API key (the whole key, business- included), in lowercase hex. It's computed over event exactly as it appears in the body, so take that part of the raw body rather than re-encoding parsed JSON. The webhooks guide has code for this. If you'd rather not check the signature, fetch the invoice with Retrieve an invoice and act on that response instead of the body.
Check event.invoice.status before you fulfill: a transfer that doesn't cover the invoice also sends this webhook, with status still ACTIVE.
The same payment can be delivered more than once: after a timeout, a retry or a manual resend. requestId changes on every attempt, so make your handler idempotent on event.invoice.id and event.invoice.paidAmount.
The hmac in the example is real: it was computed with the example key business-vBExgheIWAcggPDCdyLYFqOuAX3pkP7X2V71X5F04zWAiMUyCzRPoxbFibTtAjV6, so you can test your verification code against it. Each attempt is signed with the key your business has at that moment: after you regenerate the key, retries use the new one.
Content-TypestringAlways application/json.
User-AgentstringAlways SwapWallet.
requestIdUUIDUnique ID of this delivery attempt. It changes on every attempt, so don't use it to detect duplicates.
hmacstringSignature of event: HMAC-SHA256 keyed with your business API key, in lowercase hex.
eventobjectThe event. hmac is computed over this object as sent.
timeISO 8601 timestampWhen this attempt was sent.
typeenumKind of event.
Possible values
INVOICEA payment for an invoice. The only type.invoiceobjectThe Invoice object as it was when the payment was processed. wallet is always null and paymentLinks always empty.
idUUIDUnique identifier of the invoice.
supportCodestringShort code to quote to SwapWallet support, such as AI-8LEYRQH-G8HM.
statusenumWhere the invoice is in its lifecycle.
Possible values
ACTIVEWaiting for payment. Transfers so far, if any, don't cover it yet.PAIDPaid. The funds are in your business balance.SETTLEDPaid, and the funds have moved to the owner's SwapWallet account.EXPIREDexpiredAt passed before the invoice was paid.CANCELEDCanceled. Not used for invoices created through this API.descriptionstringnullableThe description you sent.
customDatastringnullableThe customData you sent, unchanged.
walletobjectnullableThe temporary wallet the customer pays into; for a Toman receipt, deepLinks holds the SwapWallet payment link. Returned only by Retrieve an invoice; null in lists, by order ID and in webhooks.
networkstringNetwork of the address, such as BSC.
tokenstringToken to send, such as USDT.
addressstringAddress to send to.
validUntilISO 8601 timestampSame as the invoice's expiredAt.
deepLinksarray of objectsLinks that open a wallet app with the transfer filled in. Empty once the invoice is no longer ACTIVE.
nameenumThe wallet app.
Possible values
SWAP_WALLETSwapWallet, in Telegram.SWAP_WALLET_WEBSITESwapWallet, on the web.TRUST_WALLETTrust Wallet.METAMASKMetaMask.TON_KEEPERTonkeeper. TON only.TONHUBTonhub. TON only.MYTONWALLETMyTonWallet. TON only.BITYCLEBitycle.logostringURL of the app's logo.
urlstringnullableLink that opens the app with the address and amount filled in.
urlTypeenumHow the link opens.
Possible values
WEB_APPAs a Telegram mini app.URLAs a regular web or app link.textFastringPersian label for the button, such as «واریز از سواپولت».
ownerIdintegerSwapWallet user ID of the business owner.
telegramInlineMessageIdstringnullableUsed by SwapWallet's Telegram bot. Always null for invoices created through this API.
userLanguageenumnullableThe language you sent.
Possible values
FAPersianENEnglishRURussianZHChineseFRFrenchITItalianDEGermanESSpanishKOKoreanreturnUrlstringnullableThe return URL you sent.
webhookUrlstringnullableThis invoice's webhook URL. When null, webhooks go to your business webhook URL, if it's set.
orderIdstringnullableYour order ID.
amountMoneynullableWhat the customer pays: for a temporary-wallet invoice, the token amount to send; for a Toman receipt, the Toman amount (IRT). null only while a customer still has to choose the token.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
valueMoneynullableamount valued in US dollars (USD).
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
feePayerenumWho pays SwapWallet's fee. Temporary-wallet invoices always use APPLICATION.
Possible values
APPLICATIONYour business: deducted from what you receive.USERThe customer: added to what they pay.feeAmountMoneynullableSwapWallet's fee on this invoice, in the unit of paidAmount. Final once the invoice is paid; null or an estimate before that.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paymentLinksarray of objectsAlways empty here and in webhooks. Toman receipts return their links when you create them; temporary-wallet invoices use wallet.deepLinks.
paidAmountMoneynullableTotal received so far, before SwapWallet's fee. For blockchain payments it adds up every confirmed transfer, so it can be below amount (a partial payment) or above it. For a Toman receipt it's in the token the payment was converted to. null until the first payment.
numberdecimal stringThe amount as a decimal string, without trailing zeros.
unitstringCurrency or token code, such as USDT, IRT (Toman) or USD.
paidAtISO 8601 timestampnullableWhen the first payment arrived. It's set by a transfer that doesn't cover the invoice too, so decide on status, not on paidAt.
blockchainStatusenumnullableWhat SwapWallet sees on the network for this invoice. null when it was paid from a SwapWallet account.
Possible values
NOT_SEENNo transfer to the address yet.NOT_CONFIRMA transfer is on the network but isn't confirmed yet.CONFIRMEDA transfer is confirmed.userIdstringnullableThe userId you sent.
userEmailstringnullableThe userEmail you sent.
userPhoneNumberstringnullableThe userPhoneNumber you sent.
userTelegramIdintegernullableThe userTelegramId you sent.
userDisplayNamestringnullableThe userDisplayName you sent.
lockHoursintegerHours the payment stays in your business balance before it's settled to the owner's account. Set when the invoice is paid; 0 before that.
expiredAtISO 8601 timestampWhen the invoice stops accepting payment.
createdAtISO 8601 timestampWhen the invoice was created.
{
"requestId": "a7d0cb53-b035-44b4-b48e-4b04a59d5f97",
"hmac": "e14c8f2ae561e80d64faffc2274c823c2b0aedc4bb9e32918fafe991f6d43bf6",
"event": {
"time": "2026-11-23T09:20:43.004871392Z",
"type": "INVOICE",
"invoice": {
"id": "bcbb332e-0bf8-4da2-a42f-a75a0be6c36f",
"supportCode": "AI-8LEYRQH-G8HM",
"status": "PAID",
"description": "Spotify Premium, 1 month",
"customData": "{\"cartId\":\"c-88412\"}",
"wallet": null,
"ownerId": 905513,
"telegramInlineMessageId": null,
"userLanguage": "FA",
"returnUrl": "https://pixelshop.example/orders/1042",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"orderId": "ORD-1042",
"amount": {
"number": "9.18",
"unit": "USDT"
},
"value": {
"number": "9.18",
"unit": "USD"
},
"feePayer": "APPLICATION",
"feeAmount": {
"number": "0.0918",
"unit": "USDT"
},
"paymentLinks": [],
"paidAmount": {
"number": "9.18",
"unit": "USDT"
},
"paidAt": "2026-11-23T09:19:41.552904Z",
"blockchainStatus": "CONFIRMED",
"userId": "u-58213",
"userEmail": "parsa@example.com",
"userPhoneNumber": "+989123334455",
"userTelegramId": 974181500,
"userDisplayName": "Parsa",
"lockHours": 0,
"expiredAt": "2026-11-23T10:12:04.318227Z",
"createdAt": "2026-11-23T09:12:04.318512Z"
}
}
}