• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdevelopment

upgrade-stripe

プラグイン
stripe
ソース
GitHub で見る ↗
説明

Stripe API バージョンと SDK のアップグレード ガイド このガイドは、Stripe API(決済サービス用のプログラムインターフェース)のバージョンを新しくする際の手順や注意点をまとめたものです。また、SDK(アプリケーション開発に必要なツール群)のアップグレード方法についても説明します。 使用する際に参考になる情報として、以下が含まれています: - 現在のバージョンから新バージョンへ移行する手順 - アップグレード前に確認すべき互換性(新旧のシステムが問題なく連携すること) - 予期しない動作を防ぐための実装方法 - トラブルシューティング(問題が生じた際の解決方法)とよくある質問 このガイドを参照することで、安全かつ効率的に Stripe サービスの最新版へ移行できます。

原文を表示

Guide for upgrading Stripe API versions and SDKs

ユースケース
  • Stripe APIを新バージョンへ移行する
  • SDK をアップグレードする
  • アップグレード前に互換性を確認する
  • アップグレード時の問題をトラブルシューティングする
本文(日本語訳)

Stripeバージョンのアップグレード

このガイドでは、Stripe API(決済APIの仕様)のバージョン、サーバー側SDK(開発ツール一式)、Stripe.js、モバイルSDKのアップグレードについて説明します。

ターゲットAPIバージョンを選択する

ユーザーがターゲットAPIバージョンを指定した場合はそれを使用します。そうでない場合は、docs.stripe.comでStripe CLIのstripe docs /api/versioningなどのツールを使って現在のバージョンを調べます。APIバージョニングページの「The current version is」で始まる文に記載されています。

バンドル版フォールバックAPIバージョン:2026-08-26.dahlia。この値はこのスキルが最後に生成された2026年9月22日時点のスナップショット(固定点の情報)です。バージョン識別子は YYYY-MM-DD 形式のリリース日で始まり、安定版は毎月リリースされるため、1ヶ月以上前の日付のフォールバックバージョンは古い可能性があります。docs.stripe.comに到達できない場合にのみ使用してください。新しいバージョン番号を推測しないでください。

変更を加える前に、統合が指定するAPIバージョンと比較してください:クライアント設定、リクエスト単位でのオーバーライド、ウェブフック(イベント通知)エンドポイント。ユーザーが明示的に要求しない限り、ピンを古いバージョンに移さず、安定版ピンをプレビュー版に移さないでください。ピンがすでにターゲットと一致する場合は、変更なしとして報告します。選択したターゲットとその情報源を明記してください。ライブ検証に失敗した場合または利用できない場合は、最新バージョンが未検証のままであることを述べ、統合が最新バージョンであると主張しないでください。

明示的なAPIバージョンオーバーライドをサポートするSDKについては、クライアント設定とリクエスト単位のオーバーライドで選択したターゲットを使用します。curlのStripe-Versionテストヘッダーでも使用してください。これらの例に示されているバンドル版APIバージョンをコピーまたは実行する前に、選択したターゲットに置き換えてください。Java、Go、.NETについては、SDKの固定バージョンをオーバーライドするのではなく、選択したAPIバージョンをターゲットとするSDKリリースを選択します。プレビュー版ターゲットには、すべての言語で対応するbetaSDKリリースが必要です。SDKバージョニングを参照してください。

Stripe APIバージョニングの理解

Stripeは日付ベースのAPIバージョン(例:2026-08-26.dahlia、2025-08-27.basil、2024-12-18.acacia)を使用します。アカウントのAPIバージョンはリクエスト/レスポンスの動作を決定します。

変更のタイプ

後方互換性のある変更(コード更新は不要):

  • 新しいAPIリソース
  • 新しいオプションのリクエストパラメータ
  • 既存レスポンスの新しいプロパティ
  • 不透明な文字列長の変更(例:オブジェクトID)
  • 新しいウェブフックイベントタイプ

重大な変更(コード更新が必要):

  • フィールド名の変更または削除
  • 動作の変更
  • エンドポイントまたはパラメータの削除

バージョン間のすべての変更はAPIチェンジログを確認してください。

サーバー側SDKバージョニング

詳細はSDK バージョン管理を参照してください。

動的型付け言語(Ruby、Python、PHP、Node.js)

これらのSDKは柔軟なバージョン管理を提供します。

グローバル設定:

import stripe
stripe.api_version = '2026-08-26.dahlia'
Stripe.api_version = '2026-08-26.dahlia'
const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-08-26.dahlia'
});

リクエスト単位でのオーバーライド:

stripe.Customer.create(
  email="customer@example.com",
  stripe_version='2026-08-26.dahlia'
)

静的型付け言語(Java、Go、.NET)

