Each time SwapWallet sends an invoice-paid webhook, it records the request and your server's answer. Read an invoice's record to debug your endpoint, and resend the webhook once it's fixed.
SwapWallet retries failed deliveries on its own for about three days (see Webhook events), so you don't need to retry after a short outage.
An invoice's webhook status and every attempt to deliver it, with what was sent and what your server answered.
statusenumOverall state of the webhook.
Possible values
DISABLEDNeither the invoice nor your business has a webhook URL.PENDINGNothing has been sent yet.SUCCEEDAt least one attempt was delivered.FAILEDEvery attempt so far has failed. SwapWallet may still be retrying.callsarray of objectsEvery delivery attempt, oldest first.
requestIdUUIDThe requestId in this attempt's body. Each attempt has its own.
urlstringURL the request was sent to.
requestBodystringThe exact JSON body that was sent, as a string.
responseBodystringnullableYour server's response body. Empty when there was no response.
statusintegerHTTP status your server returned, or -1 if it couldn't be reached or didn't answer within 10 seconds.
succeedbooleanWhether this attempt counts as delivered: any response except a 4xx or 5xx status.
createdAtISO 8601 timestampWhen the attempt finished.
{
"status": "SUCCEED",
"calls": [
{
"requestId": "560fc0fe-773f-46e4-8446-259ed7a9f6d0",
"url": "https://pixelshop.example/webhooks/swapwallet",
"requestBody": "{\"requestId\":\"560fc0fe-773f-46e4-8446-259ed7a9f6d0\",\"hmac\":\"f68377fb0576dbd1a37670acddf2ee1ce964ff312db26567af514f0a828708f9\",\"event\":{\"time\":\"2026-11-23T09:19:42.612394118Z\",\"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\"}}}",
"responseBody": "Service Unavailable",
"status": 503,
"succeed": false,
"createdAt": "2026-11-23T09:19:42.731205Z"
},
{
"requestId": "a7d0cb53-b035-44b4-b48e-4b04a59d5f97",
"url": "https://pixelshop.example/webhooks/swapwallet",
"requestBody": "{\"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\"}}}",
"responseBody": "{\"received\":true}",
"status": 200,
"succeed": true,
"createdAt": "2026-11-23T09:20:43.118940Z"
}
]
}/v1/merchants/invoices/{invoiceId}/webhookRetrieves an invoice's webhook status and every delivery attempt, oldest first, with the body sent and your server's response.
invoiceIdUUIDRequiredID of the invoice.
Returns a Webhook delivery log object.
INVOICE_NOT_FOUNDYour business has no invoice with this ID.
curl https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.get(
"https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"status": "OK",
"result": {
"status": "SUCCEED",
"calls": [
{
"requestId": "560fc0fe-773f-46e4-8446-259ed7a9f6d0",
"url": "https://pixelshop.example/webhooks/swapwallet",
"requestBody": "{\"requestId\":\"560fc0fe-773f-46e4-8446-259ed7a9f6d0\",\"hmac\":\"f68377fb0576dbd1a37670acddf2ee1ce964ff312db26567af514f0a828708f9\",\"event\":{\"time\":\"2026-11-23T09:19:42.612394118Z\",\"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\"}}}",
"responseBody": "Service Unavailable",
"status": 503,
"succeed": false,
"createdAt": "2026-11-23T09:19:42.731205Z"
},
{
"requestId": "a7d0cb53-b035-44b4-b48e-4b04a59d5f97",
"url": "https://pixelshop.example/webhooks/swapwallet",
"requestBody": "{\"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\"}}}",
"responseBody": "{\"received\":true}",
"status": 200,
"succeed": true,
"createdAt": "2026-11-23T09:20:43.118940Z"
}
]
}
}/v1/merchants/invoices/{invoiceId}/webhook/retryQueues a new delivery of the invoice's invoice-paid webhook, carrying the invoice as it is now. It works for any paid invoice, settled ones included, whether or not an earlier delivery succeeded.
If the new delivery fails, it's retried on the usual schedule. Check the outcome with Retrieve webhook deliveries.
invoiceIdUUIDRequiredID of the invoice.
Returns {"status": "OK"} once the delivery is queued.
APPLICATION_INVOICE_WEBHOOK_RETRY_NOT_ALLOWEDThe invoice isn't paid.
INVOICE_NOT_FOUNDYour business has no invoice with this ID.
curl -X POST https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook/retry \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook/retry', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.post(
"https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook/retry",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook/retry');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("POST", "https://swapwallet.app/api/v1/merchants/invoices/bcbb332e-0bf8-4da2-a42f-a75a0be6c36f/webhook/retry", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"status": "OK"
}