メインコンテンツまでスキップ

ペイメントインテントの作成

Payment Intent を作成したら、支払い方法を紐付け、Intent を確認して取引を完了させてください。

作成時に confirm=true を指定すると、1回の呼び出しでペイメントインテントの作成と確認を同時に行うことになります。confirm=true を指定すると、confirm API のあらゆるパラメータを使用できるようになります。

POST https://api.stripe.com/v1/payment_intents

注記

confirmリクエストは、必ずHTTPS経由で送信する必要があります。

cURL の例:

cURL
curl -X POST https://api.stripe.com/v1/payment_intents \
-u <YOUR_SECRET_KEY>: \
-d "amount=212&currency=usd&payment_method=pm_card_visa&confirm=true"

レスポンス

レスポンスには標準コードが返されます。

200: OK

Response
{
"id": "pi_3Rsx4dDtWMrPDtgt0mUrePJ9",
"object": "payment_intent",
"amount": 212,
"amount_capturable": 0,
"amount_details": {
"tip": {}
},
"amount_received": 0,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": {
"allow_redirects": "always",
"enabled": true
},
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic_async",
"client_secret": "pi_3Rsx4dDtWMrPDtgt0mUrePJ9_secret_7sqfufxuIYiBhbw52Vi51Z47o",
"confirmation_method": "automatic",
"created": 1754447247,
"currency": "usd",
"customer": null,
"description": null,
"last_payment_error": null,
"latest_charge": null,
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": null,
"payment_method_configuration_details": {
"id": "pmc_1RsGk1DtWMrPDtgtcaQ0d3Sg",
"parent": null
},
"payment_method_options": {
"amazon_pay": {
"express_checkout_element_session_id": null
},
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
},
"cashapp": {},
"klarna": {
"preferred_locale": null
},
"link": {
"persistent_token": null
}
},
"payment_method_types": [
"card",
"klarna",
"link",
"cashapp",
"amazon_pay"
],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "requires_payment_method",
"transfer_data": null,
"transfer_group": null
}

エラー応答

400: Bad Request

Response
{
"error": {
"code": "parameter_invalid_integer",
"doc_url": "https://stripe.com/docs/error-codes/parameter-invalid-integer",
"message": "Invalid integer: <integer>",
"param": "amount",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_UQf6XBwBl9yk66?t=1734829676",
"type": "invalid_request_error"
}
}

401: Unauthorized

Response
{
"error": {
"type": "invalid_request_error",
"message": "Invalid API Key provided: sk_test_********************1234"
}
}

パラメータ

ボディパラメータ
パラメータタイプ説明
amount整数(必須) 請求する合計金額。通貨の最小単位で表記された正の整数を入力してください(例:$1.00 の場合は 100 セント)。
currency文字列(必須) 3文字のISO通貨コード(小文字)。サポートされている通貨である必要があります。
confirmブール値この PaymentIntent を直ちに確認しようとする場合は、true に設定してください。
customer文字列この PaymentIntent が属する顧客の ID(存在する場合)。
description文字列オブジェクトに付加される任意の文字列。
payment_method文字列この PaymentIntent に紐付ける決済手段の ID。
payment_method_types[]文字列の配列この PaymentIntent で使用可能な決済方法の種類のリスト。
shippingオブジェクトPaymentIntent の配送情報。
statement_descriptor文字列顧客のクレジットカード明細に表示される任意の文字列。
statement_descriptor_suffix文字列顧客のクレジットカード明細に表示される追加情報の詳細について説明します。
expand[]文字列の配列ネストされたレスポンスオブジェクトを特定し、情報を追加してインラインで返します。