Private preview
Stripe-authored scripts Private preview
Configure prebuilt scripts to customize billing behavior from the Dashboard.
Interested in getting early access to Stripe-authored scripts?
Enter your email to request access.
Stripe provides prebuilt scripts for commonly requested billing customizations. You select a script, adjust its parameters, and activate it from the Dashboard. You don’t have to write any code.
Scripts apply at the account level and take effect for all recurring billing logic on the account. Changes take effect on the next billing operation that runs through the configured behavior.
To configure and activate any script, see Configure a script in the Dashboard.
Note
You’re responsible for making sure your configuration is correct. Stripe doesn’t take responsibility for any issues that arise as a result of your configuration.
In preview, if customization fails for any reason or causes harm, Stripe reserves the right to default to standard functionality and/or pause subscription processing. To understand the default behavior, see the descriptions of each available script (for example, prorate by custom interval or maximum credit per invoice).
Use cases
| Use case | Billing behavior | Script | Description |
|---|---|---|---|
| Set a minimum charge threshold. | Customer balance | Minimum amount before collection | Use this script to avoid collecting on small invoices by deferring them to the customer balance until the total owed reaches a threshold you define. Use it when you want to accumulate charges across billing cycles before collecting, or avoid charging customers for small amounts. |
| Set a maximum of credit to apply to a single invoice. | Customer balance | Maximum credit per invoice | Use this script when you want to spread credits across multiple billing cycles instead of applying them all at once, or when business rules require limiting credit usage per invoice. |
| Put metered usage items and licensed items on separate invoices. | Invoice item creation and routing | Separate invoice for metered items | Use this script when your finance team needs to reconcile usage charges separately from recurring seat or license fees, or when your customers expect different invoices for them. |
| Calculate prorations by hours, days, weeks, or months. | Proration | Prorate by custom interval | Use this script whenever your business needs proration calculated in units larger than a second, whether to match regional billing conventions, align with contractual terms, or reduce customer confusion caused by fractional amounts. |
| Refund or charge the full amount for some items in a subscription. | Proration | Credit and debit full product price | Use this script when certain products on a subscription aren’t prorated. For example, a flat support fee or a platform access charge that’s always billed in full regardless of when the subscription changes. |
To write your own script, see Author your own scripts.
Before you begin
Before you start working with scripts, be aware of their current limitations and their behavior.
Limitations
Scripts currently have the following limitations:
- You can only run one script for each billing behavior or extension point at a time.
- Scripts only run for subscriptions with flexible billing mode enabled (available for API versions 2025-06-30.basil and later) and pricing plan and license fee subscriptions.
- Scripts don’t currently support invoices that require e-mandates for India recurring payments (invoices with INR for their currency).
- Scripts don’t affect standalone invoices that aren’t associated with a subscription.
- For Checkout Sessions, the logic only runs if mode is set to subscription and billing_mode is set to flexible .
- Scripts can’t be shared to connected accounts through Stripe Connect .
Fallback behavior
If Stripe-authored scripts fail to run for any reason, Stripe reserves the right to default to standard functionality or pause subscription processing.
Versioning
When you first activate a Stripe-authored script on an extension point, you’re automatically placed on the latest available version. As Stripe releases new versions, you can upgrade at your own pace. You can also revert to a previous version if needed.
Switching between script versions takes effect immediately on all future billing operations for that extension point. Invoices and billing events that were already processed under a previous version aren’t retroactively affected. Frequently switching back and forth between versions can introduce inconsistencies in billing behavior across cycles, so we recommend testing new versions thoroughly in a sandbox before going live and minimizing version changes mid-cycle.