これらはSDKリリース日に一致する固定APIバージョンを使用します。静的型付け言語のAPIバージョンを異なるものに設定しないでください。レスポンスオブジェクトがSDK内の静的型と一致しない可能性があるためです。代わりに、新しいAPIバージョンをターゲットとするようにSDKを更新してください。

ベストプラクティス

アカウントのデフォルトAPIバージョンに頼らず、統合しているAPIバージョンを常にコードに明示的に指定してください:

// 良い例:明示的なバージョン指定
const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-08-26.dahlia'
});

// 避けるべき例:アカウントのデフォルトに依存
const stripe = require('stripe')('sk_test_xxx');

Stripe.jsバージョニング

詳細はStripe.js バージョニングを参照してください。

Stripe.jsは常に最新の状態に自動更新されるモデルを使用し、主要リリース(Acacia、Basil、Clover、Dahlia)は2年ごとに行われます。

バージョン指定したStripe.jsの読み込み

スクリプトタグ経由:

<script src="https://js.stripe.com/dahlia/stripe.js"></script>

npm経由:

npm install @stripe/stripe-js

npmの主要バージョンは特定のStripe.jsバージョンに対応しています。

APIバージョンとのペアリング

各Stripe.jsバージョンは対応するAPIバージョンと自動的にペアリングされます。例えば:

  • Dahlia Stripe.jsは2026-08-26.dahlia APIを使用
  • Acacia Stripe.jsは2024-12-18.acacia APIを使用

この関連付けをオーバーライドすることはできません。

v3からの移行

  1. コードで現在のAPIバージョンを確認する
  2. チェンジログで関連する変更を確認する
  3. Stripe.jsバージョンを切り替える前にAPIバージョンを段階的に更新することを検討する
  4. Stripeはv3を無期限にサポート継続する

モバイルSDKバージョニング

詳細はモバイルSDKバージョニングを参照してください。

iOSおよびAndroid SDK

両プラットフォームはセマンティックバージョニング(MAJOR.MINOR.PATCH)に従います:

  • MAJOR:APIの重大変更
  • MINOR:新機能(後方互換性あり)
  • PATCH:バグ修正(後方互換性あり)

新機能と修正は最新メジャーバージョンのみでリリースされます。改善にアクセスするには定期的にアップグレードしてください。

React Native SDK

異なるモデル(0.x.yスキーマ)を使用します:

  • マイナーバージョン変更(x):重大な変更と新機能の両方
  • パッチ更新(y):重要なバグ修正のみ

バックエンド互換性

すべてのモバイルSDKはバックエンドで使用するすべてのStripe APIバージョンで動作します。ドキュメントで特に指定されている場合を除きます。

アップグレードチェックリスト

  1. APIチェンジログで現在のバージョンからターゲットバージョンまでの変更を確認する
  2. アップグレードガイドで移行ガイダンスを確認する
  3. サーバー側SDKパッケージバージョンを更新する(例:npm update stripe、pip install --upgrade stripe)
  4. Stripeクライアント初期化でapiVersionパラメータを更新する
  5. Stripe-Versionヘッダーを使用して統合を新しいAPIバージョンに対してテストする
  6. ウェブフックハンドラーを更新して新しいイベント構造に対応する
  7. 必要に応じてStripe.jsスクリプトタグまたはnpmパッケージバージョンを更新する
  8. 必要に応じてモバイルSDKバージョンをパッケージマネージャーで更新する
  9. StripeオブジェクトIDをデータベースに保存する際、大文字小文字を区別する照合で最大255文字に対応させる

APIバージョン変更のテスト

デフォルトを変更せずに新しいバージョンに対してコードをテストするには、Stripe-Versionヘッダーを使用します:

curl https://api.stripe.com/v1/customers \
  -u sk_test_xxx: \
  -H "Stripe-Version: 2026-08-26.dahlia"

またはコード内:

const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-08-26.dahlia'  // 新しいバージョンでテスト
});

重要な注記

  • ウェブフックリスナーは不明なイベントタイプを適切に処理する必要があります
  • アップグレード前に新しいバージョン構造でウェブフックをテストしてください
  • 重大な変更は影響を受ける製品分野別(決済、請求書、Connect等)にタグ付けされます
  • 複数のAPIバージョンが同時に存在し、段階的な導入を可能にします
原文(English)を表示

Upgrading Stripe Versions

This guide covers upgrading Stripe API versions, server-side SDKs, Stripe.js, and mobile SDKs.

Choose a target API version

If the user specifies a target API version, use it. Otherwise, look up the current version on docs.stripe.com with any documentation or web tool available to you, for example stripe docs /api/versioning with the Stripe CLI. The API versioning page states it in the sentence that begins “The current version is”.

Bundled fallback API version: 2026-08-26.dahlia. This value is only a snapshot from the last time this skill was generated, on 2026-09-22. Version identifiers start with their release date in YYYY-MM-DD format and new stable versions are released monthly, so a fallback version dated more than a month ago is probably stale. Use it only when you can’t reach docs.stripe.com. Never guess about a newer version number.

