# Adds custom coupon support to preview SDKs

## What’s new

Adds the [custom](https://docs.stripe.com/api/coupons/create.md?api-version=2026-11-18.preview#create_coupon-custom) parameter and the `custom` value for the [type](https://docs.stripe.com/api/coupons/create.md?api-version=2026-11-18.preview#create_coupon-type) parameter to the [Coupon](https://docs.stripe.com/api/coupons/object.md?api-version=2026-11-18.preview) resource in preview SDKs. Custom coupons use extensions to dynamically calculate discounts at billing time. You can use [Stripe-authored scripts](https://docs.stripe.com/billing/scripts/stripe-authored/discount-calculation.md) or [author your own scripts](https://docs.stripe.com/billing/scripts/discount-calculation.md) to define the discount calculation. To create a custom coupon, pass `type: "custom"` along with a `custom` object containing an extension reference and optional configuration when you [create a Coupon](https://docs.stripe.com/api/coupons/create.md?api-version=2026-11-18.preview). The Coupon response object includes a corresponding `custom` property with the extension ID, version, and configuration.

This change is available in [public preview](https://docs.stripe.com/release-phases.md). The GA API isn’t affected.

## Impact

If you use preview SDKs and want to create extension-backed coupons, you can now access the `custom` and `type` parameters directly in the SDK without additional configuration. Follow the guides to [use Stripe-authored scripts](https://docs.stripe.com/billing/scripts/stripe-authored/discount-calculation.md) or [author your own scripts](https://docs.stripe.com/billing/scripts/discount-calculation.md).

## Changes

#### REST API

| Parameters | Change | Resources or endpoints |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [Coupon#create](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

| Value | Change | Enum |
| --- | --- | --- |
| `custom` | Added | [Coupon.type](/api/coupons/object?api-version=2026-11-18.preview#coupon_object-type) |

#### Ruby

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [CouponCreateParams](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

#### Python

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [CouponCreateParams](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

| Value | Change | Enum |
| --- | --- | --- |
| `custom` | Added | [Coupon.type](/api/coupons/object?api-version=2026-11-18.preview#coupon_object-type) |

#### PHP

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [Coupon.create().$params](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

| Value | Change | Enum |
| --- | --- | --- |
| `custom` | Added | [Coupon.type](/api/coupons/object?api-version=2026-11-18.preview#coupon_object-type) |

#### Java

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [CouponCreateParams](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

#### Node.js

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `custom`, `type` | Added | [CouponCreateParams](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

| Value | Change | Enum |
| --- | --- | --- |
| `custom` | Added | [Coupon.type](/api/coupons/object?api-version=2026-11-18.preview#coupon_object-type) |

#### Go

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `Custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `Custom`, `Type` | Added | [CouponParams](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

| Value | Change | Enum |
| --- | --- | --- |
| `custom` | Added | [Coupon.Type](/api/coupons/object?api-version=2026-11-18.preview#coupon_object-type) |

#### .NET

| Parameters | Change | Resources or methods |
| --- | --- | --- |
| `Custom` | Added | [Coupon](/api/coupons/object?api-version=2026-11-18.preview#coupon_object) |
| `Custom`, `Type` | Added | [CouponCreateOptions](/api/coupons/create?api-version=2026-11-18.preview#create_coupon) |

## Upgrade

#### REST API

1. [View your current API version](https://docs.stripe.com/workbench/guides.md#view-api-versions) 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](https://docs.stripe.com/api-versions.md#how-versions-are-specified-in-requests) to include `Stripe-Version: 2026-11-18.preview`
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### Ruby

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your Ruby SDK to [v21.2.0-beta.1](https://github.com/stripe/stripe-ruby/releases/tag/v21.2.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### Python

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your Python SDK to [v17.2.0b1](https://github.com/stripe/stripe-python/releases/tag/v17.2.0b1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### PHP

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your PHP SDK to [v23.2.0-beta.1](https://github.com/stripe/stripe-php/releases/tag/v23.2.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### Java

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your Java SDK to [v34.3.0-beta.1](https://github.com/stripe/stripe-java/releases/tag/v34.3.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### Node.js

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your Node SDK to [v23.3.0-beta.1](https://github.com/stripe/stripe-node/releases/tag/v23.3.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### Go

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your Go SDK to [v87.3.0-beta.1](https://github.com/stripe/stripe-go/releases/tag/v87.3.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

#### .NET

1. [View your current API version](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench) in Workbench.
2. Upgrade your .NET SDK to [v53.3.0-beta.1](https://github.com/stripe/stripe-dotnet/releases/tag/v53.3.0-beta.1)
3. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
4. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
5. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
6. In Workbench, [perform the upgrade](https://docs.stripe.com/upgrades.md#perform-the-upgrade). You can [roll back the version](https://docs.stripe.com/upgrades.md#roll-back-your-api-version) for 72 hours.

Learn more about [Stripe API upgrades](https://docs.stripe.com/upgrades.md).

## Related changes

- [Adds support for manually applying a customer balance to an open invoice](https://docs.stripe.com/changelog/endive/2026-11-18/manually-apply-customer-balance-to-open-invoices.md)
