What Are Webhooks
Webhooks let NTX Pay send HTTPS notifications to your server whenever a relevant event occurs — cash-in confirmation, cash-out failure, return — without you having to poll.Webhook Types
When registering a webhook viaPOST /api/webhooks-config, you choose which event type that URL receives:
Each webhook subscribes to exactly one type. To receive multiple types on separate URLs, create one webhook per type — or use
all to centralize everything on one URL and route by the payload’s event field.Payload
Every webhook delivers the same payload format:Event type:
transaction.cash_in.settled, transaction.cash_in.rejected, transaction.cash_in.returned, transaction.cash_out.settled, transaction.cash_out.rejected, transaction.cash_out.returned, or the .pending variants. Use this field to route processing.Transaction identifier. Correlate it with the
id returned when the charge/transfer was created.LIQUIDATED (settled), REJECTED (rejected), RETURNED (returned), EXPIRED (expired unpaid), or PENDING (processing).Headers
Always validate the signature before processing — without it, anyone can forge notifications. See Implementation.
Delivery Guarantees
- At-least-once: you may receive the same event more than once. Deduplicate by
x-event-id. - Retries: up to 5 attempts with exponential backoff (starting at ~5s) if you respond with a non-
2xxstatus. - Timeout: 10 seconds. Respond fast — process asynchronously if needed.
- Ordering: events may arrive out of order under error conditions. Check
occurredAtin the payload.
Best Practices
- Respond
200immediately after validating the signature and enqueueing the event. - Deduplicate by
x-event-id. - Route by the
eventfield — do not assume a URL receives a single type (especially withall). - Handle
statusexplicitly — implement all four states (LIQUIDATED,REJECTED,RETURNED,PENDING). - HTTPS required — webhooks are only sent to URLs with the HTTPS protocol.
Next Steps
Setup
Register the URL on your account and trigger a test webhook
Implementation
HMAC validation examples in Node.js, Python, Java, and Go