XPayLabs sends webhook notifications based on the NotifyType enum. Each notification corresponds to a change in state of an order or a collection sweep.
Event Types
| Event Type | Triggered When | Payload |
|---|
ORDER_PENDING | A new order is created and is awaiting customer payment | NotifyOrder |
ORDER_PENDING_CONFIRMATION | A blockchain transaction is detected but awaiting confirmations | NotifyOrder |
ORDER_SUCCESS | Payment confirmed and order completed successfully | NotifyOrder |
ORDER_EXPIRED | Order expired before payment was received | NotifyOrder |
ORDER_FAILED | Payment transaction failed | NotifyOrder |
COLLECT_PENDING | Collection sweep (hot-to-cold transfer) is initiated | NotifyCollect |
COLLECT_SUCCESS | Collection sweep completed successfully | NotifyCollect |
COLLECT_FAILED | Collection sweep failed | NotifyCollect |
Order Events (ORDER_*)
ORDER_PENDING
Sent when a collection or payout order is created and is awaiting the next action (customer payment for collections, processing for payouts).
ORDER_PENDING_CONFIRMATION
Sent when a blockchain transaction is detected but has not yet reached the required number of block confirmations. The transaction field is populated with the detected transaction details.
ORDER_SUCCESS
Sent when the payment is fully confirmed (required block confirmations reached) or a payout completes successfully.
ORDER_EXPIRED
Sent when an order reaches its expiry time without receiving the required payment.
ORDER_FAILED
Sent when a payout transaction fails or a collection transaction is rejected by the blockchain.
Collection Events (COLLECT_*)
Collection events are sent when the gateway performs automatic hot-to-cold wallet sweeps (settlement). These are distinct from order events — they relate to the internal movement of funds between the gateway’s wallets.
| Event Type | Triggered When |
|---|
COLLECT_PENDING | A sweep from the hot wallet to the cold wallet is initiated |
COLLECT_SUCCESS | The sweep transaction confirmed on-chain |
COLLECT_FAILED | The sweep transaction failed |
Best Practices
-
Respond with
200 quickly. Return 200 OK immediately and process the event asynchronously in a background worker.
-
Verify the signature. Always validate the
sign field using your webhook-secret before acting on any event.
-
Deduplicate with
nonce. The same event may be delivered more than once. Store processed nonces in your database and skip duplicates.
-
Check
notifyType first. Route to different handlers based on the event type.
-
Handle
ORDER_PENDING_CONFIRMATION. Use this event to show “payment detected” in your UI before the transaction is fully confirmed.
Last modified on June 26, 2026