Skip to main content

Overview

Webhook configuration is done via four endpoints:
  • GET /api/webhooks-config — list active webhooks
  • POST /api/webhooks-config — create/configure a webhook
  • POST /api/webhooks-config/test — trigger a signed test webhook
  • DELETE /api/webhooks-config/{id} — delete a webhook

Create Webhook

Request

Response (201)

If you omit secret in the request, NTX Pay generates one automatically and returns it in the response — store it immediately, it is never shown again.

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 for cash_out) — routes each type to its own endpoint/handler.
  • One all webhook — a single URL receives everything and your handler routes by the payload’s event field.

Validating the Endpoint

Before releasing the webhook to receive real traffic:
  1. Use webhook.site or ngrok to inspect the traffic (the test webhook’s overrideUrl field accepts these URLs)
  2. Trigger deliveries with POST /api/webhooks-config/test, varying the status
  3. Verify that your application:
    • Validates X-NTXPay-Signature correctly
    • Returns 200 in under 10 seconds
    • Deduplicates by x-event-id

Next Steps

Implementation

HMAC validation in Node.js, Python, Java, and Go

Events

Payload for each event type