Webhooks Overview
Real-time event notifications for your IvoryPay transactions.
Webhooks allow IvoryPay to push real-time notifications to your server whenever an event occurs — such as a payment being received, a crypto payout completing, or a settlement finishing. Instead of polling the API for status updates, your server is notified automatically.
How webhooks work
1. A transaction event occurs (e.g., user pays fiat for an on-ramp)
2. IvoryPay sends an HTTP POST request to your configured webhook URL
3. Your server processes the event and responds with HTTP 200
4. If your server doesn't respond with 200, IvoryPay retries (number of attempts is configured via `app.maxNumInitialTrials`)Setting up webhooks
Via API
Webhook CRUD endpoints are authenticated with a business-user JWT (not an API key) and require one of the BUSINESS_ADMIN, BUSINESS_OWNER, or BUSINESS_DEVELOPER roles.
curl -X POST https://ramp-api.ivorypay.io/api/v1/webhooks \
-H "Authorization: Bearer <jwt>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://yourapp.com/webhooks/ivorypay",
"environment": "LIVE",
"events": ["onramp.success", "offramp.success", "deposit.received"]
}'See Setup Webhook for the full API reference.
Webhook payload structure
Every webhook delivery sends a JSON POST request with this structure:
Headers
Content-Type
application/json
x-ivorypay-signature
HMAC-SHA512 signature for verification (see Webhook Security)
Handling webhooks
Your webhook endpoint should:
Verify the signature — Validate the
x-ivorypay-signatureheader (see Webhook Security)Return HTTP 200 quickly — Respond within a few seconds to avoid timeouts
Process asynchronously — Queue the event for processing rather than doing heavy work inline
Be idempotent — You may receive the same event more than once (on retries); handle duplicates gracefully
Verify via API — After receiving a webhook, call the Verify Transaction endpoint to confirm the data
Example handler (Node.js / Express)
Example handler (Python / Flask)
Retry behavior
If your endpoint doesn't respond with HTTP 200, IvoryPay retries delivery:
1st
Immediate
2nd
After delay
3rd
After longer delay
After 3 failed attempts, the webhook delivery is marked as failed. You can check the delivery status in your dashboard.
Best practices
Always verify signatures — Never trust webhook payloads without signature verification
Return 200 immediately — Don't process the event before responding
Use HTTPS — Webhook URLs must be HTTPS in production
Handle duplicates — Use the
referencefield to deduplicate eventsVerify via API — Call the verify endpoint before making irreversible actions (crediting accounts, fulfilling orders)
Log everything — Log all webhook deliveries for debugging and auditing
Last updated