id as a
unique key and make each status transition idempotent. A later event may
arrive before an earlier retry, so compare event timestamps and current
state rather than assuming delivery order.
- Use the webhook
idto store each signed event once. - Use a stable fulfillment key derived from the merchant order and checkout to create one durable fulfillment job.
- Have both the webhook handler and status poller insert that same job with a unique constraint.
- Return 2xx after the authenticated event and job are committed. Do not wait for external fulfillment inside the webhook request.
