Stripe | Financial Infrastructure to Grow Your Revenue

Stripe | Financial Infrastructure to Grow Your Revenue

4466 articles

Adds support for script coupons


Public preview

Adds support for script coupons Public preview

What’s new

You can now customize business logic on Stripe using scripts. With scripts, you can define custom logic expressed as code that runs on our infrastructure, extending Stripe’s core functionality. Use scripts to customize business login on Stripe logic using Stripe’s Coupon object. Currently, you can only associate a script with this specific type of object.

Custom discounting logic

To support the customization of discounting logic with scripts, we added a new script parameter on the Coupon create method. With this new parameter, you can configure a Coupon to use the custom discounting logic.

The script parameter has two required nested parameters: id and configuration. id is the script ID and configuration is any input parameter to the script.

The following example illustrates how to set up a coupon that gives the buyer 20% off up to 100 USD:

Command Line

Select a language

cURL

Stripe CLI

Ruby

Python

PHP

Java

Node.js

Go

.NET

No results

Changes

ParameterChangeResources or endpoints
scriptAddedCoupon#create Coupon

Upgrade

  1. View your current API version in Workbench.
  2. If you use an SDK, upgrade to the corresponding SDK version for this API version.
  • If you don’t use an SDK, update your API requests to include Stripe-Version: 2025-04-30. preview
  1. Upgrade the API version used for webhook endpoints .
  2. Test your integration against the new version.
  3. If you use Connect, test your Connect integration .
  4. In Workbench, perform the upgrade . You can roll back the version for 72 hours.

Learn more about Stripe API upgrades.

Last verified 2026-09-24

Is this helpful?