Invoice

📡Invoice Callbacks (Webhooks)

These are server-side callbacks sent to the merchant's server whenever the status of invoice changes.

Invoice Callback

  • Triggered when:

    • The invoice is successfully paid

    • The invoice expires

    • The invoice is canceled

    • The invoice is rejected

    • The invoice is underpaid

    • The invoice is paid twice

    • The invoice is paid in another currency

  • The callback sends the updated invoice data (e.g., status, amount, currency) to the configured callbackUrl.

Callback body example

Invoice callback structure notes

  • The set and number of fields may vary depending on the invoice type (Full invoice or Quick invoice).

  • Not all fields are guaranteed to be present for every invoice type.

  • Transitions to Rejected and Cancelled statuses can be performed by the support team.

{
  "invoiceId": "e70f075f-e858-4cb2-9062-a20ca1fa4c92",
  "merchantId": "ABCDEFGH",
  "status": 3,
  "statusName": "Successful",
  "createDate": "2025-11-27 17:11:30.19",
  "modifiedDate": "2025-11-27 20:47:03.252",
  "expirationDate": "2025-11-27 19:11:30.014",
  "createTimestamp": 1764256290190,
  "modifiedTimestamp": 1764269223252,
  "expirationTimestamp": 1764263490014,
  "expirationDateInMilliseconds": 0,
  "purse": "0x0000000000000000000000000000000000000000",
  "currency": "USD",
  "payCurrency": "ETH_ETHEREUM",
  "amount": "0.00",
  "amountInPayCurrency": "1",
  "paidAmount": "1",
  "paidAmountFiat": "2500",
  "payUrl": "https://app.thedex.cloud/pay-invoice/e70f075f-e858-4cb2-9062-a20ca1fa4c92",
  "creationWay": "API",
  "merchantCommission": "0",
  "merchantBalance": "0.9995",
  "uniqueUserId": "SQCGMWJZ",
  "depositBlockchainFee": "0.0005",
  "rate": "2500.00",
  "rateWithCommission": "2500.00",
  "txId": [
    "0x00000000000000000000000000000000000000000000"
  ],
  "fromAddress": [
    "0x10000000000000000000000000000000000000000000"
  ],

Notes:

  • These callbacks enable your server to automatically update the order/payment status based on real-time data from TheDex.

  • Callbacks can be manually re-sent from the admin panel in case of delivery failure or testing purposes.

  • For testing callback URLs, services like https://webhook.site/arrow-up-right can be used.

Last updated