For the complete documentation index, see llms.txt. This page is also available as Markdown.

Invoice webhooks

Txn sends an invoice webhook each time an invoice's status changes. The payload is the same shape returned by the Read invoice endpoint — the same data object, with a JSON:API included array carrying the related addresses, binanceOrders, coinTransactions, invoiceTransactions, transactions, exchangeQuotes, and accounts resources where applicable.

The tabs below show example payloads for each terminal and intermediate status. For the rules that govern transitions and the meaning of status, statusContext, and paymentStatus, see Invoice status flow.

For configuring webhook URLs, retry behaviour, source IPs, and signature verification, see the general Webhooks section.

{
  "data": {
    "attributes": {
      "amountBilled": "10000.00",
      "amountCharged": "283.417792",
      "billedCurrency": "TRY",
      "chargedCurrency": "USDT",
      "chargedTargetRate": "0.948618",
      "chargedTargetRateCurrency": "EUR",
      "createdAt": "2025-01-28T16:26:56.275Z",
      "exchangeRate": "35.2836",
      "expiresAt": "2025-01-28T16:46:56.063Z",
      "hostedPageUrl": "https://sandbox.txn.io/redirect?invoice_id=fe8ea84a-8490-4133-87e9-3209e6d1f7db&request_type=invoice_hosted_page&zone=eu",
      "network": "ttrx:usdt",
      "networkName": "Tron (TRC20)",
      "paymentMethods": [
        "on_chain",
        "binance_pay"
      ],
      "paymentStatus": "expecting",
      "reference": "bc32c092-8979-4435-b176-ae1b790b1ca6",
      "status": "pending",
      "statusContext": "unpaid",
      "successRedirectUrl": "https://yahoo.com",
      "targetAmount": "266.17",
      "targetCurrency": "EUR",
      "unsuccessRedirectUrl": "https://myspace.com",
      "scAddress": null
    },
    "id": "fe8ea84a-8490-4133-87e9-3209e6d1f7db",
    "relationships": {
      "targetAccount": {
        "data": {
          "type": "accounts",
          "id": "13a85b45-8543-41c7-b963-394d4ea128ae"
        }
      },
      "binanceOrder": {
        "data": {
          "type": "binanceOrders",
          "id": "5e623ab4-f0fc-43df-af01-b3208aa6af0b"
        }
      },
      "address": {
        "data": {
          "id": "e4c1c999-52a5-470b-a8c4-e88d875eb3cf",
          "type": "addresses"
        }
      },
      "coinDeposits": {
        "data": []
      },
      "invoiceTransactions": {
        "data": [
          {
            "id": "89d6e25d-70ff-4d89-b784-0aac1df896a0",
            "type": "invoiceTransactions"
          }
        ]
      },
      "refundLinks": {
        "data": []
      }
    },
    "type": "invoices"
  },
  "included": [
    {
      "id": "13a85b45-8543-41c7-b963-394d4ea128ae",
      "type": "accounts",
      "attributes": {
        "master": false,
        "currencyCode": "EUR",
        "label": "EUR account",
        "bankReference": "BDR2891634526738095",
        "balance": "1500.00",
        "totalBalance": "1500.00",
        "bankWithdrawalAvailable": true,
        "bankDepositAvailable": true,
        "transferAvailable": true,
        "currencyType": "fiat"
      },
      "relationships": {
        "company": {
          "meta": {
            "included": false
          }
        },
        "networks": {
          "meta": {
            "included": false
          }
        }
      }
    },
    {
      "id": "5e623ab4-f0fc-43df-af01-b3208aa6af0b",
      "type": "binanceOrders",
      "attributes": {
        "deeplink": "bnc://app.binance.com/payment/secpay?tempToken=41wu19i6qX348MzHSdhyjNcbXC0xe8jA",
        "qrContent": "https://app.binance.com/qr/dplk1d9affed91d34e019653a3d627672478",
        "qrcodeLink": "https://public.bnbstatic.com/static/payment/20250606/18e063aa-9e98-4805-a861-68119e031ea7.jpg",
        "universalUrl": "https://app.binance.com/payment/secpay?linkToken=3104f0eab7ae49a998b10752421b2d99&_dp=Ym5jOi8vYXBwLmJpbmFuY2UuY29tL3BheW1lbnQvc2VjcGF5P3RlbXBUb2tlbj00MXd1MTlpNnFYMzQ4TXpIU2RoeWpOY2JYQzB4ZThqQQ"
      }
    },
    {
      "attributes": {
        "createdAt": "2025-01-28T15:19:00.020Z",
        "label": "Tron (TRC20)",
        "value": "TSEC2CvHZ1MgiA8VhgWoRHpXSxPY6wndyW"
      },
      "id": "e4c1c999-52a5-470b-a8c4-e88d875eb3cf",
      "relationships": {
        "account": {
          "meta": {
            "included": false
          }
        },
        "network": {
          "meta": {
            "included": false
          }
        }
      },
      "type": "addresses"
    },
    {
      "attributes": {
        "amountBilled": "10000.00",
        "billedChargedRate": "35.2836",
        "billedChargedRateCurrency": "TRY",
        "consolidationFee": "0.00",
        "targetTransactionFee": "2.69",
        "targetTransactionFeeCurrency": "EUR",
        "transactionFee": "100.00",
        "transactionFeeCurrency": "TRY",
        "simplifiedState": "pending"
      },
      "id": "89d6e25d-70ff-4d89-b784-0aac1df896a0",
      "relationships": {
        "exchangeQuote": {
          "data": null
        },
        "invoice": {
          "meta": {
            "included": false
          }
        },
        "txn": {
          "data": {
            "id": "89d6e25d-70ff-4d89-b784-0aac1df896a0",
            "type": "transactions"
          }
        }
      },
      "type": "invoiceTransactions"
    },
    {
      "attributes": {
        "amount": "266.17",
        "createdAt": "2025-01-28T16:26:56.299Z",
        "reference": "bc32c092-8979-4435-b176-ae1b790b1ca6",
        "simplifiedState": "pending",
        "transactionType": "InvoiceTransaction"
      },
      "id": "89d6e25d-70ff-4d89-b784-0aac1df896a0",
      "relationships": {
        "account": {
          "meta": {
            "included": false
          }
        },
        "transactionDetails": {
          "meta": {
            "included": false
          }
        }
      },
      "type": "transactions"
    }
  ],
  "meta": {}
}

Last updated