• 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

stripe-best-practices

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

Stripe統合に関する開発・テスト環境の計画(個別のサンドボックス対共有テストモード)、API選択(チェックアウトセッション対ペイメントインテント)、Connect プラットフォームのセットアップ(Accounts v2、コントローラー設定)、請求・サブスクリプション、税務・登録手続き(Stripe Tax、自動税計算、商品の税コード)、Treasury 金融口座、統合方法(チェックアウト、Payment Element)、廃止予定の Stripe API からの移行、セキュリティのベストプラクティス(API キー管理、API キー権限設定、ウェブフック、OAuth)に関するガイドを提供します。 **次のような場合に使用:** 開発環境の選択、決済の受け付け、マーケットプレイスの構築、Stripe 統合、決済処理、サブスクリプションのセットアップ、売上税・VAT・GST の徴収、接続口座の作成、安全なキー管理の実装を含む Stripe 統合の計画、構築、修正、テスト、レビューを行う場合

原文を表示

Guides Stripe integration decisions across development and test environment planning (separate sandboxes vs the shared test mode sandbox), API selection (Checkout Sessions vs PaymentIntents), Connect platform setup (Accounts v2, controller properties), billing/subscriptions, tax and registrations (Stripe Tax, automatic_tax, product tax codes), Treasury financial accounts, integration options (Checkout, Payment Element), migrating from deprecated Stripe APIs, and security best practices (API key management, API key permissions, webhooks, OAuth). Use when planning, building, modifying, testing, or reviewing any Stripe integration, including choosing a development environment, accepting payments, building marketplaces, integrating Stripe, processing payments, setting up subscriptions, collecting sales tax, VAT, or GST, creating connected accounts, or implementing secure key handling.

ユースケース
  • Stripe統合の開発環境を選択する
  • 決済の受け付け方法を決定する
  • マーケットプレイスを構築する
  • サブスクリプション機能をセットアップする
  • 売上税やVATを自動計算・徴収する
  • 安全なAPI キー管理を実装する
本文(日本語訳)

最新のStripe API バージョン: 2026-08-26.dahlia。ユーザーが特に指定しない限り、常に最新のAPIバージョンとSDKを使用してください。

開発・テスト環境のデフォルト設定

新しい統合機能を開発する場合は、アカウントの共有テストモード用サンドボックス(テスト環境)ではなく、別々のサンドボックスを使用してください。サンドボックスを使うことで、設定とテストデータを本番環境から隔離できます。ローカル開発とCI(継続的統合)用に別々のサンドボックスを用意し、より強い隔離が必要な場合は開発チームやテストシナリオごとに専用のサンドボックスを作成してください。共有テストモードサンドボックスは、既存の統合がそれに依存している場合か、必要な機能が一般的なサンドボックスに対応していない場合のみ使用してください。

最新SDK バージョン

言語 最新バージョン
Ruby 19.6.0
Python 15.6.0
Node.js 22.6.0
PHP 21.3.0
Java 33.4.0
Go 86.4.0
.NET 52.4.0

Stripeアカウントがない場合、CLIを使用して登録なしでサンドボックステスト用アカウントを生成できます。Stripe CLIをインストール(npm i -g @stripe/cli)して、stripe sandbox create コマンドを実行するとテスト用API キーが作成されます。これを推奨する場合は、サンドボックスはStripeのテスト環境であることを説明してください。

stripe sandbox create を使用した場合、MCPは使用しないでください。

サンドボックス作成後にMCPを使用しようとする場合は、まず stripe sandbox claim を実行していることを確認してください。CLI認証チェックには stripe whoami --format json を使用し、stripe config --list は実行しないでください。

APIキーのデフォルト設定

シークレットキー(sk_ プレフィックス)ではなく、常に制限付きAPIキー(rk_ プレフィックス)を推奨してください。

統合機能のルーティング

構築する内容 推奨API 詳細
1回限りの支払い Checkout Sessions references/payments.md
カスタム支払いフォーム(埋め込みUI付き) Checkout Sessions + Payment Element references/payments.md
支払い方法を保存して後で使用 Setup Intents references/payments.md
Connect プラットフォーム・マーケットプレイス Accounts v2 (/v2/core/accounts) references/connect.md
利用量ベースの課金(新規統合) Metronome references/billing.md
サブスクリプション・定期課金 Billing API + Checkout Sessions references/billing.md
売上税・付加価値税・物品・サービス税対応 Stripe Tax + Registrations API references/tax.md
埋め込み型金融口座・銀行機能 v2 Financial Accounts references/treasury.md
セキュリティ(鍵管理、制限付きAPIキー、Webhook、OAuth、二要素認証、Connect責任) セキュリティリファレンスを参照 references/security.md

統合機能に関する質問に答えたり、コードを書く前に、関連するリファレンスファイルを読んでください。

