共有決済トークン非公開プレビュー
共有決済トークンを作成して使用する方法をご紹介します。
To receive payments facilitated by an application or AI agent, you need a secure mechanism to handle payment details collected by the agent and sent to you, the seller.
A Shared Payment Token is a limited reference to a PaymentMethod that’s stored in the agent’s Stripe account. An agent creates and shares a Shared Payment Token with a seller. They have usage limits and expiry windows, and never reveal PANs or other raw credentials. You can use Shared Payment Tokens directly in PaymentIntent flows, and outside of Stripe through virtualization.
共有決済トークンを作成する
SharedPaymentToken オブジェクトを作成するには、エージェントは、まず買い手から 決済の詳細を収集 します。
共有決済トークンを作成すると、売り手が使用できるように 支払い方法 の範囲を限定した付与が発行されます。通貨、最大金額、有効期限などのオプションを指定できます。
curl https://api.stripe.com/v1/shared_payment/issued_tokens \ -u "key:" \ -d payment_method={{PAYMENT_METHOD_ID}} \ -d "usage_limits[currency]"=usd \ -d "usage_limits[max_amount]"=10000 \ -d "usage_limits[expires_at]"=time_in_future \ -d "seller_details[network_id]"={{NETWORK_ID}} \ -d "seller_details[external_id]"={{EXTERNAL_ID}}
利用限度
usage_
パラメータを使用して最大金額と有効期限を指定し、取引の合計金額と一致するように最大金額を設定します。
売り手の詳細
seller_
パラメーターを使用して、お客様または別の売り手に共有決済トークンの範囲を指定します。
network_
売り手手のビジネスワーク ID。id: external_
共有決済トークンを特定の売り手、カート、またはその他の識別子にリンクするために指定できるオプションの識別子。たとえば、連結するプラットフォームがid: external_
を使用して、共有決済トークンの範囲を特定の売り手に設定できます。id
決済手段
payment_
パラメーターを使用して、使用する決済手段を指定します。
共有決済トークンを使用する
エージェントから SharedPaymentToken を受け取ったら、それを使用して PaymentIntent を作成して、決済を完了することができます。
curl https://api.stripe.com/v1/payment_intents \ -u "key:" \ -d amount=10000 \ -d currency=usd \ -d shared_payment_token=spt_123
When you confirm a PaymentIntent this way, the payment_
field automatically populates with a new PaymentMethod that’s reproduced from the one originally used by the buyer to create the Shared Payment Token. The replication process only transfers non-sensitive data, such as card and billing details, and excludes business-specific information such as metadata, customer data, previous addresses, and CVC check results.
返金やレポートなどの後続のすべてのイベントは、決済方法を直接指定したかのように動作します。
You can retrieve details about the Shared Payment Token you have been granted by the agent. You can view limited information about the underlying payment method (for example, card brand or the last 4 digits). The Shared Payment Tokens that you have been granted also include details on usage limits and may also include risk details.
curl https://api.stripe.com/v1/shared_payment/granted_tokens/{id}
リスクタイプ
以下の表に、エージェントが付与した共通決済トークンに関するリスクの詳細を示します。この情報を確認して、決済を作成する必要があるかどうかを判断します。
リスクの種類 | 説明 | スコアタイプ | 推奨事項 |
---|---|---|---|
Fraudulent dispute | Likelihood that the credential results in a fraudulent dispute. | 整数 | block または continue |
Card testing | クレデンシャルがカードテスティングである可能性が高い。 | フロート | block または continue |
Stolen card | 認証情報が盗難クレジットカードである可能性。 | 整数 | block または continue |
Card issuer decline | Likelihood that the card issuer declines the transaction. | フロート | block または continue |
Bot | 認証情報がボットによって使用されている可能性。 | フロート | block または continue |
Webhook
売り手が共通決済トークンを使用して決済処理すると、Stripe は売り手とエージェントにイベントを送信します。
イベント | 説明 | ユースケース |
---|---|---|
shared_ | エージェントは、共通決済トークンを使用する場合は、このイベントを受信します。 | このイベントをリッスンして、決済がプロセスされたことを買い手に通知します。 |
shared_ | このイベントは、共有決済トークンが使用されたときに受信します。 | このイベントをリッスンして、共有決済トークンが使用されたことを確認します。 |
共有決済トークンを取り消す
エージェントは、共通決済トークンをいつでも取り消すことができます。これにより、売り手が決済の作成に使用できなくなります。
curl -X POST https://api.stripe.com/v1/shared_payment/spt_123/revoke \ -u "key:"
Webhook
Stripe は、エージェントの共通決済トークンを取り消すか期限切れになると、売り手とエージェントにイベントを送信します。
イベント | 説明 | ユースケース |
---|---|---|
shared_ | 共通決済トークンが使用されました。イベントはエージェントに送信されました。 | このイベントをリッスンして、決済がプロセスされたことを買い手に通知します。 |
shared_ | 共有決済トークンが使用されました。売り手に送信されるイベント。 | このイベントをリッスンして、共有決済トークンが使用されたことを確認します。 |