Skip to content

orderId is the idempotency key when you create invoices, standalone deposits, and withdrawal quotes. Generate it in your system so it identifies your own object, such as an order number, payment attempt, or withdrawal request. A request with an orderId that was already used never creates a second object.

OperationRepeat with the same orderId
POST /invoiceReturns 409 Conflict
POST /depositReturns 409 Conflict
POST /withdrawal/quoteReturns the same quote. After that quote is committed, returns 409 Conflict

Invoice orderId values must be unique across your organization; deposit and withdrawal values must be unique per account. orderId is not an idempotency key for other endpoints.

Use a new orderId for each new invoice, deposit, or withdrawal. Reuse it only when retrying after a timeout or an uncertain response:

  • Invoices and deposits. If the retry returns 409, the first request succeeded. Fetch the object by orderId, for example GET /invoice?orderId=…, instead of creating a new one.
  • Withdrawals. Repeat the quote with the same orderId until you get a quoteId, then commit it once. A single orderId can back at most one committed withdrawal.

The webhook signature proves the body was signed with your signing key, but it doesn’t stop replays: someone who captures a valid request could send it again. Make your handler idempotent and do at least one of the following:

  • Reject old events. Compare the signed timestamp field in the body with your clock, for example rejecting events older than 5 minutes. Don’t use the x-webhook-timestamp header for this, because it isn’t signed.
  • Deduplicate deliveries by the x-webhook-id header. Retries and manual resends of one delivery always carry the same id, so store the ids you have processed and skip repeats.
  • Deduplicate status transitions. Two different deliveries can still describe the same transition, for example if a status event is emitted twice. Use the event name, the resource id, and the status as a key, such as invoice.statusChanged + data.id + data.status.

If you have already processed the transition, return 200 OK and don’t repeat the action.