コンテンツにスキップ
アカウント作成/サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成サインイン
導入方法
決済管理
売上管理
プラットフォームとマーケットプレイス
資金管理
開発者向けリソース
API & SDKヘルプ
概要決済を受け付ける構築済みのシステムをアップグレード
オンライン決済
概要ユースケースを見つける
Payment Links を使用する
事前構築済みの決済ページを使用する
Elements を使用したカスタム統合の構築
アプリ内実装を構築
Managed Payments を使用する継続課金
対面決済
Terminal
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
決済業務
アナリティクス
残高と売上処理にかかる期間
コンプライアンスとセキュリティ
通貨
支払い拒否
不審請求の申請
不正利用防止
Radar の不正防止
入金
領収書返金とキャンセル
高度な連携システム
カスタムの決済フロー
    概要
    既存の顧客の支払い
    支払いのオーソリとキャプチャーを分離する
    2 段階決済フローを構築
    インテントを作成する前に支払いの詳細を収集
    サーバーで支払いを確定する
    通信販売 / 電話販売 (MOTO) の受け付け
    アメリカとカナダのカード
    サードパーティーの API エンドポイントにカード情報を転送する
    支払い項目
      柔軟な決済シナリオ
    業種メタデータ
柔軟なアクワイアリング
複数の決済代行業者のオーケストレーション
決済以外の機能
会社を設立する
暗号資産
エージェント型コマース
Financial Connections
Climate
本人確認
アメリカ
日本語
ホーム決済管理Custom payment flowsPayments line items

柔軟な支払いに支払いラインアイテムを使用する

マルチキャプチャーやオーバーキャプチャーなどの複雑な決済で支払いラインアイテムを使用する方法をご紹介します。

マルチキャプチャやオーバーキャプチャなどの 複雑な決済 に支払いラインアイテムを使用できます。

Multicapture

決済項目は、マルチキャプチャー中に使用できます。

メモ

KlarnaまたはPayPalではマルチキャプチャーはサポートされていません。

未キャプチャーの PaymentIntent を作成して確定する

メモ

APIレスポンスには、デフォルトではライン項目は含まれません。ライン項目を返すには、amount_details.line_items を拡張します。

PaymentIntentの作成時にcapture_methodをmanualとして指定し、if_availableパラメーターを使用してこの決済のマルチキャプチャーをリクエストします。作成される PaymentIntent では、支払い方法がサポートしている場合に、マルチキャプチャーが許可されます。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=4600 \ -d currency=usd \ -d "payment_method_types[0]"=card \ -d payment_method=pm_card_visa \ -d "payment_method_options[card][request_multicapture]"=if_available \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=200 \ -d "amount_details[tax][total_tax_amount]"=400 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=400 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d "amount_details[line_items][1][product_code]"=SKU002 \ -d "amount_details[line_items][1][product_name]"="Product 002" \ -d "amount_details[line_items][1][unit_cost]"=2000 \ -d "amount_details[line_items][1][quantity]"=1 \ -d "amount_details[line_items][1][unit_of_measure]"=gallons \ -d "amount_details[line_items][1][payment_method_options][card][commodity_code]"=123123 \ -d confirm=true \ -d capture_method=manual \ -d "expand[0]"="amount_details.line_items"

レスポンスでは、amount_details フィールドに PaymentIntent で指定されたライン項目が含まれます。

