---
title: "Billing customizations: change how discounts are applied"
description: "Stripe Billing now lets developers customize discount calculation through extension points, replacing workarounds like managing multiple coupons or restructuring product catalogs. The discount calculation extension point runs a TypeScript script in Stripe’s runtime, making the logic readable, testable, and maintainable. Scripts can target discounts by price metadata or native properties such as recurring interval, usage type, or unit amount. The same coupon can behave differently for different prices, for example giving annual subscribers a full discount while splitting it across months for monthly subscribers. Configurable fields in the script allow non-technical users to set parameters like discount percent or seat caps through the Stripe Dashboard without changing code."
---

# Billing customizations: change how discounts are applied

[Stripe](https://yomu.fyi/company/stripe) · Anjali Gola · Nov 17, 2026

**Type:** Announcement

## Summary

Stripe Billing now lets developers customize discount calculation through extension points, replacing workarounds like managing multiple coupons or restructuring product catalogs. The discount calculation extension point runs a TypeScript script in Stripe’s runtime, making the logic readable, testable, and maintainable. Scripts can target discounts by price metadata or native properties such as recurring interval, usage type, or unit amount. The same coupon can behave differently for different prices, for example giving annual subscribers a full discount while splitting it across months for monthly subscribers. Configurable fields in the script allow non-technical users to set parameters like discount percent or seat caps through the Stripe Dashboard without changing code.

## Approach / What changed

Stripe now offers discount calculation extension points where developers can write TypeScript scripts that replace the default discount logic. Scripts are bundled in a Stripe App, defined as an extension targeting the discount calculation point, and made available in the coupon creation page. The script receives the invoice request and a config object, and returns a discount amount. Config fields are rendered in the Stripe Dashboard so non-technical users can set parameters without changing code.

## Takeaways

- Stripe’s discount calculation extension point lets you replace default discount logic with a custom TypeScript script that runs in Stripe’s runtime, making it readable, testable, and maintainable.
- Scripts can target discounts by price metadata (e.g., plan\_type, region) or native price properties (e.g., recurring interval, usage type, unit\_amount), avoiding product catalog restructuring.
- Configurable fields in the script are rendered in the Stripe Dashboard, allowing non-technical users to set parameters like discount percent or seat caps without editing code.

## FAQ

### How does the discount calculation extension point work?

The discount calculation extension point lets you replace Stripe's default discount logic with a custom TypeScript script. The script runs in Stripe's runtime and receives the invoice request and a configuration object, then returns a discount amount.

### Can non-developers configure custom discount scripts?

Yes. You can define config fields in the script (e.g., discountPercent, tier1MaxSeats) that are rendered in the Stripe Dashboard at coupon creation time. Non-technical users can then set these values without editing the script or using the Stripe CLI.

### What price properties can a script use to target discounts?

The script can use native price properties such as price.recurring.interval, price.recurring.usage\_type, price.type, price.unit\_amount, and price.billing\_scheme. It can also read custom metadata on the price object, such as plan\_type or region, to target discounts selectively.

**Tags:** [API](https://yomu.fyi/topic/api), [Billing](https://yomu.fyi/topic/billing), [Discounts](https://yomu.fyi/topic/discounts), [Stripe](https://yomu.fyi/topic/stripe), [TypeScript](https://yomu.fyi/topic/typescript)

- Source: [Stripe](https://stripe.dev/blog/billing-customizations-change-how-discounts-are-applied)
- Source URL: https://stripe.dev/blog/billing-customizations-change-how-discounts-are-applied
- Ingested by Yomu: 2026-11-18T21:00:16.703Z

[Read original post](https://stripe.dev/blog/billing-customizations-change-how-discounts-are-applied)
