コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
導入を開始
事業で活用する
即時通貨換算
グローバル入金
Capital
プラットフォームに組み込む
Financial Accounts for platforms
    概要
    How Financial Accounts for platforms works
    利用資格要件
    始める
    API の使用を開始
    ユーザーのアカウント登録
    不正利用の管理
    マーケティングおよび法令遵守ガイドライン
    導入のサンプル
    Set up financial accounts and cards
    Use Financial Accounts for platforms to move money
    Sample application with Issuing and Financial Accounts for platforms
    Financial Accounts for platforms with Issuing
    Webhook
    カードを管理
    アカウント管理
    Accounts structure
    連結アカウントの使用
    金融口座を使用する
    金融アカウントの機能
    プラットフォームの金融アカウント
    残高と取引の使用
    資金移動
    Stripe Payments からの入金とトップアップ
    SetupIntent、PaymentMethod、BankAccount を使用する
    金融アカウントに資金を移動する
    金融アカウントから資金を移動する
    資金移動のタイムライン
    銀行パートナー
    Fifth Third Bank の概要
    Fifth Third Bank の使用を開始
カードを発行する
プラットフォーム向けの Capital
ホーム資金管理Financial Accounts for platforms

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

Issuing と Treasury のサンプルアプリ

Stripe Next.js のサンプルアプリを使用して、Issuing と Treasury の独自の実装を始めましょう。

In addition to a full suite of documentation and SDKs for Stripe Issuing and Financial Accounts for platforms, we offer a Next.js sample app.

baas.stripe.dev にあるサンプルアプリのデモか、GitHub リポジトリ をご覧ください。

コードにアクセスする

サンプルアプリは、TypeScript、React、Material UI を活用した Next.js アプリです。Stripe サンプルの GitHub リポジトリからプロジェクトをフォークして、含まれているコンポーネントをアプリの開始点として使用することができます。

アプリの機能

このアプリでは、次のようなさまざまな使用方法の例を紹介しています。

  • Stripe Connect アカウント登録を使用して、規制に準拠した連結アカウントの登録用に顧客確認 (KYC) 情報を収集する
  • アカウント情報と残高を表示する
  • Display transactions on the financial account
  • ACH または電信送金を使用した外部口座への送金をシミュレーションする
  • ACH クレジットの受け取りをシミュレーションする
  • ApexCharts を使用してインバウンドとアウトバウンドの資金のフローを視覚化する
  • 規則に準拠した方法でカード保有者を作成する
  • Create cards using the financial account as an issuable balance
  • 機密情報であるカード番号を PCI に準拠した方法で表示する
  • カードのオーソリをシミュレーションする
  • Get paid through a payment link, then transfer funds from your Stripe payments balance to the financial account
  • テストヘルパーを利用してアカウントに影響する操作をシミュレーションする

コンポーネントの内訳

以降のセクションでは、サンプルアプリの各コンポーネントの仕組みを大まかに紹介します。

You can learn more about Issuing APIs and features or financial account APIs and features.

アカウントの作成

アカウント作成フローは以下の 4 つのステップで構成されています。

  1. Create a connected account with the following capabilities: transfers, card_issuing, and treasury.
const account = await stripe.accounts.create({ country: 'US', email: email, capabilities: { transfers: {requested: true}, treasury: {requested: true}, card_issuing: {requested: true}, }, controller: { dashboard: {type: "none"}, losses: {payments: "application"}, requirement_collection: "application", fees: {payer: "application"} }, });
  1. Create a financial account.
const financialAccount = await stripe.treasury.financialAccounts.create( { supported_currencies: ['usd'], features: { card_issuing: {requested: true}, deposit_insurance: {requested: true}, financial_addresses: {aba: {requested: true}}, inbound_transfers: {ach: {requested: true}}, intra_stripe_flows: {requested: true}, outbound_payments: { ach: {requested: true}, us_domestic_wire: {requested: true}, }, outbound_transfers: { ach: {requested: true}, us_domestic_wire: {requested: true}, }, }, }, {stripeAccount: account.id}, );
  1. Connect アカウント登録リンクを作成し、そのリンクを使用して新規連結アカウントをリダイレクトして、リクエストされたケイパビリティに必要なプロフィール情報を収集します。
