Create a refund
POST
/v1/refundsWhen you create a new refund, you must specify a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded.
Once entirely refunded, a charge can’t be refunded again. This method will return an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge.
请求参数
A positive integer in cents representing how much of this charge to refund. Can refund only up to the remaining, unrefunded amount of the charge.
A set of key-value pairs that you can attach to a Refund object. This can be useful for storing additional information about the refund in a structured format. You can unset individual keys if you POST an empty value for that key. You can clear all keys if you POST an empty value for metadata
ID of the PaymentIntent to refund.
String indicating the reason for the refund. If set, possible values are duplicate , fraudulent , and requested_by_customer.
{
"reason": "requested_by_customer",
"payment_intent": "pi_1787730829493927936"
}
示例代码
Responses
{}