Sample - Stripe API
POST/v1/charges/{charge}/refunds

Create a refund

Creates a refund for a previously created charge. Specify the target charge in charge, and optionally refund only part of the remaining amount or refund a PaymentIntent. You can create multiple partial refunds until the charge is fully refunded.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.
  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 11 body fields
chargestringrequired
The identifier of the charge to refund. Maximum 5,000 characters.

Optional refund details, including the amount, destination, reason, and associated metadata.

amountintegeroptional
The amount to refund in the smallest currency unit. Omit to refund the remaining charge amount.
currencystringoptional
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customerstringoptional
Customer whose customer balance to refund from.
expandarray<string>optional
Specifies which fields in the response should be expanded.
instructions_emailstringoptional
For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
originstringoptional
Origin of the refund
Allowed:customer_balance
payment_intentstringoptional
The identifier of the PaymentIntent to refund.
reasonstringoptional
String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://docs.stripe.com/radar/lists), and will also help us improve our fraud detection algorithms.
Allowed:duplicatefraudulentrequested_by_customer
refund_application_feebooleanoptional
Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge.
reverse_transferbooleanoptional
Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount).<br><br>A transfer can be reversed only by the application that created the charge.

2 status codes
200Returns the created refund object, including its amount, currency, charge, creation time, identifier, and refund status.
amountintegerrequired
Amount, in cents (or local equivalent).
balance_transactionstringoptional
Balance transaction that describes the impact on your account balance.
chargestringoptional
ID of the charge that's refunded.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
currencystringrequired
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
customerstringoptional
ID of the customer of this refund.
customer_accountstringoptional
ID of the account of this refund.
descriptionstringoptional
An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only).
destination_detailsobjectoptional
failure_balance_transactionstringoptional
After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
failure_reasonstringoptional
Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`.
idstringrequired
Unique identifier for the object.
instructions_emailstringoptional
For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.
metadataobjectoptional
Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
next_actionobjectoptional
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:refund
payment_intentstringoptional
ID of the PaymentIntent that's refunded.
payment_methodstringoptional
ID of the payment method associated with this refund.
pending_reasonstringoptional
Provides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`.
Allowed:charge_pendinginsufficient_fundsprocessing
presentment_detailsobjectoptional
reasonstringoptional
Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).
Allowed:duplicateexpired_uncaptured_chargefraudulentrequested_by_customer
receipt_numberstringoptional
This is the transaction number that appears on email receipts sent for this refund.
source_transfer_reversalstringoptional
The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account.
statusstringoptional
Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://docs.stripe.com/refunds#failed-refunds).
transfer_reversalstringoptional
This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter.
defaultReturned when the refund request cannot be processed, including when the charge has already been fully refunded or the requested amount exceeds the remaining refundable amount.
errorobjectrequired

Error handling

charge must identify the charge to refund, and payment_intent can identify the PaymentIntent when applicable. currency must be a supported lowercase ISO currency code, and reason must be one of: duplicate, fraudulent, or requested_by_customer. origin accepts only customer_balance.