Sample - Stripe API
POST/v1/test_helpers/issuing/transactions/{transaction}/refund

Refund a test-mode transaction

Refunds a test-mode Issuing transaction by creating a refund for the specified transaction. Provide the transaction identifier and optionally set refund_amount when you want to refund a specific amount. You can use expand to include additional response fields.

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

1 parameter · 2 body fields
transactionstringrequired
The unique identifier of the test-mode Issuing transaction to refund.

Optional form-encoded parameters controlling the refund amount and expanded response fields.

expandarray<string>optional
Specifies which fields in the response should be expanded.
refund_amountintegeroptional
The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).

2 status codes
200Returns the updated Issuing transaction representing the refund, including its amount, currencies, card, cardholder, balance transaction, merchant data, and status details.
amountintegerrequired
The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
amount_detailsobjectoptional
Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal).
authorizationstringoptional
The `Authorization` object that led to this transaction.
balance_transactionstringoptional
ID of the [balance transaction](https://docs.stripe.com/api/balance_transactions) associated with this transaction.
cardstringrequired
The card used to make this transaction.
cardholderstringoptional
The cardholder to whom this transaction belongs.
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).
disputestringoptional
If you've disputed the transaction, the ID of the dispute.
idstringrequired
Unique identifier for the object.
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
merchant_amountintegerrequired
The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency.
merchant_currencystringrequired
The currency with which the merchant is taking payment.
merchant_dataobjectrequired
metadataobjectrequired
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.
network_dataobjectoptional
Details about the transaction, such as processing dates, set by the card network.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:issuing.transaction
purchase_detailsobjectoptional
Additional purchase information that is optionally provided by the merchant.
tokenstringoptional
[Token](https://docs.stripe.com/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
treasuryobjectoptional
[Treasury](https://docs.stripe.com/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
typestringrequired
The nature of the transaction.
Allowed:capturerefund
walletstringoptional
The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`.
Allowed:apple_paygoogle_paysamsung_pay
defaultReturns an error object containing an `error` property with the error type and related diagnostic information.
errorobjectrequired

Error handling

transaction must be a string no longer than 5,000 characters identifying the transaction to refund. If provided, refund_amount must be an integer expressed in the provided currency's smallest unit, and each expand value must be no longer than 5,000 characters.