Now with MCP · your agent can query commission, affiliates, and payouts. Read-only. Connect a client
← Blog

Affiliate Postbacks and Server-Side Tracking (2026)

How postback URLs and signed provider webhooks report affiliate conversions server to server, and the failure modes that quietly cost affiliates money.

SSled13 min read
·Share on X

Every affiliate program has one moment that decides whether an affiliate gets paid: the moment a sale becomes a commission. Most arguments about affiliate tooling are really arguments about where that moment happens. In a browser, a cookie delivers the verdict, and other software may have capped, blocked or deleted it. On a server, the verdict arrives as a message between two machines, with a signature on it.

That pattern is a postback, or S2S tracking, or server-side conversion reporting. It matters even if you never build one by hand, because it decides who gets paid on trials, renewals and refunds. This post covers what a postback is, why the browser stopped being a reliable witness, the fields that matter, how Sled reports conversions, and how to test the path before it moves money.

Four tracking paths nobody ever documented, held together with hope

TL;DR

  • A postback is a server to server conversion report: one backend calls another with a referral id, an order id and an amount. No browser, no cookie cap.
  • Sled uses the same pattern with a better signer: a Polar, Stripe or Paddle webhook is the report, and the provider signature replaces the shared key.
  • Four fields carry the weight (referral id, order id, amount, subscription id), and the order id must be the one a refund references later, not a checkout session id.
  • Retries, duplicate deliveries and refunds that arrive before their sale are normal. Idempotency is the whole game.
  • Test the failure path before the happy path: a postback that pays twice is worse than no postback.

What a postback actually is

A postback is a request your server makes to someone else's server to report that a conversion happened. The tracker issues an identifier when the click happens, that identifier travels through checkout, and once money settles your backend calls the tracker's postback URL with the identifier plus the sale: order id, amount, currency, status.

The defining property is what is missing: a browser. Nothing has to load, no JavaScript has to run, no cookie has to survive. Your payment system already knows the order, so it reports the order. That is why affiliate networks have used postbacks for two decades. The shape is always two steps: the tracker hands out an identifier at click time, and the advertiser's server posts it back with the transaction once money settles.

One naming trap: a postback and a webhook are the same wire format with different owners. A postback is the advertiser calling the tracker, a webhook is the payment provider calling whoever registered an endpoint.

The four ways a conversion gets reported

Four mechanisms show up in real programs. They differ less in what they can report than in who is responsible when the report never arrives.

Method Who fires it What authenticates it Browser involved Typical failure
Thank-you page pixel Visitor's browser Nothing, or a public tenant id Yes Ad blocker or closed tab means no conversion
Provider webhook with referral metadata Polar, Stripe or Paddle Provider signature over the raw body No Referral metadata never reached checkout
Classic S2S postback Your backend Shared secret or key in the URL No Server errors stay invisible unless logged

The provider webhook is what Sled is built on, and it needs no click ids: the provider never learns which affiliate sent the visitor, so the referral code rides inside the checkout instead, as metadata on a Stripe session, custom data on a Paddle transaction, order metadata on a Polar order. When payment settles, the provider sends a signed event carrying both the money and the code, a postback with a managed key instead of a string you paste into a URL.

Why the browser stopped being a reliable witness

Nobody broke client-side tracking in one decision: it eroded browser by browser over about seven years.

Safari's Intelligent Tracking Prevention caps script-writeable storage: cookies set by JavaScript, plus localStorage, IndexedDB and service worker caches, are deleted after seven days without user interaction with the site, dropping to 24 hours when the landing URL carries something that looks like a click id. Since Safari 16.4 in April 2023 the cap also covers server-set cookies when Safari decides the setting server is not genuinely the same site. Firefox blocks third-party cookies by default, and in July 2024 Google announced it would not deprecate third-party cookies in Chrome after all, which removes the death date but leaves user-level blocking, extensions and incognito.

Here is the honest part: attribution still starts with a client-side hop. Somewhere a visitor clicked a link carrying a code, and something had to remember it until checkout. Sled's script writes a ta_ref cookie on your own domain for your configured window, 90 days by default, and logs the click server-side through a pixel that deduplicates by hashed IP over 24 hours. That cookie is exactly the category Safari caps at seven days, so a visitor who clicks on Monday and buys three weeks later on Safari may reach checkout with no code attached. Window length is covered in cookie windows and attribution models explained. After the click, server-side reporting takes over: once the code is on the order, nothing in the browser can remove it.

The fields every postback needs, and which ones bite

Four fields do almost all the work, and three are routinely set wrong.

The referral identifier. A click id in a classic network, a referral code in a provider webhook: a short string mapping to one affiliate. It must be unguessable enough that nobody can fabricate a conversion for someone else's code, and matched exactly, since Sled compares codes case sensitively.

