Sample - Stripe API
POST/v1/application_fees/{id}/refund

Create an application fee refund

Creates a refund for an application fee that your account previously collected. Use amount for a partial refund and omit it when the API should refund the applicable remaining amount; an application fee cannot be refunded beyond its unrefunded amount.

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

1 parameter · 3 body fields
idstringrequired
The unique identifier of the application fee to refund. Maximum 5000 characters.

Optional form-encoded refund parameters.

amountintegeroptional
The refund amount in cents or the local currency equivalent when supplied.
directivestringoptional
A refund directive. Maximum 5000 characters.
expandarray<string>optional
Specifies which fields in the response should be expanded.

2 status codes
200Returns the created application fee refund with its amount, currency, fee identifier, balance transaction, metadata, and creation time.
accountstringrequired
ID of the Stripe account this fee was taken from.
amountintegerrequired
Amount earned, in cents (or local equivalent).
amount_refundedintegerrequired
Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued)
applicationstringrequired
ID of the Connect application that earned the fee.
balance_transactionstringoptional
Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds).
chargestringrequired
ID of the charge that the application fee was taken from.
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).
fee_sourceobjectoptional
Polymorphic source of the application fee. Includes the ID of the object the application fee was created from.
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`.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
Allowed:application_fee
originating_transactionstringoptional
ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter.
refundedbooleanrequired
Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false.
refundsobjectrequired
A list of refunds that have been applied to the fee.
defaultError response.
errorobjectrequired

Error handling

id must identify the application fee and cannot exceed 5000 characters. directive and each expand value must be no more than 5000 characters, and amount is an integer representing the refund amount when supplied.