Skip to content
Create account
or
Sign in
The Stripe Docs logo
/
Ask AI
Create account
Sign in
Get started
Payments
Revenue
Platforms and marketplaces
Money management
Developer resources
Overview
Versioning
Changelog
    Overview
    Basil
    Acacia
    Previous versions
Upgrade your API version
Upgrade your SDK version
Essentials
SDKs
API
Testing
Stripe CLI
Sample projects
Tools
Workbench
Developers Dashboard
Stripe Shell
Stripe for Visual Studio Code
Features
Workflows
Event destinations
Stripe health alertsFile uploads
AI solutions
Agent toolkit
Model Context Protocol
Security and privacy
Security
Stripebot web crawler
Privacy
Extend Stripe
Build Stripe apps
Use apps from Stripe
Partners
Partner ecosystem
Partner certification
HomeDeveloper resourcesChangelogBasil2025-04-30.preview

Adds support for script couponsPublic 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
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
Go
.NET
No results
curl https://api.stripe.com/v1/coupons \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d duration=once \ -d name="My coupon" \ -d "script[id]"=bfsimpl_61S9T2y7zlKu9YlG116S8pZoN2SQpuwOX348dhXM0R9c \ -d "script[configuration][max_discount_amount][amount]"=10000 \ -d "script[configuration][max_discount_amount][currency]"=usd \ -d "script[configuration][discount_percent]"=20

To learn more, see Extend Stripe Billing with custom discount logic.

Changes

ParameterChangeResources or endpoints
scriptAdded
Coupon#createCoupon

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
  3. Upgrade the API version used for webhook endpoints.
  4. Test your integration against the new version.
  5. If you use Connect, test your Connect integration.
  6. In Workbench, perform the upgrade. You can roll back the version for 72 hours.

Learn more about Stripe API upgrades.

Was this page helpful?
YesNo
  • Need help? Contact Support.
  • Join our early access program.
  • Check out our changelog.
  • Questions? Contact Sales.
  • LLM? Read llms.txt.
  • Powered by Markdoc