const { url } = await stripe.accountLinks.create({ type: 'account_onboarding', account: accountId, refresh_url: host + '/onboard', return_url: host + '/onboard', collect: 'eventually_due', });

アカウント残高

アカウント残高カードは stripe.treasury.financialAccounts.list API のみを使用します。

const financialAccounts = await stripe.treasury.financialAccounts.list({ stripeAccount: StripeAccountID, }); const financialAccount = financialAccounts.data[0];

The payload of the above command contains a balance object consisting of the current balance (cash) and outbound funds.

{ "id": "fa_...", ... "balance": { "cash": { "usd": 534214 }, "inbound_pending": { "usd": 0 }, "outbound_pending": { "usd": 2200 } }, ... "supported_currencies": [ "usd" ] }

入出金チャート

資金移動チャートは stripe.treasury.transactions.list API のみを使用します。

const fa_transactions = await stripe.treasury.transactions.list( { financial_account: financialAccount.id, order_by: 'created', limit: 100, }, {stripeAccount: StripeAccountID}, );

レスポンスは、プラス/マイナスの残高および作成日でグループ化されます。その後、データは ApexCharts に移植され、売上フローの動的な表示が作成されます。

{ "id": "{{TRANSACTION_ID}}", "object": "treasury.transaction", "created": "{{T}}", ... "flow": "{{OUTBOUND_PAYMENT_ID}}", "flow_type": "outbound_payment", "status": "open", "amount": -1000, "currency": "usd", "balance_impact": { "cash": -1000, "inbound_pending": 0, "outbound_pending": 1000, }, "entries": { "data": [ { "id": "{{TRANSACTION_ENTRY_ID}}", "object": "treasury.transaction_entry", ... "created": "{{T}}", "effective_at": "{{T}}", "currency": "usd", "balance_impact": { "cash": -1000, "inbound_pending": 0, "outbound_pending": 1000, } } ], "has_more": false, "object": "list", "url": "/v1/treasury/transaction_entries?financial_account={{FINANCIAL_ACCOUNT_ID}}&transaction={{TRANSACTION_ID}}" } }

取引リスト

取引リストは stripe.treasury.transactions.list API を使用します。

const fa_transactions = await stripe.treasury.transactions.list( { financial_account: financialAccount.id, order_by: 'created', limit: 100, }, {stripeAccount: StripeAccountID}, );

transactions テーブルの列は、次のマッピングを使用して transaction オブジェクトから解析されます。

  • created → 日付
  • amount → 金額 / 通貨
  • flow_type → タイプ
  • status → ステータス
  • description → 説明

送金インターフェイス

The money sending feature in the sample app uses the Financial Accounts for platforms OutboundPayment feature. You can use OutboundPayments to send money to a third party’s external account.

const outboundPayment = await stripe.treasury.outboundPayments.create( { financial_account: financialAccount.id, amount: amount, currency: 'usd', statement_descriptor: req.descriptor, destination_payment_method_data: { type: 'us_bank_account', us_bank_account: { account_holder_type: 'individual', routing_number: '110000000', account_number: '000000000009', } } }, { stripeAccount: StripeAccountId }, );

Issuing カード保有者の作成

You must create a Cardholder before you can issue a card using Stripe Issuing to spend funds from the financial account. Use the stripe.issuing.cardholders.create API to create cardholders.

const cardholder = await stripe.issuing.cardholders.create( { type: 'individual', name: firstName + ' ' + lastName, email: email, individual: { first_name: firstName, last_name: lastName, dob: {day: day, month: month, year: year} }, billing: { address: { city: city, line1: address1, state: state, postal_code: postalCode, country: country, }, }, }, { stripeAccount: StripeAccountId, } );

カードを発行する

Cardholder を作成した後、stripe.issuing.cards.create API を使用して Cardholder にカードを発行できます。

const card = await stripe.issuing.cards.create( { cardholder: req.body.cardholderid, financial_account: financialAccount.id, currency: 'usd', type: 'virtual', status: 'active', }, {stripeAccount: StripeAccountId}, );

カードのリスト

stripe.issuing.cards.list API からのデータを使用して、カードのリストをレンダリングします。

