# Refunds and credit notes

Issue refunds and credit notes on taxed invoices.

Stripe automatically adjusts your tax liability when you refund or credit invoices that include Stripe Tax calculations.

## Refunds (Server-side)

Stripe Tax adjusts your tax liability in proportion to the refunded amount, splitting the refund between the net amount and tax based on the original tax rate.

**Exclusive tax**

| &nbsp; | Net | Tax (25%) | Total | Refund total | Tax refunded |
| --- | --- | --- | --- | --- | --- |
| **Invoice total** | **$100** | **$25** | **$125** | **−$25** | **−$5** |
| Line item 1 | $60 | $15 | $75 | −$15 | −$3 |
| Line item 2 | $40 | $10 | $50 | −$10 | −$2 |

**Inclusive tax**

| &nbsp; | Net | Tax (20%) | Total | Refund total | Tax refunded |
| --- | --- | --- | --- | --- | --- |
| **Invoice total** | **$80** | **$20** | **$100** | **−$20** | **−$4** |
| Line item 1 | $48 | $12 | $60 | −$12 | −$2.40 |
| Line item 2 | $32 | $8 | $40 | −$8 | −$1.60 |

[Create a refund](https://docs.stripe.com/api/refunds/create.md) that identifies the [PaymentIntent](https://docs.stripe.com/api/invoices/object.md#invoice_object-payment_intent) generated by the invoice payment.

```curl
curl https://api.stripe.com/v1/refunds \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "payment_intent={{PAYMENTINTENT_ID}}" \
  -d amount=1000
```

## Credit notes (Server-side)

You can issue [Credit Notes](https://docs.stripe.com/api/credit_notes/object.md) to track tax liability decreases and provide records to your customers.

#### Refund invoice amount

To refund the total amount of an invoice, create a `Credit Note` that automatically generates a `Refund`, or create a `Refund` first, then reference it when you create the `Credit Note`.

#### Automatic Refund

[Create a credit note](https://docs.stripe.com/api/credit_notes/create.md) specifying the `refund_amount` value to automatically generate a [Refund](https://docs.stripe.com/api/refunds/object.md).

```curl
curl https://api.stripe.com/v1/credit_notes \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "invoice={{INVOICE_ID}}" \
  -d refund_amount=1000
```

#### Manual Refund

[Create a Refund](https://docs.stripe.com/api/refunds/create.md), then include its ID when you create a [Credit Note](https://docs.stripe.com/api/credit_notes/object.md). In this case, don’t include a `refund_amount` value.

```curl
curl https://api.stripe.com/v1/credit_notes \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "invoice={{INVOICE_ID}}" \
  -d amount=1000 \
  -d "refunds[0][refund]={{REFUND_ID}}" \
  -d "refunds[0][amount_refunded]=1000"
```

Stripe Tax automatically distributes the total refund amount between taxes and the net amount.

#### Refund invoice line item amount

To refund only one or more line items from an invoice, first [preview the credit note](https://docs.stripe.com/api/credit_notes/preview.md) to collect the [total](https://docs.stripe.com/api/credit_notes/object.md#credit_note_object-total) and [total_excluding_tax](https://docs.stripe.com/api/credit_notes/object.md#credit_note_object-total_excluding_tax) amounts.

```curl
curl -G https://api.stripe.com/v1/credit_notes/preview \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "invoice={{INVOICE_ID}}" \
  -d "lines[0][type]=invoice_line_item" \
  --data-urlencode "lines[0][invoice_line_item]={{line item id from invoice}}" \
  -d "lines[0][amount]=1000"
```

Create a `Credit Note` that automatically generates a `Refund`, or create a `Refund` first, then reference it when you create the `Credit Note`.

#### Automatic Refund

[Create a credit note](https://docs.stripe.com/api/credit_notes/create.md) specifying the `refund_amount` value and the relevant line items to automatically generate a [Refund](https://docs.stripe.com/api/refunds/object.md).

```curl
curl https://api.stripe.com/v1/credit_notes \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "invoice={{INVOICE_ID}}" \
  -d refund_amount=1000 \
  -d "lines[0][type]=invoice_line_item" \
  -d "lines[0][invoice_line_item]={{line item id from invoice}}" \
  -d "lines[0][amount]=1000"
```

#### Manual Refund

[Create a Refund](https://docs.stripe.com/api/refunds/create.md) using the `total` calculated by the Credit Note preview, then include its ID when you create a [Credit Note](https://docs.stripe.com/api/credit_notes/object.md). In this case, don’t include a `refund_amount` value.

```curl
curl https://api.stripe.com/v1/credit_notes \
  -u "<<YOUR_SECRET_KEY>>:" \
  -d "invoice={{INVOICE_ID}}" \
  -d "refunds[0][refund]={{REFUND_ID}}" \
  -d "refunds[0][amount_refunded]=1000" \
  -d "lines[0][type]=invoice_line_item" \
  -d "lines[0][invoice_line_item]={{line item id from invoice}}" \
  -d "lines[0][amount]=1000"
```

## Handle failed or canceled refunds

When a refund is associated with a credit note, the tax liability adjustment is tied to the credit note being issued, not to the refund being triggered. If the refund fails or is canceled, Stripe Tax retains the credit note’s tax reduction. The failed or canceled refund doesn’t settle the amount you intended to refund to your customer.

For a refund that isn’t associated with a credit note, Stripe Tax keeps the tax reduction in your reports only if the refund succeeds. If the refund fails or is canceled after Stripe Tax records the reduction, Stripe Tax reverses the reduction.

Stripe Tax records one tax reduction when a refund and credit note represent the same invoice adjustment. For partial refunds or credit notes, these rules apply only to the tax attributed to the adjusted amount.

## See also

- [Issue credit notes from the Dashboard](https://docs.stripe.com/invoicing/dashboard/credit-notes.md)
- [Generate credit notes programmatically](https://docs.stripe.com/invoicing/integration/programmatic-credit-notes.md)
- [Collect taxes on invoices](https://docs.stripe.com/tax/invoicing.md)
