Overview
Webhook configuration is done via four endpoints:GET /api/webhooks-config— list active webhooksPOST /api/webhooks-config— create/configure a webhookPOST /api/webhooks-config/test— trigger a signed test webhookDELETE /api/webhooks-config/{id}— delete a webhook
Create Webhook
Request
Response (201)
Fields
string
required
HTTPS URL of the endpoint that will receive the webhooks. Plain HTTP is rejected.
array
required
A webhook subscribes to exactly ONE event — the array must contain a single item. Accepted values:
cash_in, cash_out, refund_in, refund_out, all (General — receives all events), and internal_transfer. See the semantics of each type in the Overview.string
HMAC secret for signature validation. Minimum 8 characters, maximum 128. If omitted, NTX Pay generates one.
Test Webhook
After creating the webhook, trigger a test delivery signed with the same secret — no need to move a transaction:string
required
Which webhook receives the test:
cash_in, cash_out, refund_in, refund_out, or internal_transfer.string
Simulated status in the payload:
LIQUIDATED (default), PENDING, REJECTED, or RETURNED.string
Temporary test URL (e.g. webhook.site). If omitted, delivers to the configured URL.
integer
Amount in centavos in the test payload (default
1000 = $10.00 MXN).delivered: true means your endpoint responded 2xx. statusCode: 0 indicates a connection error.
List Webhooks
The list response does not include the
secret — it is only shown at creation time.Delete Webhook
Multiple Webhooks
Each webhook subscribes to exactly one event, so you have two strategies:- One webhook per type (e.g. one for
cash_in, another forcash_out) — routes each type to its own endpoint/handler. - One
allwebhook — a single URL receives everything and your handler routes by the payload’seventfield.
Validating the Endpoint
Before releasing the webhook to receive real traffic:- Use webhook.site or ngrok to inspect the traffic (the test webhook’s
overrideUrlfield accepts these URLs) - Trigger deliveries with
POST /api/webhooks-config/test, varying thestatus - Verify that your application:
- Validates
X-NTXPay-Signaturecorrectly - Returns
200in under 10 seconds - Deduplicates by
x-event-id
- Validates
Next Steps
Implementation
HMAC validation in Node.js, Python, Java, and Go
Events
Payload for each event type