Stripe's Nov 18 Release Gave Coupons a Script Instead of a Percentage. The Portal Still Won't Show the Customer What It's Worth.
Stripe's new custom coupon type runs your code to price a discount and can spot a cancellation invoice. The catch: customers never see the number.
Every Stripe coupon has worked the same way since Billing existed: you pick percent_off or amount_off, set a number, and that number applies to every invoice the coupon touches until its duration runs out. It doesn't know whether the invoice it's discounting is a routine renewal or the one invoice generated the moment someone clicked cancel. On November 18, 2026, that changed. A new custom coupon type landed in preview SDKs, and it replaces the fixed number with a script that runs at billing time and decides the discount itself.
That gap between a flat discount and a personalized one is exactly what a static coupon has never been able to close on Stripe, because a static coupon has no way to look at who it's discounting or why. The new extension mechanism is the first time Stripe Billing lets you fix that without building an entirely separate pricing layer outside of Stripe.
What actually shipped on November 18
Mechanically, a custom coupon is a thin wrapper around a function. You set type: "custom" on Coupon.create, point custom.extension.id at either a Stripe-authored script or your own, and optionally pass a custom.configuration object the script reads at runtime. Stripe calls your script's computeDiscounts method on every invoice the coupon is attached to, hands it three things, and expects one thing back.
| What the script receives | What it tells you |
|---|---|
grossAmount | The invoice total before any discount, as a decimal amount plus currency. |
lineItems | Each item on the invoice — subtotal, quantity, billing period, and the price/product it's tied to, including both their metadata. |
billingReason | Why this invoice exists: subscription_cycle, subscription_create, subscription_cancel, contract_cancel, manual, and ten more values. |
customer | The customer's ID and metadata, when one is attached to the invoice. |
The script has to return a non-negative amount, in the invoice's own currency, that doesn't exceed the gross total — Stripe validates all three before applying anything. It also has to be deterministic: no network calls, no external state, same inputs always produce the same output. And if the script errors, times out, or returns something invalid, Stripe doesn't retry and doesn't guess — it falls back to a zero discount on that invoice. A broken discount script fails closed, not open, which is the right default but worth knowing before you ship one: a bug in your logic costs you a discount you meant to give, not a discount you didn't mean to give.
The four scripts Stripe wrote for you, and the one thing none of them do
You don't have to author anything to use a custom coupon today. Stripe ships four ready-made scripts you configure through the Dashboard like any other coupon, no code and no app review required.
| Script | What it does | What it checks |
|---|---|---|
| Percent off up to maximum | A percentage discount capped at a fixed dollar amount, so a 40% coupon never costs you more than, say, $50 on any single invoice. | Invoice gross amount only |
| BOGO and quantity promos | Buy N units of a tagged product, get up to M more free — discounts the cheapest eligible units first. | Product metadata key/value, line item quantities |
| Price-targeted amount off | A fixed amount off each invoice line whose price carries a specific metadata tag, capped at that line’s subtotal. | Price metadata key/value |
| Price-targeted percent off | A percentage off each invoice line whose price carries a specific metadata tag, summed across matching lines. | Price metadata key/value |
Notice what's missing from that list: not one of the four stock scripts reads customer metadata. They all key off the invoice total or off metadata you've tagged onto products and prices — useful for running a promotion on a specific SKU, useless for "give subscribers who've been with us 18+ months a bigger save offer than subscribers who signed up last week." Stripe's own documentation lists customer-metadata-based discounts as a use case for custom coupons, but getting there means authoring your own extension and clearing Stripe's live-mode review, not configuring a dropdown. The gap between what's listed as possible and what ships out of the box is exactly where most of the engineering effort in this release will actually go.
The field that matters most for churn: billingReason
Of everything a custom coupon script can see, billingReason is the one that changes what a "retention offer" can mean on Stripe. Before November 18, a coupon configured as your customer portal's retention discount was just a coupon — the same percentage applied whether it landed on the invoice generated at signup, at a normal monthly renewal mid-subscription, or at the invoice fired the instant someone clicked cancel. There was no way to make the discount conditional on it actually being a retention moment, because the coupon object had no concept of "moment" at all.
A custom coupon's script can check request.billingReason === 'subscription_cancel' and branch on it directly — apply a discount only on that specific invoice, skip it entirely on subscription_cycle invoices, or size the discount differently depending on which one fired. That's a mechanism no combination of percent_off and duration settings could ever produce, because those fields describe a span of time, not a cause. It's also the one feature of this release that's purpose-built for exactly the moment our pause vs. discount vs. downgrade comparison is about — the second a subscriber is actually trying to leave, not every invoice that happens to arrive while a coupon is still active.
Where this plugs into your cancellation flow
Stripe explicitly supports using a custom coupon as the customer portal's retention offer — the same single coupon slot under Settings → Billing Portal → Cancellations that's been there for years, now able to hold something smarter than a flat number. That slot was never the bottleneck on offer sophistication so much as the math behind it was. Worth remembering, though, that even a dynamically-priced coupon still only fills one slot: it can make the dollar amount smarter, but the portal still shows exactly one offer to everyone who reaches the cancel screen, which is the same structural ceiling we flagged when Stripe added custom cancellation reasons back in August — better inputs on one side of the flow, one fixed output on the other.
And a smarter coupon is competing with offer types that, on their own, already outperform discounting in the aggregate:
Source: Chargebee, "Navigating the Retention Landscape" (Q1 2024 cancellation benchmark data).
Discounts lead that list, but only just, and a smarter discount script doesn't change which offer type a given subscriber actually wants — a subscriber who isn't using your product still wants a pause, not a better-calculated 22% off. Where a custom coupon earns its keep is inside the discount lane specifically: making the number a price-sensitive subscriber sees reflect their actual tenure, plan, or usage instead of the same flat figure every price objection gets, which is the exact comparison we ran the break-even math on earlier this year.
The catch: nobody sees the number until after they've accepted
Here's the part that undercuts the headline feature. Stripe's own documentation on using custom coupons as retention offers says plainly that the cancellation screen displays the coupon's name and duration — not a predicted discounted price, not a savings amount. A subscriber sees "Loyalty Discount, 3 months" and has to decide whether to accept it with no idea whether that resolves to 10% off or 60% off their specific invoice. Stripe can't show the number because, structurally, it hasn't run the calculation yet — the script fires at invoice generation, which happens after the offer is already accepted and the subscription is already retained.
That's a strange thing to ship in the same release cycle as loss-framed cancellation messaging, which went the opposite direction — telling customers exactly, specifically what they'd lose. A custom coupon tells them nothing specific about what they'd gain. Depending on how your script is configured, that's either a minor UX gap or a real problem: a subscriber who priced a loyalty discount in their head at "probably decent" and gets billed a 5% token amount because your script's eligibility logic didn't match their account is going to feel misled, even though nothing was technically false.
The rest of the limitations are mostly about where a custom coupon can't go. It can't be applied directly to a Customer — only to a subscription, a quote, or an invoice. You can't stack two custom coupons on the same subscription. It can't discount one invoice item specifically; whatever amount the script returns gets spread evenly across every line on the invoice. And it's explicitly incompatible with subscriptions that have active prebilling — if you've already charged a customer upfront for future periods, a custom coupon configured as a retention offer won't apply to that subscription at all.
Where this actually belongs in a cancellation flow
None of that makes custom coupons a bad idea — it makes them a pricing primitive, not a finished retention strategy. The genuinely new capability is real: a discount that can look at billingReason, customer metadata, and line-item detail, and price itself accordingly, is a meaningfully better building block than a flat percentage that can't tell a cancellation from a renewal. What it still doesn't do is show the customer what that calculation produced before they commit, or route between fundamentally different offer types — a pause for the disengaged subscriber, a downgrade for the one paying for features they don't use, a dynamically-priced discount for the one who's genuinely price-sensitive — the way matching the offer to the stated cancel reason requires. That routing, and showing the actual number a subscriber would pay before they accept anything, is still work that has to happen in front of Stripe's portal rather than inside it. It's the same layer CancelFlow already sits in for reason-based offer routing, and it's a natural place to put a custom coupon's calculated price in full view instead of behind a name and a duration. If you're weighing whether a dynamically-priced discount is worth the engineering lift against your current flat-rate save rate, our churn calculator turns that gap into an MRR number before you write a line of script.
Frequently asked questions
What is a Stripe custom coupon?+
A custom coupon is a new Coupon type Stripe added to preview SDKs on November 18, 2026 (API version 2026-11-18.preview). Instead of a fixed percent_off or amount_off value, a custom coupon points at a script — a Stripe-authored one you configure, or your own extension — that calculates the discount at the moment an invoice is generated. The script receives the invoice's gross amount, its line items, the billing reason, and customer metadata, and returns a discount amount Stripe subtracts from the total.
Can a Stripe coupon script tell the difference between a renewal and a cancellation?+
Yes, and it's the most useful thing about this release for retention. The script's input includes a billingReason field, and subscription_cancel is one of its possible values, distinct from subscription_cycle, subscription_create, and the rest. A custom coupon can check for that specific value and apply a discount only on the invoice generated at cancellation — something a standard percent_off or amount_off coupon can't do, because it applies the same discount to every invoice it's attached to regardless of why that invoice exists.
Does Stripe's customer portal show customers the dollar amount of a custom-coupon discount?+
No. Stripe's own documentation is explicit about this: when a custom coupon is configured as the portal's retention offer, the cancellation screen shows the coupon's name and duration, not a predicted discounted price or savings figure. Customers accept the offer before Stripe has actually run the calculation against their invoice, so the exact number is unknown even to Stripe at the moment the customer is deciding.
Do I need Stripe's approval to use a custom coupon script in live mode?+
For your own extension, yes. Stripe reviews and approves custom discount-calculation scripts before you can install and run them in live mode, the same review gate it uses for other Stripe Apps extensions. The four Stripe-authored scripts — covering percentage caps, quantity promos, and price-targeted discounts — skip that review because Stripe wrote and already approved them; you just configure values, no code and no review required.
Stop losing subscribers today
One script tag. One function call. A live cancellation flow in under 10 minutes.
Start free trial →