# PostRefunds

From **Stripe API**.

`POST /v1/refunds`

<p>Create a refund.</p>

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"amount":{"type":"integer"},"charge":{"maxLength":5000,"type":"string"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"enum":[""],"type":"string"}],"description":"Set of [key-value pairs](https://stripe.com/docs/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`."},"payment_intent":{"maxLength":5000,"type":"string"},"reason":{"enum":["duplicate","fraudulent","requested_by_customer"],"maxLength":5000,"type":"string"},"refund_application_fee":{"type":"boolean"},"reverse_transfer":{"type":"boolean"}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

`Refund` objects allow you to refund a charge that has previously been created
but not yet refunded. Funds will be refunded to the credit or debit card that
was originally charged.

Related guide: [Refunds](https://stripe.com/docs/refunds).

```json
{"description":"`Refund` objects allow you to refund a charge that has previously been created\nbut not yet refunded. Funds will be refunded to the credit or debit card that\nwas originally charged.\n\nRelated guide: [Refunds](https://stripe.com/docs/refunds).","properties":{"amount":{"description":"Amount, in %s.","type":"integer"},"balance_transaction":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/balance_transaction"}],"description":"Balance transaction that describes the impact on your account balance.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/balance_transaction"}]}},"charge":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/charge"}],"description":"ID of the charge that was refunded.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/charge"}]}},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"currency":{"description":"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).","type":"string"},"description":{"description":"An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only)","maxLength":5000,"type":"string"},"failure_balance_transaction":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/balance_transaction"}],"description":"If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction.","x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/balance_transaction"}]}},"failure_reason":{"description":"If the refund failed, the reason for refund failure if known. Possible values are `lost_or_stolen_card`, `expired_or_canceled_card`, or `unknown`.","maxLength":5000,"type":"string"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"description":"Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","nullable":true,"type":"object"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["refund"],"type":"string"},"payment_intent":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/payment_intent"}],"description":"ID of the PaymentIntent that was refunded.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/payment_intent"}]}},"reason":{"description":"Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`).","maxLength":5000,"nullable":true,"type":"string"},"receipt_number":{"description":"This is the transaction number that appears on email receipts sent for this refund.","maxLength":5000,"nullable":true,"type":"string"},"source_transfer_reversal":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/transfer_reversal"}],"description":"The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/transfer_reversal"}]}},"status":{"description":"Status of the refund. For credit card refunds, this can be `pending`, `succeeded`, or `failed`. For other types of refunds, it can be `pending`, `succeeded`, `failed`, or `canceled`. Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details.","maxLength":5000,"nullable":true,"type":"string"},"transfer_reversal":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/transfer_reversal"}],"description":"If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/transfer_reversal"}]}}},"required":["amount","created","currency","id","object"],"title":"Refund","type":"object","x-expandableFields":["balance_transaction","charge","failure_balance_transaction","payment_intent","source_transfer_reversal","transfer_reversal"],"x-resourceId":"refund"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/refunds \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "amount": 1,
  "charge": "string",
  "expand": [
    "string"
  ],
  "metadata": "string",
  "payment_intent": "string",
  "reason": "string",
  "refund_application_fee": true,
  "reverse_transfer": true
}'
```
