# Introduces new customer balance transaction types

## What’s new

We’re introducing two new customer balance transaction types:  `checkout_session_subscription_payment` and `checkout_session_subscription_payment_canceled`, and a new field `checkout_session` to the customer balance transaction.

## Impact

This change impacts users who use Checkout:

- When completing checkout, transactions made to the customer balance are marked as the `checkout_session_subscription_payment` type and `checkout_session` is populated by the corresponding session ID.
- If the session expires, this reverses the customer balance transaction and marks the reverse transaction as the `checkout_session_subscription_payment_canceled` type and `checkout_session` is populated by the corresponding session ID.

## Changes

#### REST API

| Parameter          | Change | Resources or endpoints       |
| ------------------ | ------ | ---------------------------- |
| `checkout_session` | Added  | `CustomerBalanceTransaction` |

| Values                                                                                    | Change | Enum                         |
| ----------------------------------------------------------------------------------------- | ------ | ---------------------------- |
| `checkout_session_subscription_payment_canceled`, `checkout_session_subscription_payment` | Added  | `CustomerBalanceTransaction` |

#### Ruby

This change does not affect the Ruby SDK.

#### Python

| Parameter          | Change | Resources or methods         |
| ------------------ | ------ | ---------------------------- |
| `checkout_session` | Added  | `CustomerBalanceTransaction` |

| Values                                                                                    | Change | Enum                         |
| ----------------------------------------------------------------------------------------- | ------ | ---------------------------- |
| `checkout_session_subscription_payment_canceled`, `checkout_session_subscription_payment` | Added  | `CustomerBalanceTransaction` |

#### PHP

| Parameter          | Change | Resources or methods         |
| ------------------ | ------ | ---------------------------- |
| `checkout_session` | Added  | `CustomerBalanceTransaction` |

| Values                                                                                    | Change | Enum                         |
| ----------------------------------------------------------------------------------------- | ------ | ---------------------------- |
| `checkout_session_subscription_payment_canceled`, `checkout_session_subscription_payment` | Added  | `CustomerBalanceTransaction` |

#### Java

| Parameter         | Change | Resources or methods         |
| ----------------- | ------ | ---------------------------- |
| `checkoutSession` | Added  | `CustomerBalanceTransaction` |

#### Node.js

| Parameter          | Change | Resources or methods         |
| ------------------ | ------ | ---------------------------- |
| `checkout_session` | Added  | `CustomerBalanceTransaction` |

| Values                                                                                    | Change | Enum                         |
| ----------------------------------------------------------------------------------------- | ------ | ---------------------------- |
| `checkout_session_subscription_payment_canceled`, `checkout_session_subscription_payment` | Added  | `CustomerBalanceTransaction` |

#### Go

| Parameter         | Change | Resources or methods         |
| ----------------- | ------ | ---------------------------- |
| `CheckoutSession` | Added  | `CustomerBalanceTransaction` |

| Values                                                                                    | Change | Enum                         |
| ----------------------------------------------------------------------------------------- | ------ | ---------------------------- |
| `checkout_session_subscription_payment_canceled`, `checkout_session_subscription_payment` | Added  | `CustomerBalanceTransaction` |

#### .NET

| Parameter         | Change | Resources or methods         |
| ----------------- | ------ | ---------------------------- |
| `CheckoutSession` | Added  | `CustomerBalanceTransaction` |

## Upgrade

#### REST API

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.
1. 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/versioning.md) to include `Stripe-Version: 2025-03-31.basil`
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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).

#### 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.
1. Upgrade your Ruby SDK to [v15.0.0](https://github.com/stripe/stripe-ruby/releases/tag/v15.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your Python SDK to [v12.0.0](https://github.com/stripe/stripe-python/releases/tag/v12.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your PHP SDK to [v17.0.0](https://github.com/stripe/stripe-php/releases/tag/v17.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your Java SDK to [v29.0.0](https://github.com/stripe/stripe-java/releases/tag/v29.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your Node SDK to [v18.0.0](https://github.com/stripe/stripe-node/releases/tag/v18.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your Go SDK to [v82.0.0](https://github.com/stripe/stripe-go/releases/tag/v82.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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.
1. Upgrade your .NET SDK to [v48.0.0](https://github.com/stripe/stripe-dotnet/releases/tag/v48.0.0)
1. Upgrade the API version used for [webhook endpoints](https://docs.stripe.com/webhooks/versioning.md).
1. [Test your integration](https://docs.stripe.com/testing.md) against the new version.
1. If you use Connect, [test your Connect integration](https://docs.stripe.com/connect/testing.md).
1. 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).
