References

Webhooks

Receive real-time notifications about order and payment events.

Webhooks allow your application to receive real-time notifications when events happen in your account, such as a payment being confirmed or an order expiring.

Instead of polling the API, you register an endpoint and we send an HTTP POST request to it whenever an event occurs.

How It Works

Register an endpoint

Provide a publicly accessible HTTPS URL in your dashboard where you want to receive events.

We send an event

When an event occurs, we send a POST request to your endpoint with a JSON payload.

Verify the signature

Validate the request signature to confirm it came from us.

Respond with 2xx

Return a 200 OK response. Any non-2xx response is treated as a failure and retried.

Webhook Payload

Every webhook request has the following structure:

{
  "event": "order.paid",
  "data": {
    "order_id": "NZJPBG2Y",
    "amount": "5.0000",
    "amount_received": "6.0000",
    "status": "paid",
    "currency": "USDT",
    "network": "ETH",
    "created_at": "2026-08-25T11:39:20.000000Z",
    "confirmed_at": "2026-08-25T11:43:04.000000Z",
    "expires_at": "2026-08-25T12:00:47.000000Z",
    "has_multiple_payments": true,
    "payments": [
      {
        "tx_hash": "0xac34fbe86d087805e480d7f2b62fd3fa5d2162cc2c5e29a8334fd9c2b708392c",
        "amount": "2.00",
        "confirmations": 3,
        "required_confirmations": 3,
        "status": "confirmed",
        "paid_at": "2026-08-25T11:42:24.000000Z",
        "confirmed_at": "2026-08-25T11:43:04.000000Z",
        "paid_by": "0x067f24F6CEa5676Ccb378dE12A07Dd155C666440",
        "is_reorg_safe": true
      }
    ],
    "address": "0xAe2604CC444A849902Efc3Bc6B3B239A0884E639"
  }
}

Payload Fields

FieldTypeDescription
eventstringThe event type that triggered the webhook
dataobjectThe order or payment object associated with the event

Event Types

EventDescription
order.pendingOrder was created and is awaiting payment
order.confirmingPayment detected, awaiting blockchain confirmations
order.paidPayment confirmed and the order is complete
order.expiredOrder expired without payment
order.failedPayment failed or was rejected
order.underpaidPayment received but less than the requested amount
order.reviewingOrder is under manual review
order.canceledOrder was manually canceled

Request Headers

Each webhook request includes these headers so you can verify authenticity:

HeaderTypeDescription
Content-TypestringAlways application/json
X-Webhook-SignaturestringHMAC SHA-256 signature of the raw request body
X-Webhook-TimestampstringUnix timestamp when the request was sent
X-Webhook-EventstringThe event type (e.g., order.paid)

Verifying Signatures

Warning

Always verify the signature before trusting a webhook payload. Never process an unverified request.

The X-Webhook-Signature header is an HMAC SHA-256 hash of the raw request body, using your webhook secret as the key.

Node.js Example

import crypto from "crypto";

function verifySignature(rawBody, signature, secret) {
  const expected = crypto
    .createHmac("sha256", secret)
    .update(rawBody)
    .digest("hex");

  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

Responding to Webhooks

Your endpoint must respond with a 2xx status code within 10 seconds.

  • Return 200 OK as soon as you've received the event.
  • Process the event asynchronously if it requires heavy work.
  • Any non-2xx response, or a timeout, is treated as a failure and retried.

Retries

If your endpoint fails to respond successfully, we retry the webhook with exponential backoff.

AttemptDelay
1Immediate
21 minute
35 minutes
430 minutes
52 hours
624 hours

Info

After all retries are exhausted, the event is marked as failed. You can view and replay failed webhooks from your dashboard.

Idempotency

Tip

Webhooks may be delivered more than once. Always make your handler idempotent.

Use the order_id combined with the event type as a unique key to avoid processing the same event twice.

Best Practices

  • Verify every request using the signature header.
  • Respond quickly — return 2xx before doing heavy processing.
  • Handle duplicates — the same event may arrive multiple times.
  • Use HTTPS — webhook endpoints must be publicly accessible over HTTPS.
  • Log everything — store raw payloads for debugging and replay.
  • Monitor failures — set up alerts for repeated webhook failures.