Skip to main content
POST
Create a refund

Authorizations

Authorization
string
header
required

Your secret key, e.g. sk_live_... or sk_sandbox_....

Headers

X-Idempotency-Key
string

Optional key, 8 to 128 characters, that makes this request safe to retry. The first response is stored for 24 hours; a repeat returns it unchanged with X-Idempotent-Replayed: true.

Required string length: 8 - 128

Path Parameters

paymentIntentId
string
required

The payment intent id.

Body

application/json
amount
integer
required

Amount in major units, at most the intent's refunds_summary.refundable_amount.

Required range: x >= 1
Example:

50

reason
enum<string>
required
Available options:
requested_by_customer,
duplicate,
fraudulent,
product_not_received,
product_unsatisfactory,
order_cancelled,
other
note
string
Maximum string length: 500
metadata
object

Up to 10 key/value pairs of your own, returned unchanged.

Example:
allow_payout
boolean

Allow the refund to go out as a payout to the original payer. Requires the corresponding project setting.

Response

Refund created.

message
string
data
object