Before making changes, compare the target with each API version the integration pins: client configuration, per-request overrides, and webhook endpoints. Unless the user explicitly asks for it, don’t move any pin to an older version or a stable pin to a preview version. If a pin already matches the target, report it as unchanged. State the selected target and its source. If live verification fails or is unavailable, say that the latest version remains unverified, and don’t claim the integration is on the latest version.

For SDKs that support explicit API version overrides, use the selected target in client configuration and per-request overrides. Use it in curl Stripe-Version test headers, too. Replace bundled API versions shown in those examples with the selected target before copying or running them. For Java, Go, and .NET, select an SDK release that targets the selected API version instead of overriding the SDK’s fixed version. Preview targets need the matching beta SDK release in every language; see SDK versioning.

Understanding Stripe API Versioning

Stripe uses date-based API versions (e.g., 2026-08-26.dahlia, 2025-08-27.basil, 2024-12-18.acacia). Your account’s API version determines request/response behavior.

Types of Changes

Backward-Compatible Changes (don’t require code updates):

  • New API resources
  • New optional request parameters
  • New properties in existing responses
  • Changes to opaque string lengths (e.g., object IDs)
  • New webhook event types

Breaking Changes (require code updates):

  • Field renames or removals
  • Behavioral modifications
  • Removed endpoints or parameters

Review the API Changelog for all changes between versions.

Server-Side SDK Versioning

See SDK Version Management for details.

Dynamically-Typed Languages (Ruby, Python, PHP, Node.js)

These SDKs offer flexible version control:

Global Configuration:

import stripe
stripe.api_version = '2026-08-26.dahlia'
Stripe.api_version = '2026-08-26.dahlia'
const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-08-26.dahlia'
});

Per-Request Override:

stripe.Customer.create(
  email="customer@example.com",
  stripe_version='2026-08-26.dahlia'
)

Strongly-Typed Languages (Java, Go, .NET)

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.

Best Practice

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-08-26.dahlia'
});

// Avoid: Relying on account default
const stripe = require('stripe')('sk_test_xxx');

Stripe.js Versioning

See Stripe.js Versioning for details.

Stripe.js uses an evergreen model with major releases (Acacia, Basil, Clover, Dahlia) on a biannual basis.

Loading Versioned Stripe.js

Via Script Tag:

<script src="https://js.stripe.com/dahlia/stripe.js"></script>

Via npm:

npm install @stripe/stripe-js

Major npm versions correspond to specific Stripe.js versions.

API Version Pairing

Each Stripe.js version automatically pairs with its corresponding API version. For instance:

  • Dahlia Stripe.js uses 2026-08-26.dahlia API
  • Acacia Stripe.js uses 2024-12-18.acacia API

You can’t override this association.

Migrating from v3

  1. Identify your current API version in code
  2. Review the changelog for relevant changes
  3. Consider gradually updating your API version before switching Stripe.js versions
  4. Stripe continues supporting v3 indefinitely

Mobile SDK Versioning

See Mobile SDK Versioning for details.

iOS and Android SDKs

Both platforms follow semantic versioning (MAJOR.MINOR.PATCH):

  • MAJOR: Breaking API changes
  • MINOR: New functionality (backward-compatible)
  • PATCH: Bug fixes (backward-compatible)

New features and fixes release only on the latest major version. Upgrade regularly to access improvements.

React Native SDK

Uses a different model (0.x.y schema):

  • Minor version changes (x): Breaking changes AND new features
  • Patch updates (y): Critical bug fixes only

Backend Compatibility

All mobile SDKs work with any Stripe API version you use on your backend unless documentation specifies otherwise.

Upgrade Checklist

  1. Review the API Changelog for changes between your current and target versions
  2. Check Upgrades Guide for migration guidance
  3. Update server-side SDK package version (e.g., npm update stripe, pip install --upgrade stripe)
  4. Update the apiVersion parameter in your Stripe client initialization
  5. Test your integration against the new API version using the Stripe-Version header
  6. Update webhook handlers to handle new event structures
  7. Update Stripe.js script tag or npm package version if needed
  8. Update mobile SDK versions in your package manager if needed
  9. Store Stripe object IDs in databases that accommodate up to 255 characters (case-sensitive collation)

Testing API Version Changes

Use 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-08-26.dahlia"

Or in code:

const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-08-26.dahlia'  // Test with new version
});

Important Notes

  • Your webhook listener should handle unfamiliar event types gracefully
  • Test webhooks with the new version structure before upgrading
  • Breaking changes are tagged by affected product areas (Payments, Billing, Connect, etc.)
  • Multiple API versions coexist simultaneously, enabling staged adoption

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。