Guide for upgrading Stripe API versions and SDKs
Add this skill
npx mdskills install stripe/upgrade-stripeComprehensive guide covering Stripe API versioning, SDK upgrades, and testing strategies
1---2description: Guide for upgrading Stripe API versions and SDKs3alwaysApply: false4---56The latest Stripe API version is 2026-01-28.clover - use this version when upgrading unless the user specifies a different target version.78# Upgrading Stripe Versions910This guide covers upgrading Stripe API versions, server-side SDKs, Stripe.js, and mobile SDKs.1112## Understanding Stripe API Versioning1314Stripe uses date-based API versions (e.g., `2026-01-28.clover`, `2025-08-27.basil`, `2024-12-18.acacia`). Your account's API version determines request/response behavior.1516### Types of Changes1718**Backward-Compatible Changes** (do not require code updates):19- New API resources20- New optional request parameters21- New properties in existing responses22- Changes to opaque string lengths (e.g., object IDs)23- New webhook event types2425**Breaking Changes** (require code updates):26- Field renames or removals27- Behavioral modifications28- Removed endpoints or parameters2930Review the [API Changelog](https://docs.stripe.com/changelog.md) for all changes between versions.3132## Server-Side SDK Versioning3334See [SDK Version Management](https://docs.stripe.com/sdks/set-version.md) for details.3536### Dynamically-Typed Languages (Ruby, Python, PHP, Node.js)3738These SDKs offer flexible version control:3940**Global Configuration:**41```python42import stripe43stripe.api_version = '2026-01-28.clover'44```4546```ruby47Stripe.api_version = '2026-01-28.clover'48```4950```javascript51const stripe = require('stripe')('sk_test_xxx', {52 apiVersion: '2026-01-28.clover'53});54```5556**Per-Request Override:**57```python58stripe.Customer.create(59 email="customer@example.com",60 stripe_version='2026-01-28.clover'61)62```6364### Strongly-Typed Languages (Java, Go, .NET)6566These use a fixed API version matching the SDK release date. Do not set a different API version for strongly-typed languages because response objects might not match the strong types in the SDK. Instead, update the SDK to target a new API version.6768### Best Practice6970Always specify the API version you're integrating against in your code instead of relying on your account's default API version:7172```javascript73// Good: Explicit version74const stripe = require('stripe')('sk_test_xxx', {75 apiVersion: '2026-01-28.clover'76});7778// Avoid: Relying on account default79const stripe = require('stripe')('sk_test_xxx');80```8182## Stripe.js Versioning8384See [Stripe.js Versioning](https://docs.stripe.com/sdks/stripejs-versioning.md) for details.8586Stripe.js uses an evergreen model with major releases (Acacia, Basil, Clover) on a biannual basis.8788### Loading Versioned Stripe.js8990**Via Script Tag:**91```html92<script src="https://js.stripe.com/clover/stripe.js"></script>93```9495**Via npm:**96```bash97npm install @stripe/stripe-js98```99100Major npm versions correspond to specific Stripe.js versions.101102### API Version Pairing103104Each Stripe.js version automatically pairs with its corresponding API version. For instance:105- Clover Stripe.js uses `2026-01-28.clover` API106- Acacia Stripe.js uses `2024-12-18.acacia` API107108You cannot override this association.109110### Migrating from v31111121. Identify your current API version in code1132. Review the changelog for relevant changes1143. Consider gradually updating your API version before switching Stripe.js versions1154. Stripe continues supporting v3 indefinitely116117## Mobile SDK Versioning118119See [Mobile SDK Versioning](https://docs.stripe.com/sdks/mobile-sdk-versioning.md) for details.120121### iOS and Android SDKs122123Both platforms follow **semantic versioning** (MAJOR.MINOR.PATCH):124- **MAJOR**: Breaking API changes125- **MINOR**: New functionality (backward-compatible)126- **PATCH**: Bug fixes (backward-compatible)127128New features and fixes release only on the latest major version. Upgrade regularly to access improvements.129130### React Native SDK131132Uses a different model (0.x.y schema):133- **Minor version changes** (x): Breaking changes AND new features134- **Patch updates** (y): Critical bug fixes only135136### Backend Compatibility137138All mobile SDKs work with any Stripe API version you use on your backend unless documentation specifies otherwise.139140## Upgrade Checklist1411421. Review the [API Changelog](https://docs.stripe.com/changelog.md) for changes between your current and target versions1432. Check [Upgrades Guide](https://docs.stripe.com/upgrades.md) for migration guidance1443. Update server-side SDK package version (e.g., `npm update stripe`, `pip install --upgrade stripe`)1454. Update the `apiVersion` parameter in your Stripe client initialization1465. Test your integration against the new API version using the `Stripe-Version` header1476. Update webhook handlers to handle new event structures1487. Update Stripe.js script tag or npm package version if needed1498. Update mobile SDK versions in your package manager if needed1509. Store Stripe object IDs in databases that accommodate up to 255 characters (case-sensitive collation)151152## Testing API Version Changes153154Use the `Stripe-Version` header to test your code against a new version without changing your default:155156```bash157curl https://api.stripe.com/v1/customers \158 -u sk_test_xxx: \159 -H "Stripe-Version: 2026-01-28.clover"160```161162Or in code:163164```javascript165const stripe = require('stripe')('sk_test_xxx', {166 apiVersion: '2026-01-28.clover' // Test with new version167});168```169170## Important Notes171172- Your webhook listener should handle unfamiliar event types gracefully173- Test webhooks with the new version structure before upgrading174- Breaking changes are tagged by affected product areas (Payments, Billing, Connect, etc.)175- Multiple API versions coexist simultaneously, enabling staged adoption176177
Full transparency — inspect the skill content before installing.