How affiliate codes work with Stripe promotion codes
Why a creator code should be a real Stripe promotion code, how a sale is credited to the right affiliate without a cookie, and what happens when you change the discount.
A referral link only works if the person clicks it. Plenty of affiliate sales don't start with a click: a podcast host reads a code aloud, a YouTuber puts it on screen, someone passes it to a friend. For those, the code itself has to carry the attribution.
Coupons and promotion codes
Stripe separates the two. A coupon is the discount itself, for example 15% off the first payment. A promotion code is a customer-facing string, like JANE15, that applies a coupon. One coupon can have many promotion codes, and each code can carry its own metadata.
That is the shape an affiliate program wants: one coupon per campaign, and one promotion code per affiliate.
How the sale is credited
When a customer pays with a promotion code, Stripe records which code was used on the Checkout session and on the invoice. An affiliate tool that created the code knows which affiliate it belongs to, so it can credit the sale even when there is no cookie, no click and no signup event from your app.
Kickrail checks the code on the Checkout session first, then on the first invoice of a subscription, so codes typed into Stripe Checkout and codes applied through the API are both credited.
When you change the discount
Stripe allows only one active promotion code per string. If you move a campaign from a 15% coupon to a 25% one, the old JANE15 has to be turned off before a new JANE15 can be created on the new coupon.
Kickrail does this for you when you change a campaign's coupon: it deactivates each affiliate's old code, creates the same code on the new coupon, and keeps remembering the old one. A renewal that still carries the retired code, from a customer who subscribed months ago, is credited to the same affiliate.
Setting it up in Kickrail
- Create the coupon in Stripe, for example 15% off once.
- In Kickrail, open the campaign and pick that coupon. This needs the Starter plan or higher.
- Every approved affiliate in the campaign gets a promotion code, including the ones who joined before you added the coupon. Affiliates see their code in their portal.
The codes docs cover custom codes, limits and what affiliates see.