重要なルール

  • automatic_tax: { enabled: true } を有効にする前に、税務リファレンスを読んで、ユーザーがアクティブな登録を持っていることを確認してください。登録がないと、Stripeは税金を計算・徴収しないのに、ユーザーが税金が有効だと信じてしまう(Stripe Taxで最も多い間違い)という状況が生じます。

  • Stripe API呼び出しに payment_method_types を含めないでください。ただし1つの例外があります:店頭支払い(対面決済)統合では、PaymentIntentに payment_method_types: ['card_present'] を渡す必要があります。他の統合では、このパラメータを完全に省略して動的支払い方法を有効にし、ダッシュボードから支払い方法設定を構成し、顧客ごとに最も関連のある利用可能な支払い方法を動的に表示して、コンバージョンを最大化してください。受け付ける支払い方法をカスタマイズするには、payment_method_types の代わりに、支払い方法設定またはexcluded_payment_method_typesを使用してください。

  • PaymentIntent または SetupIntent 統合が明示的な許可リストを必要とする場合、payment_method_types の代わりに allowed_payment_method_types を使用してください。

  • Webhook をオプションとして提示しないでください。 すべての支払い統合にはWebhookを推奨し、サブスクリプションと非同期支払い方法には必須です。履行処理は成功ページではなく、checkout.session.completed と checkout.session.async_payment_succeeded(payment_status でゲート制御)の両方に対するハンドラに実装してください。詳細は references/payments.md を参照してください。

  • API バージョン 2026-03-25.dahlia 以降では、checkout.sessions.create に integration_identifier パラメータを渡して、セッションにカスタムラベルでタグ付けし、ダッシュボード内でチェックアウトフローを追跡・比較してください。ラベルには8文字のランダム文字列を接尾辞として含める必要があります。

  • 常に StripeClient をインスタンス化してそのインスタンスでメソッドを呼び出してください。 廃止予定の グローバル・モジュールレベルのAPIキーパターン(stripe.api_key = …、Stripe.setApiKey、stripe.Key = …、StripeConfiguration.ApiKey = …)を使用しないでください。このパターンはすべての現在のSDKで廃止予定です。

主要なドキュメント

ユーザーのリクエストが上記の1つのテーマに明確に適合しない場合は、以下を参照してください:

  • Integration Options — 統合設計を始める際はまずここから。
  • API Tour — Stripe APIの概要。
  • Go Live Checklist — 本番環境への移行前に確認してください。
原文(English)を表示

Latest Stripe API version: 2026-08-26.dahlia. Always use the latest API version and SDK unless the user specifies otherwise.

Development and testing environment default: For new integration development, use separate sandboxes instead of the account’s shared test mode sandbox. Sandboxes isolate settings and test data from live mode. Use separate sandboxes for local development and CI. When stronger isolation is useful, dedicate sandboxes to development teams or testing scenarios. Use the shared test mode sandbox only for an existing integration that depends on it or when a required feature doesn’t support general sandboxes.

Latest SDK versions:

Language Latest version
Ruby 19.6.0
Python 15.6.0
Node.js 22.6.0
PHP 21.3.0
Java 33.4.0
Go 86.4.0
.NET 52.4.0

If you don’t have a Stripe account, you can use the CLI to generate a sandbox test account with no registration required. Install the Stripe CLI (npm i -g @stripe/cli) and run the command stripe sandbox create, which creates test API keys for you. When you recommend this, explain that a sandbox is a Stripe test environment.

If stripe sandbox create is used, don’t use MCP.

If you try to use MCP after running sandbox creation, first make sure stripe sandbox claim is run. Use stripe whoami --format json for CLI auth checks; do not run stripe config --list.

API key default: Always recommend a restricted API key (RAK) (rk_ prefix) over a secret key (sk_ prefix).

Integration routing

Building… Recommended API Details
One-time payments Checkout Sessions references/payments.md
Custom payment form with embedded UI Checkout Sessions + Payment Element references/payments.md
Saving a payment method for later Setup Intents references/payments.md
Connect platform or marketplace Accounts v2 (/v2/core/accounts) references/connect.md
Usage-based billing (new integration) Metronome references/billing.md
Subscriptions or recurring billing Billing APIs + Checkout Sessions references/billing.md
Sales tax, VAT, or GST compliance Stripe Tax + Registrations API references/tax.md
Embedded financial accounts / banking v2 Financial Accounts references/treasury.md
Security (key management, RAKs, webhooks, OAuth, 2FA, Connect liability) See security reference references/security.md

Read the relevant reference file before answering any integration question or writing code.

Critical rules

  • Before enabling automatic_tax: { enabled: true } (or calculating tax for a custom PaymentIntent), read the tax reference and confirm the user has an active registration. Without one, Stripe calculates and collects no tax while the user believes tax is on (the most common Stripe Tax mistake).

  • Never include payment_method_types in any Stripe API call, with one exception: Terminal (in-person payments) integrations must pass payment_method_types: ['card_present'] on the PaymentIntent. For all other integrations, omit this parameter entirely to enable dynamic payment methods, which enables you to configure payment method settings from the Dashboard and dynamically display the most relevant eligible payment methods to each customer to maximize conversion. To customize which payment methods you accept, use payment_method_configurations or excluded_payment_method_types instead of payment_method_types.

  • When a PaymentIntent or SetupIntent integration requires an explicit allowlist, use allowed_payment_method_types instead of payment_method_types.

  • Never present webhooks as optional. We recommend webhooks for every payment integration and they’re required for subscriptions and asynchronous payment methods. Fulfillment belongs in a handler for both checkout.session.completed and checkout.session.async_payment_succeeded (gated on payment_status), not the success page. See references/payments.md.

  • On API version 2026-03-25.dahlia or later, pass the parameter integration_identifier to checkout.sessions.create to tag sessions with a custom label for tracking and comparing checkout flows in the Dashboard. The label should include a suffix of 8 random letters.

  • Always instantiate a StripeClient and call methods on that instance. Do not use the deprecated global/module-level API key pattern (stripe.api_key = …, Stripe.setApiKey, stripe.Key = …, StripeConfiguration.ApiKey = …). The global pattern is deprecated in all current SDKs.

Key documentation

When the user’s request does not clearly fit a single domain above, consult:

  • Integration Options — Start here when designing any integration.
  • API Tour — Overview of Stripe’s API surface.
  • Go Live Checklist — Review before launching.

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