The Agent Skills Directory
npx skills add https://docs.stripe.com最新的 Stripe API 版本是 2026-02-25.clover - 除非用户指定了不同的目标版本,否则在升级时请使用此版本。
本指南涵盖升级 Stripe API 版本、服务器端 SDK、Stripe.js 和移动端 SDK。
Stripe 使用基于日期的 API 版本(例如,2026-02-25.clover、2025-08-27.basil、2024-12-18.acacia)。您账户的 API 版本决定了请求/响应的行为。
向后兼容的变更(无需代码更新):
破坏性变更(需要代码更新):
请查看 API 更新日志 以了解版本间的所有变更。
详情请参阅 SDK 版本管理。
这些 SDK 提供灵活的版本控制:
全局配置:
import stripe
stripe.api_version = '2026-02-25.clover'
Stripe.api_version = '2026-02-25.clover'
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover'
});
按请求覆盖:
stripe.Customer.create(
email="customer@example.com",
stripe_version='2026-02-25.clover'
)
这些语言使用与 SDK 发布日期匹配的固定 API 版本。不要为强类型语言设置不同的 API 版本,因为响应对象可能与 SDK 中的强类型不匹配。相反,应更新 SDK 以定位新的 API 版本。
始终在代码中指定您要集成的 API 版本,而不是依赖您账户的默认 API 版本:
// 推荐:显式指定版本
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover'
});
// 避免:依赖账户默认值
const stripe = require('stripe')('sk_test_xxx');
详情请参阅 Stripe.js 版本控制。
Stripe.js 采用常青模型,每半年发布一次主要版本(Acacia, Basil, Clover)。
通过 Script 标签:
<script src="https://js.stripe.com/clover/stripe.js"></script>
通过 npm:
npm install @stripe/stripe-js
主要的 npm 版本对应特定的 Stripe.js 版本。
每个 Stripe.js 版本会自动与其对应的 API 版本配对。例如:
2026-02-25.clover API2024-12-18.acacia API您无法覆盖此关联。
详情请参阅 移动端 SDK 版本控制。
两个平台都遵循语义化版本控制 (MAJOR.MINOR.PATCH):
新功能和修复仅发布在最新的主要版本上。请定期升级以获取改进。
使用不同的模型(0.x.y 模式):
除非文档另有说明,否则所有移动端 SDK 都可以与您在后端使用的任何 Stripe API 版本配合工作。
npm update stripe、pip install --upgrade stripe)apiVersion 参数Stripe-Version 头信息测试您的集成与新 API 版本的兼容性使用 Stripe-Version 头信息来测试您的代码与新版本的兼容性,而无需更改默认版本:
curl https://api.stripe.com/v1/customers \
-u sk_test_xxx: \
-H "Stripe-Version: 2026-02-25.clover"
或在代码中:
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover' // 使用新版本测试
});
每周安装次数
381
来源
首次出现
2 天前
安装在
opencode381
claude-code381
github-copilot381
amp381
cline381
codex381
The latest Stripe API version is 2026-02-25.clover - use this version when upgrading unless the user specifies a different target version.
This guide covers upgrading Stripe API versions, server-side SDKs, Stripe.js, and mobile SDKs.
Stripe uses date-based API versions (e.g., 2026-02-25.clover, 2025-08-27.basil, 2024-12-18.acacia). Your account’s API version determines request/response behavior.
Backward-Compatible Changes (don’t require code updates):
Breaking Changes (require code updates):
Review the API Changelog for all changes between versions.
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
See SDK Version Management for details.
These SDKs offer flexible version control:
Global Configuration:
import stripe
stripe.api_version = '2026-02-25.clover'
Stripe.api_version = '2026-02-25.clover'
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover'
});
Per-Request Override:
stripe.Customer.create(
email="customer@example.com",
stripe_version='2026-02-25.clover'
)
These use a fixed API version matching the SDK release date. Don’t 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.
Always specify the API version you’re integrating against in your code instead of relying on your account’s default API version:
// Good: Explicit version
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover'
});
// Avoid: Relying on account default
const stripe = require('stripe')('sk_test_xxx');
See Stripe.js Versioning for details.
Stripe.js uses an evergreen model with major releases (Acacia, Basil, Clover) on a biannual basis.
Via Script Tag:
<script src="https://js.stripe.com/clover/stripe.js"></script>
Via npm:
npm install @stripe/stripe-js
Major npm versions correspond to specific Stripe.js versions.
Each Stripe.js version automatically pairs with its corresponding API version. For instance:
2026-02-25.clover API2024-12-18.acacia APIYou can’t override this association.
See Mobile SDK Versioning for details.
Both platforms follow semantic versioning (MAJOR.MINOR.PATCH):
New features and fixes release only on the latest major version. Upgrade regularly to access improvements.
Uses a different model (0.x.y schema):
All mobile SDKs work with any Stripe API version you use on your backend unless documentation specifies otherwise.
npm update stripe, pip install --upgrade stripe)apiVersion parameter in your Stripe client initializationStripe-Version headerUse the Stripe-Version header to test your code against a new version without changing your default:
curl https://api.stripe.com/v1/customers \
-u sk_test_xxx: \
-H "Stripe-Version: 2026-02-25.clover"
Or in code:
const stripe = require('stripe')('sk_test_xxx', {
apiVersion: '2026-02-25.clover' // Test with new version
});
Weekly Installs
381
Source
First Seen
2 days ago
Installed on
opencode381
claude-code381
github-copilot381
amp381
cline381
codex381
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
140,500 周安装