Webhooks
Receive real-time notifications when events happen in your NodeRails account: payments captured, invoices paid, subscriptions created, and more.
How webhooks work
- You register a webhook endpoint URL and choose which events to listen to.
- When an event occurs, NodeRails sends an HTTP POST to your endpoint with a JSON payload.
- Your server verifies the signature, processes the event, and responds with
2xx. - If delivery fails, NodeRails retries with exponential backoff.
Supported events
| Event | Description |
|---|---|
payment_intent.created | A payment intent was created |
payment_intent.authorized | Customer gave approval to pull money from their wallet |
payment_intent.captured | Funds taken from wallet, locked in escrow, and confirmed on-chain |
payment_intent.settled | Escrowed payment settled to merchant |
payment_intent.cancelled | Payment intent was cancelled |
payment_intent.refunded | Payment was refunded |
payment_intent.failed | Payment attempt failed |
checkout_session.completed | Checkout session completed |
checkout_session.expired | Checkout session expired |
invoice.paid | Invoice was paid |
invoice.voided | Invoice was voided |
subscription.created | A subscription was created |
subscription.paused | Subscription was paused |
subscription.resumed | Subscription was resumed |
subscription.cancelled | Subscription was cancelled |
subscription.renewed | Subscription period renewed |
Webhook payload
Every webhook delivery sends a JSON object with the following structure:
Signature verification
Every webhook request includes a signature header so you can verify the payload originated from NodeRails and wasn't tampered with.
| Header | Description |
|---|---|
x-noderails-signature | HMAC-SHA256 hex digest of the raw body |
x-noderails-timestamp | Unix timestamp (ms) when the payload was signed |
Using the SDK
The easiest way to verify signatures is with the SDK's webhooks helper:
Manual verification
If you're not using the SDK, you can verify the HMAC-SHA256 signature manually:
Use the raw body
Retry behavior
If your endpoint returns a non-2xx status code or doesn't respond within 15 seconds, NodeRails will retry the delivery:
- Up to 5 retries with exponential backoff
- Retry delays: 1 min, 5 min, 30 min, 2 hours, 24 hours
- After all retries are exhausted, the delivery is marked as failed
Best practices
- Return 2xx quickly. Process events asynchronously using a queue. Acknowledge receipt immediately to avoid timeouts and retries.
- Handle duplicates. Use the event
idfield to deduplicate. The same event may be delivered more than once during retries. - Verify signatures. Always verify the webhook signature before processing. Never trust unverified payloads.
- Use HTTPS. Webhook endpoints must use HTTPS in production for security.
Testing webhooks
You can send a test ping from the dashboard or via the API to verify your endpoint is reachable:
You can also view recent deliveries and their status in the dashboard or via the API: