Webhooks
A payment succeeds after the payer has left your page, so the result reaches you as a signed POST. This guide covers how to register an endpoint, what a delivery carries, how to verify it, how retries run and how to make your handler safe against a repeat.
Register an endpoint
Endpoints are per mode. Create one on the test surface of the dashboard, https://dash.lemak.cash/test, under Developers, and it receives test events only. Create one on the live surface and it receives live events only. The dashboard calls POST /dashboard/v1/webhook_endpoints?mode=test on your session; there is no API-key route for this.
- url
- An absolute
httpsaddress with a public host name. Plainhttp, an IP literal andlocalhostare refused with400 invalid_url. At delivery time we also refuse to connect to a loopback, private, link-local or multicast address, whatever the name resolved to. For development, expose a local server through an https tunnel. - enabled_events
- The event types this endpoint receives. An empty list, the default, receives every type.
- secret
- Returned once by the create call and by nothing else: 64 hex characters, and the key of the
v1signature below is the 32 bytes they encode. We store no copy: the value is derived from our master key at every delivery, so nothing we hold can leak it. If you lose it, delete the endpoint and create a new one, or verify withv2, which needs no secret. - api_version
- The version every delivery to this endpoint is rendered at. Set at creation to your account's pinned version. See Versioning.
- status
enabledordisabled. A disabled endpoint is queued nothing. Delete tombstones the row, so the deliveries already made keep the address they were made to.
The event
Every delivery is one event, as JSON, with Content-Type: application/json; charset=utf-8:
{
"id": "evt_AGQHB2K3ZT6RXM4EQ7WPOILG5A",
"type": "payment_intent.succeeded",
"created": "2026-10-16T08:14:09Z",
"livemode": false,
"data": {
"id": "pi_AGQHAVEX7J327MRWOPILG46G6Y",
"merchant": "mch_AF4K2Q7NZP3TJWB6RE5LXDM2CY",
"mode": "test",
"object": "payment_intent",
"status": "succeeded"
}
}
- id
- Stable and globally unique. The same event delivered twice carries the same id. It is the key to de-duplicate on.
- type
- The object and what happened, joined by a dot. A payment intent emits
payment_intent.<status>on every status change:requires_payment,processing,succeeded,channel_settled,failed,expired,canceled. A crypto payment on a layer 2 network succeeds when the transfer is seen and is final only when its batch is confirmed on layer 1: it then emitspayment_intent.finalizedonce, and if the chain takes it back first it emitspayment_intent.failedandpayment_intent.reversed. Its events and the intent carrycrypto.finaland, once final,crypto.final_at; deliver a high-value order on final. We can also reverse any other payment that succeeded when its payment channel never pays it to us: the intent moves fromsucceededtofailed, its amount leaves your balance, and you receivepayment_intent.failedandpayment_intent.reversed. A dispute emitsdispute.opened,dispute.updatedanddispute.closed. A settlement emitssettlement.<status>:pending,processing,paid,failed. These are the only types we deliver. - created
- RFC 3339 in UTC with a
Z, to whole seconds. - livemode
falsefor a test event. A test event reaches only a test endpoint, and the body says so as well, so a handler can refuse the wrong book even if an endpoint was registered in the wrong place.- data
- A notice, not the object: the object's
id, itsobjectname, the newstatus, your merchant id and themode. A settlement event also carriesamount. Read the full object with the API, for exampleGET /v1/payment_intents/{id}, before you ship goods or update a balance.
Events are not guaranteed to arrive in order. Two status changes seconds apart may be delivered the other way round, so act on the status you read from the API, not on the order of arrival.
Verify the signature
Every delivery carries X-Webhook-Signature with an HMAC-SHA256 under the endpoint secret and an Ed25519 signature under our published key. Check one of them, and the timestamp, before you act. Signatures has the format, a complete verifier and test values.
Source addresses
GET /v1/ips lists the IP addresses deliveries leave from. It takes no key, so you can read it before you have one. The dashboard's Developers screen shows the same list under Webhook source addresses.
curl https://api.lemak.cash/v1/ips
The signature is the control: verify it on every delivery. Allow-listing these addresses in your firewall is optional, and it never replaces the signature check. We announce a change to the list to every merchant before it takes effect, and updated_at moves with it. While webhooks is empty, deliveries do not come from fixed addresses. Our API itself is reached on shared Cloudflare addresses, which change and are not listed.
Delivery, retries and the log
A delivery is a POST with a 10-second timeout. Any 2xx status marks it delivered. Anything else, including a timeout or a connection failure, schedules the next attempt:
| After attempt | Next attempt in |
|---|---|
| 1 | 1 minute |
| 2 | 5 minutes |
| 3 | 30 minutes |
| 4 | 2 hours |
| 5 | 8 hours |
| 6 | 24 hours |
| 7 | none: the delivery stops and waits for a resend |
Seven attempts over about 35 hours, then the delivery stops rather than retrying for ever. The dashboard's Developers screen lists every delivery, newest first, with the attempt count, the status your endpoint answered and the next retry time, and offers Resend. A resend re-arms the delivery for the next worker pass; it is signed and logged like any other attempt. Fix the endpoint first, then resend, and if a long outage has stopped many deliveries, prefer reading the event list to resending each one.
Answer fast. Store the event, acknowledge with 200, and do the work after the response. A handler that calls your own systems before it answers will time out under load and be retried, which is more work, not less.
At-least-once delivery
A retry after a timeout may deliver an event your endpoint had in fact received. An event is therefore delivered at least once, never exactly once. Make the handler idempotent on event.id: insert the id into a table with a unique key before you act, and treat a conflict as "already handled". The id is the same on every attempt and on every resend.
Your endpoint is not the only copy of the record. GET /v1/events returns the events behind the deliveries, newest first, with the same ids and bodies, under your API key and in that key's mode. Use it to fill a gap after an outage: page with starting_after=<evt_id> and limit (1 to 100, default 20) until has_more is false.
curl "https://api.lemak.cash/v1/events?limit=100" \
-H "Authorization: Bearer sk_test_MFWZLFDEM5X3WDBPM7ULRVDKCE"
Versioning of payloads
An endpoint carries an api_version, set when you create it to the version your account is pinned to. Every delivery is rendered at that version before it is signed, so the signature always covers the bytes you receive. The stored event keeps the current shape; the rendering is on the way out. To move an endpoint to a newer version, change api_version with PATCH /dashboard/v1/webhook_endpoints/{id} from the dashboard, and your handler changes with it.
Every version renders an event in the same shape today: the one change of 2026-10-23 is a request rule. Adding a field to an event is not a new version; a handler must ignore fields it does not know. See Api-Version for how versions work on requests.