The order id. This field quietly breaks refunds, because it has to be the identifier the payment system will use when money goes back. Stripe shows the trap: a refund arrives as charge.refunded, and a charge references a payment intent or an invoice, never the cs_ checkout session id that created it. Store the session id and no refund ever matches. Polar uses its order id, Paddle its transaction id prefixed txn_.

The amount, pre-tax. Polar and Paddle are merchant of record, so headline totals include tax the merchant never sees. Polar carries net_amount (subtotal after discount, before tax) alongside total_amount; Paddle reports details.totals.subtotal as a string in minor units, so "59900" means 599.00. Commission on the tax-inclusive figure overpays affiliates on every taxed sale, a leak nobody notices until a payout review.

The subscription id. The first invoice carries the referral, later invoices carry only the subscription. Without it on the first conversion no renewal can be attributed, and a recurring program quietly behaves like a one-time one. Setup differs, see the Stripe affiliate program guide.

One optional field matters: the customer email, used to block self-referrals. Stripe and Polar carry it, Paddle carries a customer id and no email, so email-based self-referral blocking cannot run there.

Signature verification: how a postback proves it is real

An endpoint that accepts unauthenticated conversion reports is an open invitation, which is why every serious provider signs its deliveries and every serious handler verifies before parsing anything.

Provider Header Signed payload and algorithm Tolerance in practice
Polar webhook-id, webhook-timestamp, webhook-signature Standard Webhooks scheme, HMAC key derived from the whsec_ secret Timestamp skew check, replay protection via message id
Stripe stripe-signature as t=...,v1=... HMAC-SHA256 over {timestamp}.{rawBody} 5 minutes is the libraries' default, and 0 disables the check
Paddle Paddle-Signature as ts=...;h1=... HMAC-SHA256 over {ts}:{rawBody} Paddle's SDK enforces 5 seconds; accept any h1 while rotating
Generic X-Webhook-Secret, or a bearer token in the Authorization header Shared secret, timing-safe compare, no HMAC No timestamp, so no replay protection: rotate on leak

Two details cause most failures. First, the raw body: these schemes sign the exact bytes that arrived, so read it before any JSON middleware touches it (await req.text() in Next.js, express.raw() before express.json() in Express). Parse and re-serialize instead and the signature never matches.

Second, schemes change under you. Polar changed how webhook secrets are derived on 2026-09-08, and the secret string does not say which derivation it uses, so Sled tries modern Standard Webhooks verification first and falls back to the legacy derivation. Without that fallback every customer who created an endpoint before the switch gets 401s, quietly: the provider retries, retries fail, it gives up, and nobody notices until an affiliate asks why their sales stopped counting. Unsigned traffic is refused outright here, since an endpoint with no configured secret returns 401 rather than trusting the payload. The wider anti-abuse surface is in affiliate fraud tactics.

Retries, duplicate deliveries and refunds that arrive first

This is where postbacks stop being plumbing and become accounting. Every provider's delivery guarantee is the same, at least once and in no particular order, and six failure modes follow from it. All six are normal.

Failure mode What it looks like What the handler has to do
Retry of a delivered event Same order reported twice Deduplicate on tenant plus order id, treat a unique violation as success
Refund before the sale Refund matches nothing, then the sale arrives Tombstone the refunded order id, create the later conversion already refunded
Refund id mismatch Stripe refund references payment intent, invoice or charge Store the refundable id at sale time, try every candidate id
Renewal without metadata Second invoice has no referral code Inherit the affiliate from the first conversion on that subscription id
Free-trial first charge A 0.00 order, then a real charge days later Seed the referral against the subscription on the 0.00 order, then inherit
Cancellation read as clawback Card canceled, past invoices unpaid retroactively Acknowledge the cancel, change nothing, let future renewals stop arriving

Two of these cost real money.

Refund-before-sale sounds impossible until you remember that retries can reorder delivery and that a refund can land seconds after a purchase. A handler that assumes the sale exists ignores the refund and pays commission on money that went back. A handler that keeps a tombstone of refunded order ids creates the sale correctly when it arrives, already refunded. We wrote about that race in when the refund beats the sale.

Zero-amount orders are the other money sink. A free trial produces a 0.00 order that pays no commission and, in a naive implementation, leaves no trace. Days later the trial converts and the real invoice arrives with no referral metadata at all. The referral is lost unless the 0.00 order stored it against the subscription id, which is what Sled does. Trial math has its own post: affiliate commissions on trials and freemium plans.

How Sled reports conversions, and where a postback URL fits

Sled's conversion path is server-side end to end, and deliberately boring.

The owner adds one webhook per provider, /{slug}/api/webhook/polar, /stripe, /paddle, and pastes the signing secret in Settings. Nothing goes on the checkout success page. Each route reads the raw body, verifies with the provider's own scheme, and refuses unsigned traffic. Normalization absorbs the quirks: Polar accepts both snake_case and camelCase spellings because the SDK adapter and the raw payload differ, and reads custom_field_data and reference_id for merchants on static checkout links. UTM parameters are never trusted, since every ad and newsletter sets those too.

