Skip to main content
LuminPay sends an HTTPS POST to your endpoint when something happens on your account, such as a charge being paid.

Add an endpoint

In your dashboard, open Developers → Webhooks and add your URL, or use the API:
The response includes signingSecret (whsec_...). Store it as a secret; you need it to verify each delivery. URL rules:
  • Live endpoints must use https. Sandbox also accepts http, which is handy with a tunnel such as ngrok.
  • The URL must be publicly reachable. localhost, private network addresses and URLs with a username or password are refused.

Send a test event

This delivers a signed webhook.test event straight away and returns the delivery record, including your endpoint’s responseStatus.

Events

Charge fields: chargeId, reference, status, amount (what arrived, in the smallest unit of asset), asset (the coin the customer paid with), amountNgn (kobo, or null), and paymentLinkId and invoiceId (or null) when the payment came through a payment link or invoice. Part-payment fields (on charge.underpaid and charge.paid): amountDue (the amount the customer was asked to pay), amountReceived (everything that has arrived so far), amountRemaining, topUpUntil (until when the customer can send the rest to the same address, or null), and partialPayments (how many payments so far). All amounts are in the smallest unit of asset. When a merchant accepted a short payment as the full payment, charge.paid also carries acceptedShort: true and acceptedShortReason.
A part-paid charge stays open: the customer can send the rest to the same address until topUpUntil, and the merchant can give more time. When the payments add up, you get charge.paid. Don’t release goods on charge.underpaid. charge.expired can be followed by charge.paid for the same charge if the customer pays late. See Statuses. charge.on_hold is followed by charge.paid (or charge.underpaid) if the check clears, or charge.failed if it doesn’t.

What a delivery looks like

Verify the signature

v1 is the HMAC-SHA256, in hex, of <t>.<raw request body>, keyed with your endpoint’s signing secret. To verify:
  1. Read the raw request body. Don’t parse and re-serialise the JSON first, or the signature won’t match.
  2. Split the header into t and v1.
  3. Compute HMAC_SHA256(secret, t + "." + rawBody) and compare it to v1 with a constant-time comparison.
  4. Reject the request if t is more than 5 minutes from your clock. This stops someone replaying an old delivery.

Respond quickly

Return any 2xx status within 10 seconds. Do slow work, such as sending emails, after you respond.

Retries

If your endpoint returns anything other than 2xx, or doesn’t answer within 10 seconds, LuminPay tries again after 1 minute, 5 minutes, 30 minutes and 2 hours: five attempts in all. After that the delivery is marked failed. You can see every attempt, with your endpoint’s status code and response, under Developers → Webhooks or with GET /webhooks-platform/events. Because of retries, the same event can arrive more than once. Use id to process each event only once.

Turn an endpoint off

Send "active" to turn it back on. Disabled endpoints receive nothing.