调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
销售收入
平台和交易市场
资金管理
Developer resources
概览
版本管理
更改日志
升级您的 API 版本
升级 SDK 版本
    版本控制和支持政策
    设置 API 版本
    Stripe.js 版本控制
工具
SDK
API
测试
Workbench
事件接收端
工作流程
Stripe CLI
Stripe Shell
开发人员管理平台
代理工具包
使用大语言模型构建Stripe for Visual Studio CodeStripe 健康警报文件上传
安全与隐私
安全
隐私
扩展 Stripe
Stripe 应用程序
Stripe Connector
合作伙伴
合作伙伴生态
合作伙伴认证
首页Developer resourcesUpgrade your SDK version

Set a Stripe API version

Follow these guidelines to make sure that API versions match throughout your Stripe integration.

Your account has a default API version, which defines how you call the API, what functionality you have access to and what you’re guaranteed to get back as part of the response. Webhook event objects are based on your default API version, which might be different from the API version used by the SDK. To make sure these versions match, we recommend registering a webhook endpoint with the same API version used as the SDK. To find your version, see View the API versions used by API requests.

Versioning basics

Choose your SDK language to get started. If you’re using curl or Stripe CLI instead of an SDK, refer to our versioning page.

Setting the API version

The stripe-ruby library allows you to set the API version globally or on a per-request basis. If you don’t set an API version, recent versions of stripe-ruby use the API version that was latest at the time your version of stripe-ruby was released. Versions of stripe-ruby before v9 use your account’s default API version.

To set the API version globally with the SDK, assign the version to the Stripe.api_version property:

require 'stripe' Stripe.api_key =
sk_test_BQokikJOvBiI2HlWgH4olfQ2
Stripe.api_version = '2025-05-28.basil'

Or set the version per-request:

require 'stripe' intent = Stripe::PaymentIntent.retrieve( 'pi_1DlIVK2eZvKYlo2CW4yj5l2C', { stripe_version: '2025-05-28.basil', } ) intent.capture

注意

When you override the version globally or per-request, the API response objects are also returned in that version.

Upgrading your API version

Before upgrading your API version, carefully review the following resources:

  • Stripe API changelog
  • View the API versions used by API requests

You can upgrade your account’s default API version in Workbench. Update your code to use the latest version of the Ruby SDK and set the new API version when making your calls.

另见

Stripe SDKs follow their own versioning policy. See the link below to learn more.

  • Stripe versioning and support policies
此页面的内容有帮助吗?
是否
需要帮助?联系支持。
加入我们的早期使用计划。
查看我们的更改日志。
有问题?联系销售。
LLM? Read llms.txt.
Powered by Markdoc