# 口座データで ACH Direct Debit 決済を使用するために銀行口座情報を収集する 残高などのアカウントデータを決済システムで使用します。 使用すべき Financial Connections の導入方法が不明の場合は、Stripe の[導入オプションの概要](https://docs.stripe.com/financial-connections/use-cases.md)をご覧ください。 Stripe には、ユーザーから ACH Direct Debit 決済を受け付ける方法が複数用意されています。これらの方法はすべて、ユーザーの口座からの引き落とし前に、ユーザーの口座を[確認](https://docs.stripe.com/payments/ach-direct-debit.md#verification)することが必須となります。Financial Connections を使用すると、残高や所有権の確認などの機能とともに、銀行口座の即時確認を実行できます。ACH フローに Financial Connections を使用すると、以下を行えます。 - 解約済み口座や非アクティブな口座からの支払い失敗率を減らす - 口座番号や金融番号の確認のためにユーザーを決済フローから逸脱させるのではなく、セッションを継続することで購入完了率を高める - 銀行口座情報を収集するためのカスタムフォームの作成を不要にすることで、開発時間を短縮する - 残高や所有者情報など、追加の銀行口座データの収集を有効にする ## Before you begin Financial Connections は、Checkout や Payment Element など、すべてのオンライン ACH 決済フローでデフォルトの確認方法です。オンラインフローを使用する場合は、[その他の口座データへのアクセス](https://docs.stripe.com/financial-connections/ach-direct-debit-payments.md#access)まで直接スキップしてください。まだ行っていない場合は、[ACH 決済を回収](https://docs.stripe.com/payments/ach-direct-debit/accept-a-payment.md?platform=web&ui=stripe-hosted)するようにシステムを設定します。 ## Financial Connections を有効にする 各種 API リソースの `verification_method` パラメーターによって、Financial Connections で銀行口座の確認を有効にするかどうかを指定します。少額入金のフォールバックが指定された Financial Connections がデフォルトです。 > 手動入力と少額入金によって顧客が関連付けた銀行口座では、残高、所有権、取引などの追加の銀行口座データにアクセスできません。 | 確認方法 | 説明 | | ------------------- | --------------------------------------------------- | | `automatic` (デフォルト) | 銀行口座情報の手動入力と少額入金の使用のオプションを備えた Financial Connections | | `instant` | Financial Connections のみ (手動入力および少額入金のフォールバックなし) | | `microdeposits` | 手動入力と少額入金のみ | このオプションは以下の API で利用可能です。 Payment Element、Checkout、オンライン Invoicing など、Stripe がオンラインで提供する連携機能をご利用でない場合は、NACHA 同意書の収集などの追加のステップが必要になります。[ACH ガイドのこちらのセクション](https://docs.stripe.com/payments/ach-direct-debit/accept-a-payment.md?platform=web&ui=direct-api#web-collect-details) をご覧ください。 - [PaymentIntent](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-us_bank_account-verification_method) - [SetupIntent](https://docs.stripe.com/api/setup_intents/create.md#create_setup_intent-payment_method_options-us_bank_account-verification_method) - [CheckoutSession](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_method_options-us_bank_account-verification_method) - [Invoice (請求書)](https://docs.stripe.com/api/invoices/create.md#create_invoice-payment_settings-payment_method_options-us_bank_account-verification_method) - [Subscription (サブスクリプション)](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-payment_settings-payment_method_options-us_bank_account-verification_method) - [Payment Element](https://docs.stripe.com/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions-us_bank_account-verification_method) ## 顧客を作成する [Recommended] ユーザーを表すメールアドレスと電話番号を含めて*顧客* (Customer objects represent customers of your business. They let you reuse payment methods and give you the ability to track multiple payments)を作成し、その顧客を決済に関連付けることをお勧めします。`Customer` オブジェクトを関連付けることで、後で[以前に関連付けられた口座](https://docs.stripe.com/api/financial_connections/accounts/list.md)を一覧表示できます。`Customer` オブジェクトにメールアドレスと電話番号を入力すると、ユーザーがリピートの[Link](https://support.stripe.com/questions/link-for-financial-connections-support-for-businesses)ユーザーかどうかに応じて、Financial Connections がサインインまたはサインアップを簡素化し、認証フローを改善できます。 ```curl curl https://api.stripe.com/v1/customers \ -u "<>:" \ -d email={{CUSTOMER_EMAIL}} \ -d phone={{CUSTOMER_PHONE}} ``` ## 追加の口座データへのアクセスをリクエストする Financial Connections Accounts の追加のアカウントデータにアクセスするには、まず、[ダッシュボードの Financial Connections 設定](https://dashboard.stripe.com/settings/financial-connections)を確認して Financial Connections の申し込みを送信する必要があります。このページは、Financial Connections を有効化した後に表示できます。導入方法によって、さまざまな種類のアカウントデータへのアクセスをどのように設定するかが決まります。 #### 動的な支払い方法 Stripe の[動的な支払い方法機能](https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods.md)を使用して、Connect 以外のユースケースで ACH 決済を回収する場合、リクエストされた Financial Connections データを [ACH ダッシュボードの設定ページ](https://dashboard.stripe.com/test/settings/payment_methods)から直接設定できます。ACH デビットには口座番号と金融番号が必ず必要です。他のデータは任意です。 > ダッシュボードで権限を設定することをお勧めします。コードを変更することなく、収集するデータを変更できます。 ダッシュボードの設定を上書きするには、API で直接 Financial Connections の権限を指定します。これを PaymentIntents に対して行うには、以下のようにします。 ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=2000 \ -d currency=usd \ -d "customer={{CUSTOMER_ID}}" \ -d "automatic_payment_methods[enabled]=true" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]=payment_method" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]=balances" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]=ownership" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]=transactions" ``` #### 支払い方法のタイプ API で `payment_method_types` を直接渡す場合、API コールのたびに、どの Financial Connections のデータ権限が必要かを明示的に指定する必要があります。これを [CheckoutSession](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-payment_method_options-us_bank_account-financial_connections-permissions) に対して行うには、以下のようにします。 ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "<>:" \ -d "customer={{CUSTOMER_ID}}" \ --data-urlencode "success_url=https://example.com/success" \ -d "line_items[0][price]={PRICE_ID}" \ -d "line_items[0][quantity]=1" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][0]=payment_method" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][1]=balances" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][2]=ownership" \ -d "payment_method_options[us_bank_account][financial_connections][permissions][3]=transactions" ``` ## ACH の実装でデータを使用 残高や所有者などの追加の銀行口座データへのアクセスが承認されたら、このデータを使用して ACH 決済のパフォーマンスを向上させることができます。たとえば、残高データを使用して、残高不足による失敗のリスクを減らすことができます。例については、関連データガイドをご覧ください。 - [残高](https://docs.stripe.com/financial-connections/balances.md): *NSF* (A shorthand way of referring to the Non-sufficient Funds ACH return code R01) による失敗を減らすために、支払い開始前に口座残高を確認します。 - [所有権](https://docs.stripe.com/financial-connections/ownership.md): 口座所有者の情報を所得し、内部データモデルと比較することで、潜在的な不正利用を捕捉します。 - [取引](https://docs.stripe.com/financial-connections/transactions.md): 口座の取引履歴を取得し、顧客の給与がいつ振り込まれるかを確認します。 > Risk Intelligence API は、過去 30/60/90 日間の平均口座残高、過去 30/60/90 日間のクレジット取引の合計件数など、リスク管理に役立つ集計データを提供するベータ機能です。このベータ機能へのアクセスを希望される場合は、[メール](mailto:financial-connections-beta+risk-intelligence@stripe.com)でお問い合わせください。 ### Financial Connections アカウント ID の検索 データ更新を開始し、Financial Connections アカウントに関するデータを取得するには、まず、PaymentIntent の `payment_method` プロパティを展開して、関連付けられた支払い方法からアカウント ID を取得する必要があります。 ```curl curl -G https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT}} \ -u "<>:" \ -d "expand[]=payment_method" ``` Financial Connections アカウント ID は、拡張支払い方法の [`us_bank_account` ハッシュ](https://docs.stripe.com/api/payment_methods/object.md#payment_method_object-us_bank_account)にあります。[手動入力のフォールバック](https://docs.stripe.com/financial-connections/ach-direct-debit-payments.md#enable)を許可し、ユーザーが口座情報を手動で入力した場合、このフィールドは `null` になります。 ```json { "id": "pi_3OK3g4FitzZY8Nvm11121Lhb", "object": "payment_intent", "payment_method": { "us_bank_account": {"financial_connections_account": "fca_1OK123bitUAA8SvmruWkck76" } // ... other fields on the Payment Method } // ... other fields on the Payment Intent } ```