コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
複数の通貨を扱う
カスタムの決済フロー
    概要
    既存の顧客の支払い
    支払いのオーソリとキャプチャーを分離する
    2 段階決済フローを構築
    インテントを作成する前に支払いの詳細を収集
    サーバーで支払いを確定する
    通信販売 / 電話販売 (MOTO) の受け付け
    アメリカとカナダのカード
    サードパーティーの API エンドポイントにカード情報を転送する
    支払い項目
      柔軟な決済シナリオ
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
決済にとどまらない機能
会社を設立する
仮想通貨
Financial Connections
Climate
不正利用について
Radar の不正防止
不審請求の申請の管理
本人確認
ホーム支払い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
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
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": [ { "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を成功状態に移行します(final_captureのデフォルトはtrueであるため)。
  • 以前のキャプチャーに amount_details または amount_details[line_items] が含まれている場合は、後続のキャプチャーにそれらを引き続き含める必要があります。
  • 以前のキャプチャーにこれらのフィールドが含まれていなかった場合、以降のキャプチャーでフィールドを追加することはできません。
Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
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": [ { "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" } } } ] }, "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
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": [ { "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 をキャプチャする

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

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

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node
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": [ { "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" } } } ] }, "status": "succeeded" ... }
このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • 早期アクセスプログラムにご参加ください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM ですか?llms.txt を読んでください。
  • Powered by Markdoc