Cancel a PaymentIntent
POST
/v1/payment_intents/{id}/cancelA PaymentIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action.
Once canceled, no additional charges will be made by the PaymentIntent and any operations on the PaymentIntent will fail with an error. For PaymentIntents with status=’requires_capture’, the remaining amount_capturable will automatically be refunded.
You cannot cancel the PaymentIntent for a Checkout Session. Expire the Checkout Session instead.
请求参数
Path 参数
id
string
必需
Body 参数application/json
cancellation_reason
string
必需
Reason for canceling this PaymentIntent.
示例
{
"cancellation_reason": "customer cancelled"
}
示例代码
返回响应
OK(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
数据结构
object {0}
示例
未设置
最后修改时间: 4 个月前