Retry Handling
How Cresora retries failed webhook deliveries and how to handle them idempotently.
Cresora automatically retries webhook deliveries that don't receive a 2xx response. Your receiver must handle retries gracefully.
Retry schedule
| Attempt | Delay after failure |
|---|---|
| Initial | Immediate |
| 1st retry | 30 seconds |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| Total | 4 attempts over roughly 35 minutes |
After the 3rd retry fails, the delivery is recorded EXHAUSTED and Cresora stops. No further attempt is made. No webhook or email is sent; a Webhook delivery failing notification appears under Notifications in your Partner Portal. Check the delivery log, or reconcile. See Failed deliveries.
The whole retry window is about 35 minutes, not hours. Any outage or deploy longer than that exhausts the deliveries in that window, and sustained failures can get the endpoint suspended without notice. Later events then raise no notification and, unless the endpoint is limited to specific merchants, leave no record in its delivery log (only retries already pending when it was suspended are recorded, as SKIPPED_SUSPENDED). Treat reconciliation — not retries — as your recovery path. Before you fix or resume the endpoint, check its settings as When Cresora suspends an endpoint describes and, if it is suspended, ask support to resume it as that section describes. Then redeliver from the delivery log, within the limits under Manual replay, and reconcile the rest against the API, from when deliveries started failing until they succeed again, including any time it is suspended again; ask support for anything the API cannot show.
These are the platform defaults. GET /webhook-metadata returns the retry policy actually in force — it is derived from server configuration, so it cannot drift from behaviour the way a hardcoded table can.
What triggers a retry
5xxfrom your endpoint403,408,429, or any other4xxnot in the permanent list below- A redirect (
3xx) — Cresora does not follow redirects; register the final URL - No response within 30 seconds (timeout)
- Connection refused or DNS resolution failure
Statuses that are never retried
400, 401, 404, 405, 410 and 422 are treated as deliberate, permanent rejections. The delivery fails on its first attempt and is never retried automatically.
This matters most during secret rotation. If your handler answers a signature it cannot yet verify with 400, the delivery fails at once, is not retried automatically and raises no notification; redeliver it from the delivery log once your handler can verify it. Use 500 for a failure you expect to recover from, and reserve 400 for a body you will never accept.
Asking Cresora to slow down
If you return a Retry-After header on a retryable response, Cresora honours it in place of the ladder step above — so you can push the next attempt further out than the schedule would, for example while you drain a backlog behind a 429.
Two limits:
- Delta-seconds only.
Retry-After: 120works. The HTTP-date form is ignored, and the ladder step is used instead — so a date-formatted header silently does nothing. - Capped at 24 hours. A larger value is clamped, so a misbehaving receiver cannot pin a delivery arbitrarily far into the future.
Because a honoured Retry-After replaces the ladder delay, it can stretch the total window well past the default ~35 minutes. The 4-attempt count does not change.
Idempotent retry handling
Because Cresora retries, your handler will receive the same event multiple times. Always handle events idempotently:
// Use the envelope's event_id as an idempotency key
async function handleWebhookEvent(event) {
// processed_events has a unique index on event_id. Claim the event and
// process it in one transaction: a duplicate finds the claim taken, and a
// throw rolls the claim back so the next attempt processes it again. Work done
// outside tx (an API call, an email) is not rolled back and runs again, so make
// it idempotent too, for example with an Idempotency-Key derived from event_id. If this
// runs in a queue worker after you answered 200, Cresora does not retry: your
// queue must. db, tx, insertIfAbsent and processEvent are placeholders for
// your own code; insertIfAbsent stands for INSERT … ON CONFLICT (event_id) DO NOTHING.
await db.transaction(async (tx) => {
const claimed = await tx.processedEvents.insertIfAbsent({ eventId: event.event_id });
if (!claimed) {
console.log(`Duplicate event ${event.event_id} — skipping`);
return; // Already handled; return 200 anyway
}
await processEvent(event, tx);
});
}Return 200 OK even for duplicate events. A retryable 4xx keeps the delivery on the ladder and produces more duplicates; a 400 or 422 fails the delivery at once, with no notification. Neither outcome is what you want — acknowledge duplicates with 200.
Respond quickly, process asynchronously
Your endpoint must respond within 30 seconds. For complex processing, respond immediately and handle the work in a background queue:
// verifyWebhook is on Signature verification and reads the raw body bytes, so capture them:
// app.use(express.json({ verify: (req, _res, buf) => { req.rawBody = buf; } }))
// secret (the endpoint's signing secret) and queue (your job queue) are placeholders.
app.post("/webhooks/cresora", async (req, res) => {
try {
verifyWebhook(req, secret); // throws if it cannot verify; while you rotate secrets, a 500 gets it retried
await queue.enqueue(req.body); // queue it before you acknowledge it
} catch (err) {
console.error("webhook not accepted", err); // log it: a bug here fails every delivery
return res.sendStatus(500); // a clean rejection, never an unhandled rejection
}
res.sendStatus(200); // then respond, well inside 30 seconds
});Manual replay
You can manually replay a delivery of an active endpoint from the Partner Portal:
- Settings → Webhooks — open the endpoint's delivery log
- Find the failed delivery
- Click Redeliver
A redelivered event carries the same event_id as the original, and the same data less any field Cresora has since stopped sending; it is signed again when it is sent. Deduplicate on event_id, never on the body bytes or the signature.
Four limits apply:
- One delivery at a time. There is no bulk replay; you replay a specific delivery.
- 100 replays per endpoint per hour. Exceeding it returns
429with aRetry-Afterheader. - An active endpoint only. A suspended endpoint's deliveries can be replayed once Cresora resumes it; a disabled endpoint's cannot.
- Not while the delivery is still being retried. While Cresora is still retrying an event's delivery to the endpoint (see Retry schedule), or an earlier redelivery of it is still queued or being sent, a redelivery request is refused with
409 webhook_redelivery_in_flight. Do not send it again; the delivery log shows the outcome, and once the delivery has finished you can redeliver it.
If Cresora has suspended the endpoint (see Failed deliveries), redelivery is rejected with 422 invalid_state_transition until Cresora resumes it.