From there, six rules: deduplicate on order id, inherit the affiliate on renewals, remember referrals from zero-amount trial orders, tombstone refunds that arrive early, never claw back past invoices on cancellation, and skip self-referrals when the email is available. Every delivery lands in a webhook log with a readable status (ok, duplicate, no-referral, no-affiliate, self-referral, subscription-canceled, trial-referral-stored, ignored, signature_failed, invalid_payload, error), grouped into four dashboard buckets, so "why did this conversion not count" is a two-minute question. Logging never blocks a delivery, since failing a webhook to write a log line would make the provider retry.

A server reporting the sale quietly, hours after the tab was closed

If your sales originate outside a payment provider, an invoicing tool, a mobile app store or an offline deal, the generic endpoint is your postback URL: POST { event, orderId, amount, email, subscriptionId, metadata: { referral } } with X-Webhook-Secret or a Bearer token, amount in minor units. It uses a shared secret rather than an HMAC, so keep it out of client code and rotate it if it leaks.

Testing a postback before it pays anyone

Test the failure path first: it is more common in production than the happy path, and it is where money is lost.

  1. Wrong secret. Send an event signed with the wrong secret. Expect a 401, a signature_failed log row, and no conversion. If a conversion appears, you are not verifying.
  2. Duplicate delivery. Replay the same body. Expect duplicate and unchanged totals, not a second row.
  3. Refund before sale. Send a refund for an order id, then the sale for that id. Expect a refunded conversion and nothing added to pending earnings.
  4. Duplicate refund. Replay the refund. Expect it to stay refunded and idempotent instead of erroring.
  5. Zero-amount order. Send a 0.00 order with a referral code and a subscription id. Expect trial-referral-stored, then a later renewal attributing to the same affiliate.
  6. Amount sanity. Check the commission equals floor(amount times rate), not rate applied to the tax-inclusive figure.

Polar and Stripe can replay events at a registered endpoint, and Paddle ships a simulator that reproduces the exact request including the signature header. Keep your server clock synchronized, since every tolerance check compares the event timestamp against the current time, which is why Stripe's documentation recommends NTP.

What to log, and a rollout checklist

A postback path you cannot debug from a dashboard is one you will debug from customer complaints. Log one row per delivery with the outcome and the order id, never the payload wholesale. Sled's webhook log exists because "why didn't my conversion show up?" is the most expensive support question in affiliate software; that story has its own post, the bug that wasn't a bug.

The rollout checklist:

  1. Pick one event per money moment: a sale, a renewal, and a separate refund path.
  2. Read the raw body before parsing it, every time.
  3. Verify the signature with a tolerance, and fail closed when no secret is configured.
  4. Make the handler idempotent on tenant plus order id, and treat a duplicate as success.
  5. Handle the refund before the sale, including the refund that arrives first.
  6. Store what the merchant actually earns, pre-tax, and the subscription id alongside it.
  7. Return a 2xx quickly and do the accounting after, since a slow handler gets retried.

FAQ

Do I need a postback URL to run an affiliate program? No. If you sell through Polar, Stripe or Paddle, the provider's signed webhook is already a server to server report carrying the referral code you attached at checkout. A postback URL matters when sales originate somewhere that does not speak webhooks: a custom backend, an invoicing tool, a mobile app store purchase, an offline deal. The generic webhook covers that with a shared secret and a small JSON body.

What is the difference between a postback and a tracking pixel? A pixel is a request the visitor's browser makes, so it depends on JavaScript running and a cookie surviving, and it gets blocked by ad blockers and capped by Safari. A postback is a request one server makes to another, triggered by a transaction that already settled. Pixels are fine for analytics, but commissions should come from a system that knows the money moved.

How do I stop webhook retries from paying an affiliate twice? Make the write idempotent on a natural key, which for conversions is tenant plus order id, and treat the unique-constraint violation as a successful duplicate. Providers retry on any non-2xx response and can reorder deliveries, so a handler that assumes one delivery per sale will double-count eventually. Refunds work the same way: flipping an already refunded conversion should be a no-op.

Can a postback report a refund as well as a sale? It has to, if the program pays on recurring revenue. Polar sends order.refunded, Stripe sends charge.refunded referencing a payment intent or invoice, and Paddle sends adjustment.created or adjustment.updated with an approved refund or chargeback, the only one that requires ignoring the pending state until approval. The refund finds its conversion through the stored order id, or leaves a tombstone if the sale has not arrived.

Related reading: the refund race in when the refund beats the sale, and provider-by-provider setup in how to add an affiliate program to Polar.sh. If you would rather wire the webhook once and be done, start free at /signup.

Try Sled

Recurring commission on every renewal.

Polar-native affiliate tracking, with Stripe and Paddle handled the same way. 10-day trial, no card required, cancel anytime. Then $19/mo or $99/yr.

Keep reading

All posts →