Skip to content

Stripe: Create a refund — charges post Charges Charge Refunds

Stripe charges.postChargesChargeRefunds: arguments, response, policy and SDK examples.

← Charges operations · Get started

Operation stripe.postchargeschargerefunds

Provider route: POST /v1/charges/{charge}/refunds. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/stripe with npm, or alter-sdk-stripe with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { StripeIntegration } from "@alter-ai/stripe";
async function execute(input: Parameters<StripeIntegration["charges"]["postChargesChargeRefunds"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new StripeIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.charges.postChargesChargeRefunds(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_stripe import StripeIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = StripeIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.charges.post_charges_charge_refunds(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.chargestringRequired within parentMaximum length: 5000
headersobjectOptionalAdditional keys: not allowed
headers.Idempotency-KeystringOptionalMinimum length: 1
Maximum length: 255
bodyobjectOptionalAdditional keys: not allowed
body.amountintegerOptional
body.currencystringOptionalThree-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).
Format: currency
body.customerstringOptionalCustomer whose customer balance to refund from.
Maximum length: 5000
body.expandarrayOptionalSpecifies which fields in the response should be expanded.
body.expand[]stringEach itemMaximum length: 5000
body.instructions_emailstringOptionalFor payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions.
body.metadataJSONOptionalSet 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`.
body.metadata (anyOf 1)objectAlternativeAdditional keys: see wildcard field
body.metadata (anyOf 1).*stringAdditional keys
body.metadata (anyOf 2)stringAlternativeOne of:
body.originstringOptionalOrigin of the refund
One of: customer_balance
body.payment_intentstringOptionalThe identifier of the PaymentIntent to refund.
Maximum length: 5000
body.reasonstringOptionalString 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.
One of: duplicate, fraudulent, requested_by_customer
Maximum length: 5000
body.refund_application_feebooleanOptionalBoolean 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.
body.reverse_transferbooleanOptionalBoolean 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.

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Cancel a refund — response body

Referenced models: Cancel a refund — response body

706 more schemas are linked from the tables above, on the schema pages.

Cancel a refund — response body
FieldTypePresenceDescription and constraints
$objectRootRefund objects allow you to refund a previously created charge that isn't
refunded yet. Funds are refunded to the credit or debit card that's
initially charged.

Related guide: [Refunds](https://docs.stripe.com/refunds)
amountJSONRequired within parent
amount (anyOf 1)integerAlternativeAmount, in cents (or local equivalent).
amount (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
balance_transactionJSONOptional
balance_transaction (anyOf 1)JSONAlternativeBalance transaction that describes the impact on your account balance.
balance_transaction (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
balance_transaction (anyOf 1) (anyOf 2)ModelAlternativeExpand Retrieve a balance transaction — balance get Balance History Id — response body
balance_transaction (anyOf 2)nullAlternative
chargeJSONOptional
charge (anyOf 1)JSONAlternativeID of the charge that's refunded.
charge (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
charge (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a charge — response body
charge (anyOf 2)nullAlternative
createdJSONRequired within parent
created (anyOf 1)integerAlternativeTime at which the object was created. Measured in seconds since the Unix epoch.
Format: unix-time
created (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
currencystringRequired within parentThree-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).
Format: currency
customerJSONOptional
customer (anyOf 1)JSONAlternativeID of the customer of this refund.
customer (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
customer (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a customer — response body
customer (anyOf 1) (anyOf 3)ModelAlternativeExpand Delete a customer — response body
customer (anyOf 2)nullAlternative
customer_accountJSONOptional
customer_account (anyOf 1)stringAlternativeID of the account of this refund.
Maximum length: 5000
customer_account (anyOf 2)nullAlternative
descriptionstringOptionalAn arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only).
Maximum length: 5000
destination_detailsModelOptionalExpand Cancel a refund — response body — destination details
failure_balance_transactionJSONOptionalAfter the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.
failure_balance_transaction (anyOf 1)stringAlternativeMaximum length: 5000
failure_balance_transaction (anyOf 2)ModelAlternativeExpand Retrieve a balance transaction — balance get Balance History Id — response body
failure_reasonstringOptionalProvides 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`.
Maximum length: 5000
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
instructions_emailstringOptionalFor payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions.
Maximum length: 5000
metadataJSONOptional
metadata (anyOf 1)objectAlternativeSet 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.
Additional keys: see wildcard field
metadata (anyOf 1).*stringAdditional keysMaximum length: 500
metadata (anyOf 2)nullAlternative
next_actionModelOptionalExpand Cancel a refund — response body — next action
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: refund
payment_intentJSONOptional
payment_intent (anyOf 1)JSONAlternativeID of the PaymentIntent that's refunded.
payment_intent (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
payment_intent (anyOf 1) (anyOf 2)ModelAlternativeExpand Cancel a Payment Intent — response body
payment_intent (anyOf 2)nullAlternative
payment_methodJSONOptional
payment_method (anyOf 1)JSONAlternativeID of the payment method associated with this refund.
payment_method (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
payment_method (anyOf 1) (anyOf 2)ModelAlternativeExpand Create a Payment Method — response body
payment_method (anyOf 2)nullAlternative
pending_reasonstringOptionalProvides the reason for why the refund is pending. Possible values are: `processing`, `insufficient_funds`, or `charge_pending`.
Known values: charge_pending, insufficient_funds, processing
presentment_detailsModelOptionalExpand Cancel a refund — response body — presentment details
reasonJSONOptional
reason (anyOf 1)stringAlternativeReason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).
Known values: duplicate, expired_uncaptured_charge, fraudulent, requested_by_customer
reason (anyOf 2)nullAlternative
receipt_numberJSONOptional
receipt_number (anyOf 1)stringAlternativeThis is the transaction number that appears on email receipts sent for this refund.
Maximum length: 5000
receipt_number (anyOf 2)nullAlternative
source_transfer_reversalJSONOptional
source_transfer_reversal (anyOf 1)JSONAlternativeThe transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account.
source_transfer_reversal (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
source_transfer_reversal (anyOf 1) (anyOf 2)ModelAlternativeExpand Update a reversal — response body
source_transfer_reversal (anyOf 2)nullAlternative
statusJSONOptional
status (anyOf 1)stringAlternativeStatus 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).
Maximum length: 5000
status (anyOf 2)nullAlternative
transfer_reversalJSONOptional
transfer_reversal (anyOf 1)JSONAlternativeThis refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter.
transfer_reversal (anyOf 1) (anyOf 1)stringAlternativeMaximum length: 5000
transfer_reversal (anyOf 1) (anyOf 2)ModelAlternativeExpand Update a reversal — response body
transfer_reversal (anyOf 2)nullAlternative

Referenced models: Retrieve a balance transaction — balance get Balance History Id — response body, Create a charge — response body, Create a customer — response body, Delete a customer — response body, Cancel a refund — response body — presentment details, Cancel a Payment Intent — response body, Create a Payment Method — response body, Cancel a refund — response body — destination details, Cancel a refund — response body — next action, Update a reversal — response body

Delete a customer — response body
FieldTypePresenceDescription and constraints
$objectRoot
deletedbooleanRequired within parentAlways true for a deleted object
Known values: True
idstringRequired within parentUnique identifier for the object.
Maximum length: 5000
objectstringRequired within parentString representing the object's type. Objects of the same type share the same value.
Known values: customer
Cancel a Setup Intent — response body — managed payments value enabled
FieldTypePresenceDescription and constraints
$objectRoot
enabledbooleanRequired within parentSet to `true` to enable [Managed Payments](https://docs.stripe.com/payments/managed-payments), Stripe's merchant of record solution, for this session.

SDK function policy ID: stripe.postchargeschargerefunds. Catalog operation: PostChargesChargeRefunds. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"Stripe-Version": "2026-09-30.endive"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.