{ "amount": 4600, "amount_capturable": 4600, "amount_received": 0, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 400 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 400 }, "line_items": [ { "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } ... }

PaymentIntent をキャプチャする

  • amount_details は、作成時に指定されていない場合でも、最初のキャプチャーに追加できます。
  • 作成時にamount_detailsを指定した場合は、最初のキャプチャー時にamount_detailsを渡すか、設定を解除する必要があります。

同じルールがamount_details[line_items]にも適用されます。作成時に指定されていない場合は、最初のキャプチャーで追加できますが、作成時に指定されていた場合は、追加するか明示的に設定解除する必要があります。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents/pi_xxxxxxxx/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount_to_capture=2300 \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=100 \ -d "amount_details[tax][total_tax_amount]"=200 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=200 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d final_capture=false \ -d "expand[0]"="amount_details.line_items"

レスポンスのamount_detailsフィールドには、最初のキャプチャーで指定されたライン項目が含まれます。

{ "amount": 4600, "amount_capturable": 2300, "amount_received": 2300, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 100, "tax": { "total_tax_amount": 200 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 200 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_123", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } }, "status": "requires_capture" ... }

PaymentIntent のステータスは requires_capture のままです。この時点で、次のいずれかを実行できます。

  • PaymentIntent の全額まで PaymentIntent を複数回キャプチャーします。
  • final_capture を true に設定するか、final_capture パラメーターを指定せずにキャプチャーを行うことで、PaymentIntent を succeeded 状態に移行します (final_capture のデフォルトは true であるため)。
  • 以前のキャプチャーに amount_details または amount_details[line_items] が含まれている場合は、後続のキャプチャーにそれらを引き続き含める必要があります。
  • 以前のキャプチャーにこれらのフィールドが含まれていなかった場合、以降のキャプチャーでフィールドを追加することはできません。
Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents/pi_xxxxxxxx/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount_to_capture=2300 \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=100 \ -d "amount_details[tax][total_tax_amount]"=200 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=200 \ -d "amount_details[line_items][0][product_code]"=SKU002 \ -d "amount_details[line_items][0][product_name]"="Product 002" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=gallons \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d final_capture=false \ -d "expand[0]"="amount_details.line_items"

レスポンスの amount_details フィールドには、以下のルールに従って、最初の 2 件のキャプチャーのライン項目が含まれます。

  • discount_amount、tax.total_tax_amount、shipping.amount はキャプチャー全体で合計されます。
  • キャプチャーでは shipping.from_postal_code と shipping.to_postal_code が省略されることがありますが、指定されている場合はキャプチャー間で変更しないでください。
  • line_items はキャプチャー全体で集計されます。
{ "amount": 4600, "amount_capturable": 0, "amount_received": 4600, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 400 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 400 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_123", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "_id": "li_234", "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } }, "status": "succeeded" ... }

オーバーキャプチャー

決済項目は、オーバーキャプチャー中に使用できます。

未キャプチャーの PaymentIntent を作成して確定する

メモ

APIレスポンスには、デフォルトではライン項目は含まれません。ライン項目を返すには、amount_details.line_items を拡張します。

PaymentIntent の作成時に capture_method を manual として指定し、if_available パラメーターを使用して、この決済のオーバーキャプチャーをリクエストします。作成された PaymentIntent では、決済手段がサポートしている場合にオーバーキャプチャーが許可されます。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=4600 \ -d currency=usd \ -d "payment_method_types[0]"=card \ -d payment_method=pm_card_visa \ -d "payment_method_options[card][request_overcapture]"=if_available \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=200 \ -d "amount_details[tax][total_tax_amount]"=400 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=400 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d "amount_details[line_items][1][product_code]"=SKU002 \ -d "amount_details[line_items][1][product_name]"="Product 002" \ -d "amount_details[line_items][1][unit_cost]"=2000 \ -d "amount_details[line_items][1][quantity]"=1 \ -d "amount_details[line_items][1][unit_of_measure]"=gallons \ -d "amount_details[line_items][1][payment_method_options][card][commodity_code]"=123123 \ -d confirm=true \ -d capture_method=manual \ -d "expand[0]"="amount_details.line_items"

レスポンスでは、amount_details フィールドに PaymentIntent で指定されたライン項目が含まれます。

{ "amount": 4600, "amount_capturable": 4600, "amount_received": 0, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 400 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 400 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_345", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "_id": "li_456", "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } } ... }

PaymentIntent をキャプチャする

PaymentIntent で現在オーソリゼーションされている金額を超える金額をキャプチャーするには、 capture エンドポイントを使用し、maximum_amount_capturable までの amount_to_capture を指定します。

キャプチャー中のキャプチャー金額と整合性のとれた更新後の amount_details ハッシュを渡します。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents/pi_xxxxxxxx/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount_to_capture=5000 \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=200 \ -d "amount_details[tax][total_tax_amount]"=600 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=600 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d "amount_details[line_items][1][product_code]"=SKU002 \ -d "amount_details[line_items][1][product_name]"="Product 002" \ -d "amount_details[line_items][1][unit_cost]"=2000 \ -d "amount_details[line_items][1][quantity]"=1 \ -d "amount_details[line_items][1][unit_of_measure]"=gallons \ -d "amount_details[line_items][1][payment_method_options][card][commodity_code]"=123123 \ -d "expand[0]"="amount_details.line_items"

レスポンスの amount_details フィールドには、キャプチャー中に指定された項目が含まれます。

{ "amount": 5000, "amount_capturable": 0, "amount_received": 5000, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 600 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 600 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_567", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "_id": "li_678", "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } }, "status": "succeeded" ... }

増分オーソリ