const cards = await stripe.issuing.cards.list( {limit: 10}, {stripeAccount: StripeAccountID}, );

カードのオーソリリスト

stripe.issuing.authorizations.list API を使用して、特定のカードのオーソリを取得します。次の例では、リストに表示するオーソリを最新の 10 件に制限しています。

const card_authorizations = await stripe.issuing.authorizations.list( { card: cardId, limit: 10, }, {stripeAccount: StripeAccountID}, );

authorization テーブルの列は、次のマッピングを使用して response オブジェクトから解析されます。

  • created → 日付
  • amount → 金額 / 金額の通貨
  • card.cardholder.name → カードに記載されている名前
  • card.last4 → 末尾 4 桁
  • approved → 承認済み
  • status → ステータス
  • merchant_data.name → 加盟店
  • merchant_data.category → 加盟店カテゴリー

テストヘルパー

The sample app features test helpers that enable you to perform certain actions, such as funding your account, creating a payment link to collect funds in a connected account, and paying out funds to the financial account. You can access most of the test helpers by clicking the Generate Test Data button or clicking Test Data.

受領したクレジットのテストヘルパー

In testing environments, you can add funds to a financial account using the ReceivedCredit Test Helpers. This test helper simulates receiving a transfer from an external bank account into your financial account.

const receivedCredit = await stripe.testHelpers.treasury.receivedCredits.create( { amount: 50000, currency: 'usd', financial_account: financialAccount.id, network: 'ach', }, {stripeAccount: StripeAccountId}, );

決済フォームへのリンクと入金

You can use payment links to add funds to the connected account that’s associated with a financial account:

  1. 支払い完了後に連結アカウントに追加される金額を決定する Price を作成します。
const prices = await stripe.prices.list( { limit: 1, active: true, type: 'one_time', }, {stripeAccount: StripeAccountId,}, ); let price; if (prices.data.length < 1) { price = await stripe.prices.create( { unit_amount: 1000, currency: 'usd', product_data: { name: 'Unit', }, }, {stripeAccount: StripeAccountId,}, ); } else { price = prices.data[0]; }
  1. 価格を取得した後、Stripe は PaymentLink を作成し、お客様は決済を完了するために顧客をリダイレクトします。前のステップの Price id を使用して price パラメーターの値を設定します。デフォルト値を使用する場合は、このパラメーターを含めないでください。
const paymentLink = await stripe.paymentLinks.create( { line_items: [ { price: price.id, quantity: 1, adjustable_quantity: {enabled: true}, }, ], }, {stripeAccount: StripeAccountId,}, );

連結アカウントの支払い残高からの入金

Payouts can send funds from a connected account’s payments balance to their financial account. Do the following to execute a payout:

  1. 連結アカウント用に外部口座が設定されているかどうかを確認します。そのためには、accounts.retrieve API を使用して、Account オブジェクト を取得し、external_account プロパティが設定されているかどうかを確認します。
const responseAccount = await stripe.accounts.retrieve(StripeAccountID); const accountExternalAccount = responseAccount.external_accounts.data[0]; let hasExternalAccount = false; if (accountExternalAccount) { hasExternalAccount = true; }
  1. If the connected account doesn’t have an external account, they can set up the financial account as their external account.
const financialAccounts = await stripe.treasury.financialAccounts.list( {expand: ['data.financial_addresses.aba.account_number']}, { stripeAccount: StripeAccountId, }, ); const financialAccount = financialAccounts.data[0]; await stripe.accounts.createExternalAccount(StripeAccountId, { external_account: { object: 'bank_account', country: 'US', currency: 'usd', account_number: financialAccount.financial_addresses[0].aba.account_number, routing_number: financialAccount.financial_addresses[0].aba.routing_number, }, });
  1. Initiate a payout to the connected account’s external account. In this case, the external account is the financial account.
const balance = await stripe.balance.retrieve({ stripeAccount: StripeAccountId, }); const payout = await stripe.payouts.create( { amount: balance.available[0].amount, currency: 'usd', }, {stripeAccount: StripeAccountId}, );
このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • 早期アクセスプログラムにご参加ください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM ですか?llms.txt を読んでください。
  • Powered by Markdoc