An S2S postback timeout tells the sender that it did not receive a response. It does not tell the sender whether the receiver recorded the conversion. If the receiver commits a sale and the response gets lost, the next delivery looks like a new request even though it represents the same sale. Without deduplication, that retry can create a second conversion, inflate campaign reporting and trigger an extra commission.

The fix is to give each conversion event a stable idempotency key and enforce that key where the conversion is written. Every delivery attempt for the same event carries the same key. The receiver can then acknowledge a retry without repeating the financial effect.

Choose a key that identifies the event, not the request

An idempotency key answers a specific question: has this sender already submitted this event? A network-provided conversion event ID is a good starting point if the network keeps it unchanged across retries and documents where it is unique. If IDs are unique only within an advertiser account, for example, include that account in the receiver's uniqueness scope rather than treating the ID as globally unique.

A click ID is usually the wrong key. One click can legitimately produce a lead, a purchase and a renewal. An order ID can have a similar problem: a single order may generate a sale, a partial refund and another partial refund. Deduplicating by click or order alone can quietly discard valid activity. Adding an event type helps separate a sale from a refund, but it still does not distinguish two partial refunds. For repeatable events, use a distinct event or adjustment ID that stays fixed across deliveries.

Check the outbound template before relying on the key

Verify that the network actually substitutes the event ID into the postback URL. An empty parameter, an unresolved macro or an ID generated anew on every delivery defeats deduplication. Good tracking macro hygiene makes this easier: capture a real test conversion and its retry, then compare the resolved key in both requests. Reject missing or unresolved keys before creating a payable record. Generating a replacement key at the receiver would make each retry look new.

Make deduplication part of the conversion write

A lookup followed by an insert is not enough. Two workers can receive the same postback at nearly the same time, both find no existing conversion and both insert a record. Use a database uniqueness constraint on the agreed key and scope. Let the database decide which delivery records the event, rather than relying on request timing or a cache lookup.

  1. Authenticate the sender, validate the required fields and resolve the account scope before using the key.
  2. Within one transaction, claim the key and write the conversion or commission entry. If the transaction fails, neither the claim nor the financial record should remain committed.
  3. Return the success acknowledgement only after the transaction commits. If the same event arrives again, return the acknowledgement expected by the sender without writing another conversion.

Keep the conversion write separate from slower work such as refreshing a reporting dashboard or forwarding an advertiser notification. If that work must happen, save a durable follow-up record in the same transaction and process it asynchronously. Give the follow-up its own duplicate protection. Otherwise, the tracking database can show one conversion while a downstream payout or notification system receives two.

Handle a repeated key with different details

A repeated key is not proof that the payload is a faithful retry. Compare the fields that define the event's attribution or financial effect, such as the click ID, event type, amount and currency. Exclude delivery metadata that may legitimately change between attempts. If material fields differ, keep the original entry intact and flag the new delivery for review. Use the partner's documented conflict response, and don't silently overwrite the commission or treat the request as an ordinary duplicate. If the partner supports corrections, process them through the agreed update mechanism or as separately identified adjustment events.

Match retry rules to the partner's acknowledgement contract

If you control the sender, assign the key before the first attempt and persist it with the event. Retry temporary failures, such as a network timeout or a service outage, using the same key and financially relevant payload. Use bounded backoff with jitter so a receiver outage does not cause a burst of simultaneous retries. A permanent validation error should surface for investigation rather than cycle through the same retry schedule unchanged.

Check what the network counts as success. Some integrations expect a particular response body as well as a status code. A response that looks successful in your application logs may still prompt retries if it does not match the partner's contract. Conversely, acknowledging before a durable write can stop the retry even though there is no conversion to pay. Test through the same proxy and application path used in production, not just against the handler in isolation.

Keep keys available for late replays

Base retention on the longest period in which an old event can arrive again, not just the automatic retry window. Manual resends, outage recovery and reconciliation imports can all replay older events. If the conversion table is archived, retain a durable record of the scoped key or consult the archived record before accepting a replay. A short-lived cache can speed up duplicate checks, but it should not be the only thing preventing a second commission.

Prove that retries do not change payable totals

Track delivery attempts separately from accepted events. A single conversion may have several attempt records and still produce exactly one commission entry. Log enough to join those attempts to the accepted event: the scoped key, receipt time, handling outcome and internal conversion reference. Distinguish a matching retry from a conflicting payload or invalid request. A rise in matching retries can point to an acknowledgement problem without indicating that payable totals are wrong.

Use the same event references during network payout reconciliation. Match the network's event records to the internal commission ledger and inspect differences at the event level. Comparing only aggregate totals can hide a duplicate sale offset by a missing sale or an unprocessed refund.

Before rolling out the receiver, force the failure that makes idempotency necessary: commit a conversion, drop the response and send the same event again. Confirm that the retry receives the expected acknowledgement and that the ledger still contains one commission. Then send simultaneous copies, replay an older event and submit a genuinely distinct adjustment for the same order. The first two should leave the ledger unchanged; the adjustment should create its own entry. Those checks show that the system suppresses repeated deliveries without suppressing legitimate payout activity.