増分オーソリ中に決済明細項目を使用して、最初のオーソリ後に PaymentIntent で追加の金額をオーソリできます。

未キャプチャーの PaymentIntent を作成して確定する

メモ

APIレスポンスには、デフォルトではライン項目は含まれません。ライン項目を返すには、amount_details.line_items を拡張します。

PaymentIntent の作成時に capture_method を manual として指定し、if_available パラメーターを使用して、この決済の増分オーソリをリクエストします。作成された PaymentIntent では、決済手段がサポートしている場合に増分オーソリが許可されます。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=4600 \ -d currency=usd \ -d "payment_method_types[0]"=card \ -d payment_method=pm_card_visa \ -d "payment_method_options[card][request_incremental_authorization]"=if_available \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=200 \ -d "amount_details[tax][total_tax_amount]"=400 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=400 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d "amount_details[line_items][1][product_code]"=SKU002 \ -d "amount_details[line_items][1][product_name]"="Product 002" \ -d "amount_details[line_items][1][unit_cost]"=2000 \ -d "amount_details[line_items][1][quantity]"=1 \ -d "amount_details[line_items][1][unit_of_measure]"=gallons \ -d "amount_details[line_items][1][payment_method_options][card][commodity_code]"=123123 \ -d confirm=true \ -d capture_method=manual \ -d "expand[0]"="amount_details.line_items"

レスポンスでは、amount_details フィールドに PaymentIntent で指定されたライン項目が含まれます。

{ "amount": 4600, "amount_capturable": 4600, "amount_received": 0, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 400 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 400 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_789", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "_id": "li_890", "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } } ... }

オーソリを増やす

PaymentIntent で当初のオーソリ金額を超える金額をオーソリするには、increment_authorization エンドポイントを使用し、決済手段でサポートされている最大増分オーソリ金額を上限とする amount を指定します。

増分後のオーソリされた合計金額と整合性の取れた、更新後の amount_details ハッシュを渡します。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents/pi_xxxxxxxx/increment_authorization \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=5000 \ -d "payment_details[customer_reference]"=customer_reference \ -d "payment_details[order_reference]"=order_reference \ -d "amount_details[discount_amount]"=200 \ -d "amount_details[tax][total_tax_amount]"=600 \ -d "amount_details[shipping][from_postal_code]"=94110 \ -d "amount_details[shipping][to_postal_code]"=94117 \ -d "amount_details[shipping][amount]"=600 \ -d "amount_details[line_items][0][product_code]"=SKU001 \ -d "amount_details[line_items][0][product_name]"="Product 001" \ -d "amount_details[line_items][0][unit_cost]"=2000 \ -d "amount_details[line_items][0][quantity]"=1 \ -d "amount_details[line_items][0][unit_of_measure]"=feet \ -d "amount_details[line_items][0][payment_method_options][card][commodity_code]"=123123 \ -d "amount_details[line_items][1][product_code]"=SKU002 \ -d "amount_details[line_items][1][product_name]"="Product 002" \ -d "amount_details[line_items][1][unit_cost]"=2000 \ -d "amount_details[line_items][1][quantity]"=1 \ -d "amount_details[line_items][1][unit_of_measure]"=gallons \ -d "amount_details[line_items][1][payment_method_options][card][commodity_code]"=123123 \ -d "expand[0]"="amount_details.line_items"

レスポンスの amount_details フィールドには、増分オーソリ時に指定された明細項目が含まれ、PaymentIntent のオーソリされた合計金額が更新されます。

{ "amount": 5000, "amount_capturable": 5000, "amount_received": 0, "payment_details": { "customer_reference": "customer_reference", "order_reference": "order_reference" }, "amount_details": { "discount_amount": 200, "tax": { "total_tax_amount": 600 }, "shipping": { "from_postal_code": "94110", "to_postal_code": "94117", "amount": 600 }, "line_items": { "object": "list", "url": "/v1/payment_intents/pi_xxxxxxxx/amount_details_line_items", "has_more": false, "data": [ { "_id": "li_901", "product_code": "SKU001", "product_name": "Product 001", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "feet", "payment_method_options": { "card": { "commodity_code": "123123" } } }, { "_id": "li_012", "product_code": "SKU002", "product_name": "Product 002", "unit_cost": 2000, "quantity": 1, "unit_of_measure": "gallons", "payment_method_options": { "card": { "commodity_code": "123123" } } } ] } }, "status": "requires_capture" ... }
このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM ですか?llms.txt を読んでください。
  • Powered by Markdoc