Webhooks
Webhooks
Webhooks are how your system learns that money moved.
A payout is not instant. Depending on the rail it settles in seconds, in hours, or on the next banking day, and a recipient can be rejected long after you created the payment. Polling GET /v1/payments either hammers the API or tells you late. A webhook tells you when it happens.
- Transport:
POSTto your https URL, JSON body, 10-second timeout. - Delivery: at-least-once. Deduplicate on the event
id. - Ordering: not guaranteed. Treat every event as a statement of state, not a delta.
- Retries: 8 attempts over ~45 hours, then the delivery is dead and we alert our team.
- Replay: everything is readable from
GET /v1/events, so an outage is recoverable.
Register an endpoint#
POST /v1/webhooks
Authorization: Bearer ek_live_…
Content-Type: application/json
{
"url": "https://merchant.example.com/ekash/webhooks",
"events": ["payment.sent", "payment.refunded", "payment.canceled"],
"description": "ledger sync"
}HTTP/1.1 201 Created
Content-Type: application/json
{
"data": {
"id": "12",
"url": "https://merchant.example.com/ekash/webhooks",
"events": ["payment.sent", "payment.refunded", "payment.canceled"],
"enabled": true,
"description": "ledger sync",
"consecutive_failures": 0,
"created_at": "2026-09-22T09:14:03Z",
"secret": "9f2c…64 hex characters…",
"secret_note": "Store this now. It is shown once and cannot be retrieved again."
}
}The secret is returned exactly once. There is no endpoint that reads it back. Store it in your secret manager before you close the response. If you lose it, delete the endpoint and register a new one — a new secret means a new URL registration, not a silent rotation.
Rules the registration enforces:
| Rule | Why |
|---|---|
| https only | The body carries amounts, recipient emails and masked account numbers. The signature proves authenticity; TLS provides the confidentiality. |
http://localhost / http://127.0.0.1 accepted outside production only | So you can receive real deliveries against the sandbox from a laptop or a CI listener. Production refuses them. |
| No credentials in the URL | Authenticate the delivery with the signature, not with a secret in a query string or userinfo. |
| One registration per URL per company | Registering the same URL twice means receiving every event twice. 409 endpoint_already_exists. |
Omitting events subscribes to everything | A bare URL that received nothing would be a silent failure. |
Unknown event names are refused (400 unknown_event_type) | Accepting payment.suceeded silently would leave you waiting for a delivery that can never arrive. |
Other endpoint operations: GET /v1/webhooks, GET /v1/webhooks/{id}, PATCH /v1/webhooks/{id} (events, enabled, description), DELETE /v1/webhooks/{id}, POST /v1/webhooks/{id}/test (sends a ping). All need the webhooks:manage scope. An endpoint belonging to another company answers 404, never 403 — a 403 would confirm the id exists.