Webhooks
Register an HTTPS endpoint in the dashboard. You get a signing secret (whsec_...) shown once. Every event we send is signed with it. You can also register by API key:POST /v1/webhook_endpoints with { url, events } returns the same whsec_... secret, shown once. In the dashboard (Developers → Webhooks) you can also rotate a secret (POST /v1/me/webhooks/{id}/rotate — the new secret is active immediately, so deploy it before the next event) or disable an endpoint (DELETE /v1/me/webhooks/{id}).
POST https://yourshop.com/hooks/cedilink
X-CediLink-Signature: t=1754049600,v1=5f3c9a...
X-CediLink-Event-Type: payment_intent.succeeded
X-CediLink-Delivery-Id: dlv_01HXYZ
Content-Type: application/json
{
"id": "evt_01HXYZ",
"type": "payment_intent.succeeded",
"sequence": 3,
"created_at": "2026-08-02T12:44:12Z",
"data": {
"intent_id": "pi_01HXYZ",
"amount": 25000,
"currency": "GHS",
"reference": "order-4471",
"status": "succeeded"
}
}data.amount is the amount you asked for — the figure to settle against. When the customer was charged more than that (the 3% customer fee), the event also carries amount_charged and customer_fee with the grossed total and the fee.
Verify before you trust
Anyone can POST to your endpoint. The signature is what separates our event from someone else’s.
import crypto from 'node:crypto';
function verify(rawBody, header, secret) {
const parts = Object.fromEntries(
header.split(',').map(p => p.split('='))
);
// 1. Reject anything old. Without this, a captured event
// can be replayed forever, and the signature stays valid
// because it always was.
const age = Math.abs(Math.floor(Date.now() / 1000) - Number(parts.t));
if (age > 300) return false;
// 2. Sign the RAW bytes. If you JSON.parse first and
// re-stringify, key order and whitespace change and this
// will never match.
const expected = crypto
.createHmac('sha256', secret)
.update(`${parts.t}.${rawBody}`)
.digest('hex');
// 3. Constant time. `===` on a signature leaks it a byte
// at a time through response timing.
return crypto.timingSafeEqual(
Buffer.from(expected),
Buffer.from(parts.v1)
);
}Use the raw body
express.json() gives you a parsed object, and re-serialising it produces different bytes. Capture the raw body first: express.raw({ type: 'application/json' }).Be idempotent
Delivery is at-least-once. You will receive the same event twice: on our retry, on a network blip, on your own 500 that actually succeeded. Key on event.id and no-op if you have seen it.
if (await seen(event.id)) return res.sendStatus(200); await markSeen(event.id); await fulfilOrder(event.data.reference);
Ordering is not guaranteed
Each event carries a sequence that increases per intent. If you receive a lower sequence than one you have already processed, discard it. Otherwise a retried delivery can re-run work you already completed.
Retries
Any non-2xx, or anything slower than 10 seconds, counts as a failure. We retry on this schedule, then dead-letter.
10s -> 1m -> 5m -> 30m -> 2h -> 6h -> 12h -> 24h -> dead letter
Roughly two days of attempts. Long enough that a handler broken on Friday evening still receives the weekend’s payments on Monday.
Return 200 fast, then do the work
Events
| Event | When |
|---|---|
payment_intent.succeeded | Money moved and the ledger is written. Safe to ship goods. |
payment_intent.failed | Terminal. The customer declined, had no funds, or the number was wrong. |
These are the only two events emitted today — there is no payment_intent.processingand no payout event. Check a withdrawal's status with GET /v1/me/payouts instead.
Local testing
localhost. Use ngrok http 4000 or cloudflared tunnel and register the public URL. In test mode we also accept http://localhost directly, so you can skip the tunnel for our webhooks, though not for gateway callbacks.