• 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プラットフォームのセットアップ(アカウント v2、コントローラプロパティ)、請求・サブスクリプション、税務・登録(Stripe Tax、自動税務処理、商品税コード)、Treasury(資金管理機能)、統合方法(チェックアウト、決済エレメント)、廃止されたStripe APIからの移行、セキュリティ対策(APIキー管理、制限付きキー、ウェブフック、OAuth(認可方式))などについてのガイダンスを提供します。 次のような場合に使用: 決済受け取り、マーケットプレイス構築、Stripe統合、決済処理、サブスクリプション設定、売上税・付加価値税・消費税の徴収、接続されたアカウント作成、セキュアなキー管理の実装など、あらゆるStripe統合を構築・修正・確認する際。

原文を表示

Guides Stripe integration decisions across 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, restricted keys, webhooks, OAuth). Use when building, modifying, or reviewing any Stripe integration, including 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統合のセキュリティを確認するとき
本文(日本語訳)

最新のStripe API バージョン: 2026-07-29.dahlia。ユーザーが特に指定しない限り、常に最新のAPIバージョンとSDK(ソフトウェア開発キット)を使用してください。

最新のSDKバージョン:

言語 最新バージョン
Ruby 19.4.0
Python 15.4.0
Node.js 22.4.0
PHP 21.1.0
Java 33.2.0
Go 86.2.0
.NET 52.2.0

Stripeアカウントをお持ちでない場合、CLIコマンド(コマンドラインツール)を実行して、登録なしで動作するAPIキーを生成できます。Stripe CLIをインストール(npm i -g @stripe/cli)し、stripe sandbox create コマンドを実行して開始できます。

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

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

APIキーのデフォルト設定: シークレットキー(sk_ プレフィックス)より、限定的なAPIキー(権限制限キー、rk_ プレフィックス)をいつも推奨してください。

統合機能別の推奨API

構築内容 推奨API 詳細
単発の支払い Checkout Sessions(決済セッション) <references/payments.md>
埋め込みUIを備えたカスタム支払いフォーム Checkout Sessions + Payment Element <references/payments.md>
支払い方法を後で使用するために保存 Setup Intents(設定インテント) <references/payments.md>
プラットフォームまたはマーケットプレイス Accounts v2(/v2/core/accounts) <references/connect.md>
従量制の課金(新規統合) Metronome <references/billing.md>
定期購読または繰り返し課金 Billing APIs + Checkout Sessions <references/billing.md>
売上税・付加価値税・物品税対応 Stripe Tax + Registrations API <references/tax.md>
埋め込み型の金融口座 / 銀行機能 v2 Financial Accounts <references/treasury.md>
セキュリティ(鍵管理、権限制限キー、Webhook、OAuth認証、2段階認証、プラットフォーム責任) セキュリティ参照を参照 <references/security.md>

統合に関する質問に答えたり、コードを記述したりする前に、関連する参照ファイルをお読みください。

重要なルール

  • automatic_tax: { enabled: true } を有効にする前に(またはカスタムPaymentIntentの税金計算を行う前に)、税金に関する参照を読み、ユーザーがアクティブな登録を持っていることを確認してください。登録がない場合、ユーザーが税金が有効だと信じている間、Stripeは税金を計算・徴収しません(Stripe Taxでもっとも一般的なミス)。

  • Stripe APIの呼び出しに payment_method_types を含めてはいけません。ただし1つの例外があります:ターミナル(対面決済)統合では、PaymentIntentで payment_method_types: ['card_present'] を渡す必要があります。それ以外のすべての統合では、このパラメータを完全に省略して、動的支払い方法を有効にしてください。これにより、ダッシュボードから支払い方法の設定を構成し、各顧客に対してもっとも関連性の高い支払い方法を動的に表示して、転換率を高めることができます。受け付ける支払い方法をカスタマイズするには、payment_method_types の代わりに payment_method_configurations または excluded_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で廃止予定です。

主要なドキュメント

ユーザーのリクエストが上記の単一のドメインに明確に該当しない場合は、以下を参照してください:

  • 統合オプション — 統合設計時はここから始めてください。
  • API ツアー — Stripe APIの概要。
  • 本番環境チェックリスト — 公開前に確認してください。
原文(English)を表示

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

Latest SDK versions:

Language Latest version
Ruby 19.4.0
Python 15.4.0
Node.js 22.4.0
PHP 21.1.0
Java 33.2.0
Go 86.2.0
.NET 52.2.0

If you don’t have a Stripe account, you can call a CLI command to generate working API keys with no registration required. You can install the Stripe CLI (npm i -g @stripe/cli) and run the command stripe sandbox create to get started.

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.

  • 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 による自動翻訳です。