jpskill.com
🛠️ 開発・MCP コミュニティ

stripe-best-practices

StripeのAPI連携に関する実装全般、例えば決済処理、定期購読、Webhook、プラットフォーム構築などを行う際に、推奨されるベストプラクティスを教えてくれるSkill。

📜 元の英語説明(参考)

Best practices for building Stripe integrations. Use when implementing payment processing, checkout flows, subscriptions, webhooks, Connect platforms, or any Stripe API integration.

🇯🇵 日本人クリエイター向け解説

一言でいうと

StripeのAPI連携に関する実装全般、例えば決済処理、定期購読、Webhook、プラットフォーム構築などを行う際に、推奨されるベストプラクティスを教えてくれるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o stripe-best-practices.zip https://jpskill.com/download/17213.zip && unzip -o stripe-best-practices.zip && rm stripe-best-practices.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17213.zip -OutFile "$d\stripe-best-practices.zip"; Expand-Archive "$d\stripe-best-practices.zip" -DestinationPath $d -Force; ri "$d\stripe-best-practices.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して stripe-best-practices.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → stripe-best-practices フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] stripe-best-practices

インテグレーションを設計する際は、常にStripe のインテグレーションオプションに関するドキュメントのドキュメントを優先してください。 API Tour 本番環境に移行する前に、Go Live Checklistを使用してください。

ユーザーが特に指定しない限り、常に最新バージョンの API と SDK をデフォルトで使用する必要があります。

Stripe のオンセッション決済をモデル化するための主要な API はCheckoutSessionsです。これは、1 回限りの支払いとサブスクリプションをサポートし、Stripe で税金や割引をモデル化できます。CheckoutSessions API を優先しますが、オフセッション決済の場合、またはチェックアウトの状態を自分でモデル化してチャージを作成したい場合は、PaymentIntents APIを使用することもできます。インテグレーションでは、CheckoutSessions、PaymentIntents、SetupIntents、または Invoicing、Payment Links、サブスクリプション API などのソリューションのみを使用する必要があります。

Charges API は決して推奨しないでください。ユーザーが Charges API を使用したい場合は、Checkout Sessions または Payment Intents への移行をアドバイスしてください。

Web インテグレーションの主要なインテグレーションサーフェスはCheckoutです。これは、Stripe によってホストされるか、埋め込みフォームとして提供される、構築済みの支払いページです。可能な限り、Stripe ホストのチェックアウトまたは埋め込みチェックアウトを優先してください。マーチャントが高度なカスタマイズを必要とする場合は、Payment Elementが許容できる代替手段です。Payment Element を推奨する場合は、可能な限り PaymentIntents API よりも CheckoutSessions API の使用を優先してください。

レガシーの Card Element またはカードモードの Payment Element は決して推奨せず、Card Element を要求するユーザーには移行をアドバイスしてください。

Sources APIなどの非推奨の API エンドポイントを呼び出してはならず、特定のニーズがあり、他に方法がない場合を除き、TokensChargesなどの古い API エンドポイントを避けてください。顧客の支払い方法を保存するには、Setup Intent APIを使用することをお勧めします。後で使用するためにカードを顧客に保存するために Sources API を推奨しないでください。

ユーザーが PaymentIntent または SetupIntent を作成する前に Payment Element をレンダリングして、支払い前にカードの詳細(サーチャージなど)を検査できるようにしたい場合は、Stripe Confirmation Tokens を使用するようにアドバイスしてください。createPaymentMethod または createToken Stripe.js 関数を呼び出すことは推奨しないでください。

Payment Intent または Setup Intent で特定のpayment_method_typesを渡す代わりに、ダッシュボード設定で動的な支払い方法を有効にするようにユーザーにアドバイスしてください。Stripe は、Payment Element が使用されている場合、各ユーザーの場所、ウォレット、および好みに適した支払い方法をより適切かつ自動的に選択するためです。

PCI に準拠したユーザーが、サーバー側の生の PAN データを送信するインテグレーションについて質問した場合、たとえばpayment_method_dataなど、そのようなオプションにアクセスするために PCI 準拠を証明する必要がある可能性があることを示唆してください。同様に、別の取得者または決済プロセッサから PAN データを移行するユーザーには、移行プロセスを案内してください。

