Guide library · Software Help HQ
Your Webhook Fired Twice: How to Stop Duplicate Actions Without Dropping Real Events
Brand: Software Help HQ
Primary query: webhook fired twice duplicate event how to fix
Guide type: Conceptual, documentation-backed troubleshooting; not a verified walkthrough for an
unnamed platform UI.
An order is marked complete and a course account is granted access. Moments later, the receiving application logs a second event for the same order. Is the sender broken? Not necessarily. Webhook delivery systems may retry when a response is lost or a receiver doesn't acknowledge the request in time. A receiver that treats every delivery as a new business action can create duplicate access grants, invoices or notifications.
The central distinction is event delivery versus business operation. A repeated delivery is not automatically a second sale. Your integration should make repeated processing of the same authorized operation harmless.
Map the original transaction and the repeated delivery
Consider a fictional course purchase:
- Checkout records one successful order.
- Payment platform issues an event with ID
evt_demo_17. - Automation grants the purchaser access to Course C.
- The reply acknowledging delivery is delayed or lost.
- The platform sends
evt_demo_17again.
A naive receiver grants access twice or emails two welcome messages. A safer receiver recognizes that the event was processed successfully and returns an appropriate acknowledgment without repeating the side effect.
This example is synthetic. It does not document the behavior of any particular Scale, Groove, Courses.gg or payment account.
Check the sender's published delivery contract first
Different webhook senders have different retry schedules, signatures and accepted responses. Some event systems deliver at least once, which means duplicates are an expected possibility. Stripe's official documentation explicitly discusses duplicate events and recommends recording processed event IDs. It also notes that separate event objects may sometimes represent the same underlying object and event type.
Do not hard-code Stripe's behavior into another provider's integration. Verify its actual event identity, signing/verification method, retry contract and time ordering before writing logic.
A safe processing model
Separate the system into four stages:
1. Receive and authenticate. Confirm the request is from the authorized sender using the provider's supported verification approach. A guessed shared secret or publicly accessible unauthenticated endpoint is unsafe.
2. Parse and validate. Read the event type, object/order ID, status and required fields. Reject unsupported events without granting access. Don't derive a successful purchase solely from a button-click callback.
3. Claim the operation atomically. Store a stable unique key (for example, provider + event ID; possibly also a provider-defined object/action key). If already claimed and completed, don't execute the side effect again. Beware two simultaneous duplicate deliveries: a read-then-write test without an atomic uniqueness control can race.
4. Execute and reconcile. Perform the required business operation only after verifying eligibility. Save completed/failed state and preserve a path for retrying genuinely failed actions. A failed partial grant cannot simply be marked complete forever.
The exact database or automation tooling varies, but the business invariant is stable: one authorized purchase causes one effective entitlement state, regardless of how many times the same delivery arrives.
A table of states rather than guesses
| Case | Desired resulting state | Test evidence |
|---|---|---|
| First legitimate paid event | Entitlement granted once | Order status and course-access record |
| Same event delivered again | No additional grant or duplicate mail | Event key already marked complete |
| Two duplicates arrive at once | Still one effective grant | Atomic uniqueness or supported dedup mechanism |
| Temporary course API failure | Operation remains retryable | Explicit failed/pending state |
| Failed payment or canceled order | No new paid entitlement | Verified order status, not click event |
| Qualified refund | Access changes only per documented policy | Source-specific revocation rules verified |
This table is a test specification, not evidence that any current Course or Checkout system passed it.
The subtle difference between “duplicate event” and “new event about the same order”
Some integrations send distinct event IDs when the same object changes status. For example, an order may be created, become paid, then be refunded. Those events are not duplicates; they are separate state transitions. A rule that says “I processed this order ID before, ignore every future event” could accidentally block a legitimate refund.
Deduplication must consider the business action and transition, not merely the existence of an order ID. Use the provider's documented event model to distinguish “grant access,” “revise subscription,” and “revoke access.” A single customer may have multiple valid purchases or access paths. Never revoke all manual entitlements because one payment source was refunded.
A recoverability drill
Before enabling a live workflow, use provider-sanctioned test events or fully local simulated payloads. Record the expected state for each of the six cases. Force a pretend temporary receiver failure. Confirm that successful resending recovers the desired state without duplicate action. Do not repeatedly fire test purchases against live checkout without explicit authorization and a documented isolation plan.
For no-code platforms, inspect whether there is a built-in “process once,” idempotency key, order-state lookup, or event log. If none is present, don't assume a linear visual workflow provides transactional safety. Record the limitation and prefer a verified native fulfillment path.
Troubleshooting without breaking course access
If you discover duplicate welcome emails but exactly one actual grant, start with the notification action and its retry behavior. If two course memberships exist, inspect the account's entitlement model. If an access grant failed, examine the stored receiver response and retry state rather than triggering a new customer purchase. If the order never became paid, focus on payment-status handling; a successful webhook request does not itself make an order valid.
When reporting results, separate test events, real paid events, manual access, refund actions, and unverified logs. A dashboard displaying “200 OK” alone is not proof that downstream enrollment is correct.
Reader exercise: define three invariants
Write these before building:
- “One paid source event shall produce at most one effective paid entitlement.”
- “A failed execution can be resumed safely without charging or granting twice.”
- “A refund affects only the entitlement created by the applicable payment source.”
Now construct the six-row table above and mark each scenario pass, fail or untested. For an integration where the publisher offers no supported test mode, hold release until an isolated verification path is available.
Keep an incident record without sharing the payload
You can investigate a repeated delivery without pasting a customer's details, signing secret or private fulfillment URL into a shared report. Keep detailed provider evidence in the authorized account and reference it from a redacted record. Do not put a real payload into a public worksheet or replay it to make the worksheet look complete.
Separate what the sender acknowledged from what the receiver changed. Stripe's documentation treats delivery status and downstream processing as different concerns and recommends verifying the event source. These are Stripe-specific documentation examples, not proof about an unnamed provider or a currently configured integration.
Free paper worksheet: one incident, restricted evidence references
- Scope: Name the provider and live/test environment without exposing an endpoint, token or customer identity.
- Identity: Reference the event, underlying object and intended business transition in the restricted system; distinguish a repeated delivery from a different transition.
- Authority: Reference the supported source-verification evidence. Unknown authentication means hold any entitlement conclusion.
- Transport: Record observed delivery status and time from the provider, not a guessed outcome.
- Side effect: Reference the actual grant, notification or other operation result. Keep unrelated manual access separate.
- Recovery: Mark completed, retryable, failed or unknown using actual evidence. Do not resend from this sheet.
- Review: Record the authorized operator's next action and explicit approval needed for any replay or account change.
No event, purchase, refund, grant or replay was performed for this worksheet. A redacted record helps explain the evidence; it does not replace authentication or make an untested workflow safe.
Related resources
Software Help HQ's existing integration and troubleshooting guides can supply the generic setup background. This article focuses specifically on repeated deliveries, atomic state changes and recovery—not the basic concept of an automation webhook. The reader should apply the method to their own provider documentation rather than assume an unnamed product's menus exist.
Sources
- Stripe official webhook delivery and duplicate handling: https://docs.stripe.com/webhooks
- Stripe endpoint duplicate-event guidance: https://docs.stripe.com/events/manage-webhook-endpoints
- Microsoft's Idempotent Consumer pattern: https://learn.microsoft.com/en-us/azure/architecture/patterns/idempotent-consumer