Webhooks allow IteraPay to push real-time notifications to your server whenever a payment event occurs — such as an invoice being paid or a transaction being confirmed. Rather than polling the API, you register an endpoint on your server and IteraPay sends HTTP POST requests to it as events happen. This guide covers how to create your webhook, verify its authenticity, and handle incoming event payloads.Documentation Index
Fetch the complete documentation index at: https://docs.iterapay.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- A publicly accessible HTTPS endpoint on your server
- Your
merchantIDand a valid API key or JWT bearer token
Register a webhook endpoint
Create or update your webhook
Register your endpoint URL and a secret that IteraPay will use to sign payloads. If a webhook already exists for your merchant account, this request will update it.Expected response:
Store the returned
token securely. You’ll use it alongside your secret to verify that incoming webhook payloads genuinely originate from IteraPay.Verify your webhook configuration
Confirm that your webhook is registered correctly by retrieving the current configuration.Expected response:
Implement your webhook handler
Set up an HTTP endpoint on your server to receive
POST requests from IteraPay. Your handler must:- Read the raw request body (before any JSON parsing)
- Verify the signature (see the next section)
- Process the event
- Return a
200status code promptly
- Node.js
- Python
webhook-handler.js
Verify webhook signatures
Every request from IteraPay includes a signature header that you must validate before processing the payload. This confirms the request is genuine and the payload has not been tampered with. The signature is an HMAC-SHA256 hash of the raw request body, signed using your webhook secret. Verification steps:- Extract the
X-Iterapay-Signatureheader value - Compute
HMAC-SHA256(rawBody, yourSecret) - Compare the computed hash to the header value using a constant-time comparison function (e.g.,
timingSafeEqualin Node.js orhmac.compare_digestin Python) - Reject the request if the values do not match
Example webhook payload
IteraPay sends a JSON payload to your endpoint for each event. The structure includes an eventtype and an associated data object.
Common event types
| Event type | When it fires |
|---|---|
invoice.paid | A customer sends payment to an invoice address |
transaction.confirmed | An on-chain transaction reaches the required number of confirmations |
collection.completed | A fund collection sweep finishes |
withdrawal.completed | A withdrawal transaction is confirmed on-chain |
Remove a webhook
To stop receiving webhook notifications, delete your webhook configuration:200 or 204 response with no body.