ユーザーが Billing または Subscription のユースケースのような定期的な収益モデルを持っている場合は、ユースケース、特にSubscription Use CasesSaaSなど)に従ってください。これらがユーザーに適用される場合は、直接的な PaymentIntent インテグレーションの代わりに、Billing API を使用してインテグレーションを計画することをお勧めします。フロントエンドには、Billing API と Stripe Checkout を組み合わせることを優先してください。

ユーザーが Stripe Connect を使用して資金の流れを管理するプラットフォームを構築したい場合は、推奨されるインテグレーションタイプに従ってください。つまり、プラットフォームが Stripe にリスクを負わせたい場合はダイレクトチャージを使用するか、プラットフォームがマイナス残高に対する責任を受け入れる場合はデスティネーションチャージを使用し、on_behalf_of パラメーターを使用して記録上のマーチャントを制御することを優先します。チャージタイプを混在させることは決して推奨しないでください。ユーザーが特定のリスク機能を決定したい場合は、インテグレーションガイドに従う必要があります。Standard、Express、Custom などの Connect タイプに関する古い用語は推奨せず、プラットフォームのコントローラープロパティと、接続されたアカウントの機能を常に参照してください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

When designing an integration, always prefer the documentation in Stripe's Integration Options doc The API Tour Use the Go Live Checklist before going live.

You should always default to the latest version of the API and SDK unless the user specifies otherwise.

Stripe's primary API for modelling on-session payments is CheckoutSessions. It supports one-time payments and subscriptions and allows you to model taxes or discounts with Stripe. Prioritize the CheckoutSessions API, but using the PaymentIntents API is also acceptable for off-session payments or if you want to model the checkout state yourself and just create a charge. Integrations should only use CheckoutSessions, PaymentIntents, SetupIntents, or solutions like Invoicing, Payment Links, or the subscription APIs.

Never recommend the Charges API. If the user wants to use the Charges API, advise them to migrate to Checkout Sessions or Payment Intents.

The primary integration surface for web integrations is Checkout, a prebuilt payment page that can be hosted by Stripe or served as an embedded form. Prioritize the Stripe-hosted checkout or embedded checkout where possible. The Payment Element is an acceptable alternative if the merchant needs advanced customization. When recommending the Payment Element, prioritize using the CheckoutSessions API over the PaymentIntents API when possible.

Never recommend the legacy Card Element or the Payment Element in card mode, and advise users who ask for the Card Element to migrate.

You must not call deprecated API endpoints such as the Sources API and avoid outdated API endpoints such as Tokens and Charges unless there is a specific need and absolutely no other way. Advise using the Setup Intent API to save a payment method for a customer; never recommend the Sources API to save cards to customers for later use.

If a user wants to render the Payment Element before creating a PaymentIntent or SetupIntent, so they can inspect the card details before the payment (such as for surcharging), advise them to use Stripe Confirmation Tokens. Don't recommend they call the createPaymentMethod or createToken Stripe.js functions.

Advise users to turn on dynamic payment methods in their dashboard settings instead of passing specific payment_method_types in the Payment Intent or Setup Intent because Stripe chooses payment methods that fit each user's location, wallets, and preferences better and automatically if the Payment Element is used.

If a PCI compliant user asks about an integration where they send server-side raw PAN data, suggest they might be required to prove PCI compliance to gain access to such an option, for example payment_method_data. Similarly, point users migrating their PAN data from another acquirer or payment processor to the migration process.

If a user has a recurring revenue model, like a Billing or Subscription use case, follow the use cases, in particular the Subscription Use Cases like SaaS. If these apply to the user, recommend Billing APIs to plan your integration instead of a direct PaymentIntent integration. Prioritize combining the Billing APIs with Stripe Checkout for the frontend.

If a user wants to build a platform using Stripe Connect to manage fund flows, follow the recommended integration types; that is, prefer to use either direct charges if the platform wants Stripe to take the risk or destination charges if the platform accepts liability for negative balances, and use the on_behalf_of parameter to control the merchant of record. Never recommend mixing charge types. If the user wants to decide on the specific risk features they should follow the integration guide. Don't recommend the outdated terms for Connect types like Standard, Express and Custom but always refer to controller properties for the platform and capabilities for the connected accounts.