Accounts v2 で Stripe Billing と Connect を連携させる公開プレビュー
Stripe Billing のサブスクリプションで連結アカウントに請求する v2 のシステムを構築します。
This guide explains how to use Accounts v2 to integrate Billing and Connect into your SaaS platform, which lets you charge subscription fees directly to your connected accounts.
You can enable Accounts v2 for your Connect platform from your Dashboard.
テスト環境
この連携を試すには、サンドボックスを使用する必要があります。テスト環境は使用できません。
プラットフォームのアカウントを Connect に登録する
Set up your Stripe account as a Connect platform by following the onboarding process in your Dashboard.
Connect 導入ガイドでは、プラットフォームの設定オプションについて説明しています。
If you have an existing platform, this integration doesn’t support your connected accounts that use Accounts v1. If you want to include them, you have to recreate them, following the process explained here, then remove their old accounts.
Create your connected accounts using the Accounts v2 API
注
この実装では、API v2 の Account (アカウント)、Event (イベント)、EventDestination (イベントの送信先)、Person (個人) のみを使用します。他のオブジェクトはすべて API v1 に属するものです。
For each connected account, use the Accounts v2 API to create an Account
object with the customer
and merchant
configurations.
- The
customer
configuration allows theAccount
to pay your platform a subscription fee using a payment method that you attach to theAccount
. - The
merchant
configuration makes theAccount
a connected account that can accept card payments from its own customers. When you assign themerchant
configuration, you also define other aspects of the connected account, such as:- configuration.merchant.capabilities.card_payments.requested を true に設定して、カード決済を受け付ける機能をリクエストします。
- dashboard を設定して、Stripe ダッシュボードへのアクセスを指定します。次の例では、
dashboard
をfull
に設定しています。これは、Account
が完全な Stripe ダッシュボードにアクセスできることを意味します。 Account
から手数料を徴収する責任者を指定するには、defaults.responsibilities.fees_collector をstripe
またはapplication
に設定します。Account
のマイナス残高に対する責任者を指定するには、defaults.responsibilities.losses_collector をstripe
またはapplication
に設定します。
include を使用してレスポンスにオブジェクトを読み込む
API v2 で Account
を作成、取得、更新する際、include パラメーターで指定した場合にのみ、特定のプロパティがレスポンスに入力されます。プロパティを指定しなかった場合は、実際の値に関係なく、レスポンスに null として表示されます。
レスポンスには ID が含まれており、システム全体で Account
を参照する場合はこれを使用します。
{ "id": "acct_xxxxxxxxxxxxxxxx", "object": "v2.core.account", "applied_configurations": [ "customer", "merchant" ], "configuration": { "customer": { "automatic_indirect_tax": { "exempt": "none", "ip_address": null, "location": null, "location-source": "identity_address" }, "billing": { ... }, "capabilities": { "automatic_indirect_tax": { "requested": true, "status": "restricted", "status_details": [ { "code": "requirements_past_due", "resolution": "provide_info" } ] } }, "shipping": ..., "test_clock": ... }, "merchant": { "bacs_debit_payments": null, "branding": { ... }, "capabilities": { ... "card_payments": { "requested": true, "status": "restricted", "status_details": [ { "code": "requirements_past_due", "resolution": "provide_info" } ] }, "stripe_balance": { "payouts": { "requested": true, "status": "restricted", "status_details": [ { "code": "requirements_past_due", "resolution": "provide_info" } ] } }, ... }, "card_payments": { "decline_on": { "avs_failure": false, "cvc_failure": false } }, "mcc": null, ... "statement_descriptor": { ... }, "support": { "address": { ... }, ... } }, "recipient": null }, "contact_email": "furever_contact@example.com", "created": "2025-03-04T02:23:20.000Z", "dashboard": "full", "identity": { "attestations": { ... }, "terms_of_service": { "account": null }, "business_details": { ... "registered_name": "Furever", ... }, "country": "US", "entity_type": "company", "individual": null }, "defaults": null, "display_name": "Furever", "metadata": {}, "requirements": { "collector": "stripe", "entries": [ { "awaiting_action_from": "user", "description": "representative.surname", "errors": [], "impact": { "restricts_capabilities": [ { "capability": "card_payments", "configuration": "merchant", "deadline": { "status": "past_due" } }, { "capability": "stripe_balance.payouts", "configuration": "merchant", "deadline": { "status": "past_due" } } ] }, "minimum_deadline": { "status": "past_due" }, "reference": null, "requested_reasons": [ { "code": "routine_onboarding" } ] } ], "summary": { "minimum_deadline": { "status": "past_due", "time": null } } } }
アカウントの責任
Responsibilities define certain behaviors of connected accounts, such as how they pay Stripe fees and responsibility for negative balances. You set them when you add the merchant
configuration to your connected accounts.
Accounts
が連結アカウントとして支払いを回収できるようにするには、次の responsibilities
を設定します。
プロパティ | 説明 | 値 |
---|---|---|
defaults.responsibilities.fees_collector | Defines how Stripe collects payment fees for direct charges on the connected account. (For destination or separate charges, Stripe always collects fees from your platform.) |
|
defaults.responsibilities.losses_collector | Assigns responsibility for negative balances incurred by the connected account. |
|
Responsibilities are subject to the following restrictions:
- If you set
losses_
tocollector application
, then you must also setfees_
tocollector application
. - If you use destination charges with an Account, we recommend that you set both
losses_
andcollector fees_
tocollector application
.
For more information about supported configurations, see Integration recommendations.
支払いタイプ
ベータリリースでは、連結アカウントへの支払いは、ダイレクト支払いおよびデスティネーション支払いのみがサポートされています。支払いと送金別方式は使用することができません。
To use destination charges, you must set the on_behalf_of parameter to make the connected account the settlement merchant. You must also add the recipient
configuration to your connected accounts and request the stripe_
capability for them.
Add the recipient configuration to connected accounts
To allow the transfer of funds from your platform’s Stripe balance to the connected account’s Stripe balance, add the recipient
configuration and request the stripe_
capability. Destination charges require this capability.
Requesting stripe_
also automatically requests the recipient
configuration’s stripe_
capability, which allows the connected account to pay out to their external bank account.
The merchant
configuration automatically requests its own stripe_
capability, which is identical to the recipient
configuration’s stripe_
capability. If the account doesn’t need any other recipient
capabilities, you don’t need to add the recipient
configuration.
注
ベータリリースでは、海外入金はサポートされていません。
To add the recipient
configuration and request the stripe_
capability, update the Account
and set the configuration.recipient.capabilities.stripe_balance.stripe_transfers.requested parameter to true.
連結アカウントのアカウントを登録する
連結アカウントがプラットフォームを通じて支払いを受け付けられるようにするには、連結アカウントのアカウント登録が必要です。アカウントを Stripe ホスティング登録に誘導したり、Connect 埋め込みコンポーネントを使用してブランド名の入ったフローを提供したり、貴社に合わせたカスタムのアカウント登録フローをコーディングで作成したりすることができます。Stripe ホスティング登録は最もシンプルなオプションです。埋め込みコンポーネントを使用すると、ほとんどのプロセスを自動的に処理しながら、ある程度のカスタマイズが可能になります。カスタムのアカウント登録フローはプラットフォーム側で完全に制御できますが、実装と継続的な更新が必要であるため、最も多くのリソースが必要になります。
連結アカウントの外部口座の作成
外部口座の作成プロセスは、連結アカウントがダッシュボードへのアクセス権を持っているかどうかで内容が異なります。
- If an
Account
’sdashboard
isfull
orexpress
, the account owner adds its external account using their Dashboard. Account
のdashboard
がnone
の場合、/v1/external_accounts エンドポイントを使用して外部口座を作成できます。
連結アカウントの支払いを設定する
連結アカウントの支払いを設定するには、ダイレクト支払いまたはデスティネーション支払いの手順を参照してください。デスティネーション支払いを使用するには、on_behalf_of パラメーターを設定する必要があります。
連結アカウントの入金を設定する
ダッシュボードまたは API を使用して、連結アカウントの入金設定 (スケジュール、明細書表記、遅延日数など) を構成できます。
連結アカウントの要件変更をリッスンする
アカウントの要件は、多くの場合、金融規制当局、カードネットワーク、その他の金融機関が実施する変更によって変更される可能性があります。要件変更の Webhook 通知を設定するには、Account v2 の更新イベントをリッスンするイベントの送信先を作成します。
- Stripe ダッシュボードで、ナビゲーションメニューのフッターにある開発者をクリックして開発者メニューを開き、Webhook を選択します。
- + 送信先を追加をクリックします。
- Event from セクションで、Connected accounts を選択します。
- 詳細設定を表示を選択します。Payload style セクションで、Thin を選択します。
- Event のフィールドに「v2」と入力して、v2 イベントタイプを検索します。連結アカウントで使用される設定タイプごとに、v2.account[requirements].updated と v2.account[configuration.configuration_type].capability_status_updated タイプを選択します。
インタラクティブな Webhook エンドポイントビルダーに従って、イベントの送信先の設定を続けます。
更新された要件を収集して更新イベントに応答するようにアプリケーションを構成します。
開発時にローカルリスナーを設定する
Stripe CLI をインストールし、ローカルリスナーを設定することで、ローカルサーバーにイベントを送信し、開発に使用することができます。
- Stripe ダッシュボードにログインします。
- Stripe CLI で、
stripe login
コマンドを入力します。ブラウザーにリダイレクトされ、アカウントの確認と認証が行われます。 - CLI に戻り、次のコマンドを実行します。プラットフォームと連結アカウントで利用可能なすべての V2 イベントをリッスンし、http://localhost:4242 に転送します。
stripe listen --thin-events 'v2.core.account[requirements].updated,v2.core.account[configuration.recipient].capability_status_updated,v2.core.account[configuration.merchant].capability_status_updated,v2.core.account[configuration.customer].capability_status_updated' --forward-thin-to http://localhost:4242
Billing を連携させて継続料金を回収する
Stripe Billing を使用して連結アカウントから継続料金を回収するには、以下の手順を実行します。
- 継続料金に対応する商品を 1 つ以上作成します。
- アカウントを顧客として、手数料商品のサブスクリプションを作成します。
- (オプション) カードなどの他の決済手段に付随する取引手数料を回避して、連結アカウントの Stripe 残高から直接サブスクリプション料金を回収するには、デスティネーション支払いを決済手段として設定します。
注
連結アカウントは、支払いを行うのに十分な利用可能残高がある場合にのみ、Stripe 残高を使用して支払うことができます。残高支払いの失敗回を避するための推奨事項をこの手順の後半で説明しています。
継続料金で商品を作成する 
サブスクリプション料金を表す商品と料金を作成します。API またはダッシュボードを使用できます。
サブスクリプションを作成して連結アカウントに請求する 
You can collect SaaS subscription fees directly from a connected account’s Stripe balance. The connected account must meet the following requirements:
- It must have both the
merchant
andcustomer
configurations. - Its
merchant
configuration’scard_
capability must be active.payments - Its available balance must have sufficient funds to make a full payment.
Configure your integration to manage Stripe balance payment failures
When you collect a payment from a connected account’s Stripe balance, the account’s available balance must have sufficient funds to make the full payment. Otherwise, the payment fails. If you plan to collect payments directly from your connected accounts’ Stripe balances, we recommend configuring your integration to manage balance-related payment failures.
Avoid balance payment failures
Because payments from a connected account’s Stripe balance rely on its available funds, you can avoid payment failures by taking steps to maximize your connected accounts’ balances.
連結アカウントの入金スケジュールを調整する
Coordinate your payout schedules with your subscription billing cycles. For example, if you charge subscription fees on the first day of each month, and schedule weekly payouts on Mondays, then months with more Mondays have more payouts. Those months have lower available balances than months with fewer payouts, making payment failures more likely.
入金による決済の失敗を回避する別の方法として、サブスクリプションの支払いの前に手動入金に変更できます。各サブスクリプション支払いの一定期間前に、すでに連結アカウントに十分な残高がある場合は、手動入金に切り替えます。サブスクリプションの支払いが終わったら自動入金に戻します。これにより、サブスクリプションの支払いに必要な資金が自動的に入金されなくなります。
連結アカウントの最低残高を設定する
アカウントの最低残高を定義することで、自動入金によって連結アカウントの利用可能残高が一定額を下回るのを防ぐことができます。
- ダッシュボードでアカウントを見つけます。
- アカウントのオーバーフローメニュー () から、…のダッシュボードを表示を選択します。
- 歯車のアイコンをクリックし、設定を選択します。
- アカウント設定でビジネスをクリックします。
- 外部の入金口座とスケジュール設定タブを選択します。
- 支払い残高に最低金額を保持するをオンにして、金額を入力します。
連結アカウントごとに最低残高を手動で設定する必要があります。
Handle balance payment failures
Set up webhooks and event destinations to receive notifications about subscription payments. Identify payment failures by listening for the invoice.
event. When a payment fails:
- PaymentIntent のステータスが
requires_
に変わります。action - 現在の請求書のサブスクリプションステータスは
incomplete
のままです。 - サブスクリプションは引き続き請求書を生成しますが、請求書は
draft
ステータスのままです。
注
Payments from Stripe balances don’t support smart retries.
If a payment from a Stripe balance fails due to insufficient available funds, you can retry it by following these steps:
- 連結アカウントの入金スケジュールの期間を
manual
に設定します。 - 次回連結アカウントに入金される支払いをリッスンしてから、アカウントの利用可能な残高を確認します。
- 利用可能な残高がサブスクリプション料金以上の場合は、未払い請求書の決済手段を
stripe_
に設定して再試行します。それ以外の場合は、利用可能な残高が請求書の支払いに十分になるまで、支払いのリッスンを続けます。balance - 支払いが成功したら、連結アカウントの通常の入金スケジュールに戻します。
Instead of retrying a failed payment from a Stripe balance, you can try using a different payment method by specifying it directly on the invoice. You can also implement a flow that allows connected accounts to update their own subscription payment methods.
Preview considerations
Accounts v2 allows you to use a single, configurable account for each business on your platform that collects payments directly. The preview release doesn’t support Treasury, Issuing, or payment methods that are in preview. You can still use Treasury, Issuing, or payment methods in preview with Accounts v1.
Enable Accounts v2 for your Connect platform from your Dashboard.