Limits
Measured in a Stripe sandbox where it could be, taken from Stripe’s docs where it couldn’t; the source is on each row.
Where it applies
Section titled “Where it applies”| Where | What it means | Source |
|---|---|---|
| Classic and flexible billing mode | Discount scripts run on subscription invoices in both billing modes. | F14 |
| One-off invoices | They run on invoices without a subscription too, for the types that count one-time items. | F14 |
| Invoice previews | Stripe's invoice preview runs the script and matches the invoice Stripe then issues; Verify on Stripe shows it. | F15 |
| Promotion codes and subscription-mode Checkout | A promotion code can wrap a Discount Kit coupon, and Checkout in subscription mode applies the coupon or the code. | F4 |
| After classic coupons | A classic coupon and a Discount Kit coupon stack in the order of the invoice's discounts; the later one sees what the earlier one left. | F3 |
Where it doesn’t apply
Section titled “Where it doesn’t apply”| Limit | What it means | Source |
|---|---|---|
| One Discount Kit discount per subscription | Stripe refuses a second discount-script coupon on the same subscription; classic coupons still stack. | F3 |
| Quotes | A quote refuses a Discount Kit coupon. | F4 |
| Checkout in payment mode | It gives no discount and no error; Checkout in subscription mode applies it. | F4 |
| Adaptive Pricing in Checkout | It can bill a customer in their own currency, and a discount with a currency (an amount off, spend tiers) gives nothing in another one. Turn Adaptive Pricing off for those, or use percentages. | Engine |
How the amount is applied
Section titled “How the amount is applied”| Limit | What it means | Source |
|---|---|---|
| One amount per invoice | A discount script returns one amount for the whole invoice, not one per line. | Docs |
| Rounded half-up, spread pro rata | Stripe rounds the amount half-up to a whole minor unit and spreads it over the lines in proportion to their amounts. | F2 |
| Whole yen in JPY | Amounts in yen are whole yen, and spend thresholds are in yen. | F9 |
| Mid-cycle changes | New charges are discounted for their share of the period; credits for unused time keep the earlier invoice's rate. | P2 |
| Downgrades | They are priced the same way, so a downgrade invoice's discount total can be negative. | P2 |
| Fixed once created | A coupon's settings can't change. Revising creates a new coupon and archives the old one; subscriptions keep the one they have. | F5 |
What a discount can’t see
Section titled “What a discount can’t see”| Limit | What it means | Source |
|---|---|---|
| Other coupons on the invoice | A discount script can't see the other discounts on the invoice. | Docs |
| Other invoices | A script has no storage and no history, so tiers and bundles count what is on one invoice. | Docs |
| The billing cycle anchor | Stripe doesn't send it to discount scripts, so Lifecycle discount counts from a date in metadata. | P1 |
| A customer on anonymous previews | A preview without a customer carries none, so customer-metadata targeting shows only on a real customer's invoice. | P3 |
| Subscription metadata from Checkout | Checkout drops subscription_data.metadata unless your integration sets it, and Payment Links made in the Dashboard set none, so a Lifecycle discount's start date or a subscription segment needs it set. | P9 |
When something goes wrong
Section titled “When something goes wrong”| Limit | What it means | Source |
|---|---|---|
| A failing script gives nothing | A script that throws or runs longer than 500 milliseconds gives no discount on that invoice, with no error on it, and Stripe doesn't retry it. | Docs |
| Stripe emails you | Stripe emails your account about a failing script, at most once a day per extension, live mode and sandboxes counted apart. | Docs |
Zero discounts where you expected money off show in your invoices and on the app’s overview and detail pages.
Sources
Section titled “Sources”Sandbox findings, 15 October 2026: measured through the Stripe API in a Stripe sandbox (app 0.0.5 with dk-tiered 0.0.4), raw calls recorded.
- F2 · Rounding half-up, allocation pro rata by line amount
- F3 · Classic and custom coupons stack in
discounts[]order; a second custom coupon is refused - F4 · Promotion codes wrap custom coupons; subscription-mode Checkout applies them; payment mode gives nothing; quotes refuse them
- F5 · A coupon's configuration is immutable
- F9 · JPY amounts in whole yen; spend thresholds in yen
- F14 · Scripts run in classic billing mode and on standalone invoices
- F15 ·
create_previewruns the script and matches real invoices
End-to-end probes: run dk-e2e-20261015235736-hcpp in the same sandbox, recorded 15 October 2026 at 23:59 UTC, with its invoices.
- P1 ·
anchor: the billing cycle anchor is not delivered - P2 ·
proration: credit lines keep the reversed rate; debit lines are scripted - P3 ·
anonymousCustomer: no customer on anonymous previews - P9 ·
checkoutMetadata:subscription_data.metadatadropped
The app's own engine, as its tests pin it.
- Engine · The currency guard: a discount with a currency gives nothing on invoices in another currency
Stripe's documentation: the row links the page.