• 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 APIバージョンのアップグレード

最新のStripe APIバージョンは 2026-07-29.dahlia です。ユーザーが別のバージョンを指定しない限り、アップグレード時はこのバージョンを使用してください。

このガイドは、Stripe APIバージョン、サーバー側SDK(ソフトウェア開発キット)、Stripe.js、およびモバイルSDKのアップグレード方法を説明します。

Stripe APIバージョンの仕組みについて

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

変更の種類

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

  • 新しいAPIリソースの追加
  • 新しいオプションのリクエストパラメータ
  • 既存レスポンスへの新しい情報の追加
  • 不透明な文字列の長さの変更(例:オブジェクトID)
  • 新しいウェブフック(自動通知)イベントタイプ

互換性を破る変更(コードの更新が必要):

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

バージョン間のすべての変更については、「APIの変更履歴」をご確認ください。

サーバー側SDKのバージョン管理

型指定が自由な言語(Ruby、Python、PHP、Node.js)

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

グローバル設定:

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

リクエストごとのオーバーライド:

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

型指定の厳密な言語(Java、Go、.NET)

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

ベストプラクティス

アカウントのデフォルトAPIバージョンに頼るのではなく、コード内で統合対象のAPIバージョンを明確に指定してください:

// 推奨: バージョンを明示的に指定
const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-07-29.dahlia'
});

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

Stripe.jsのバージョン管理

Stripe.jsは常に最新に保つモデルを採用し、6ヶ月ごとにメジャーリリース(Acacia、Basil、Clover、Dahlia)を行っています。

バージョン付き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-07-29.dahlia APIを使用
  • Acacia Stripe.jsは 2024-12-18.acacia APIを使用

この組み合わせは変更できません。

v3からの移行

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

モバイル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-07-29.dahlia"

またはコード内で:

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

重要な注記

  • ウェブフックリスナーは不明なイベントタイプを適切に処理すべき
  • アップグレード前に、新しいバージョン構造でウェブフックをテスト
  • 互換性を破く変更は、影響を受ける製品領域(決済、課金、Connect など)でタグ付けされ
  • 複数のAPIバージョンが同時に存在するため、段階的な導入が可能
原文(English)を表示

The latest Stripe API version is 2026-07-29.dahlia - use this version when upgrading unless the user specifies a different target version.

Upgrading Stripe Versions

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

Understanding Stripe API Versioning

Stripe uses date-based API versions (e.g., 2026-07-29.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-07-29.dahlia'
Stripe.api_version = '2026-07-29.dahlia'
const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-07-29.dahlia'
});

Per-Request Override:

stripe.Customer.create(
  email="customer@example.com",
  stripe_version='2026-07-29.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-07-29.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-07-29.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-07-29.dahlia"

Or in code:

const stripe = require('stripe')('sk_test_xxx', {
  apiVersion: '2026-07-29.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 による自動翻訳です。