# Create a credit note

Issue a credit note to adjust the amount of a finalized invoice. For a `status=open` invoice, a credit note reduces its `amount_due`. For a `status=paid` invoice, a credit note does not affect its `amount_due`. Instead, it can result in any combination of the following:

- Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
- Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
- Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s `pre_payment_credit_notes_amount` or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation.

## Prerequisites

Before you can run the following code snippet, you need to call these APIs with the provided parameters to set up the prerequisite API object(s).

1. createCustomer
POST /v1/customers {"name":"Jenny Rosen","email":"jennyrosen@example.com"}
2. createInvoice
POST /v1/invoices {"customer":"${node.prerequisites.createCustomer.createCustomer:id}"}

## Request

```curl
curl https://api.stripe.com/v1/credit_notes \
  -u "<<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2025-04-30.basil" \
  -d invoice={{INVOICE_ID}}
```

### Response

```json
{
  "id": "cn_1MxvRqLkdIwHu7ixY0xbUcxk",
  "object": "credit_note",
  "amount": 1099,
  "amount_shipping": 0,
  "created": 1681750958,
  "currency": "usd",
  "customer": "cus_NjLgPhUokHubJC",
  "customer_balance_transaction": null,
  "discount_amount": 0,
  "discount_amounts": [],
  "invoice": "in_1MxvRkLkdIwHu7ixABNtI99m",
  "lines": {
    "object": "list",
    "data": [
      {
        "id": "cnli_1MxvRqLkdIwHu7ixFpdhBFQf",
        "object": "credit_note_line_item",
        "amount": 1099,
        "description": "T-shirt",
        "discount_amount": 0,
        "discount_amounts": [],
        "invoice_line_item": "il_1MxvRlLkdIwHu7ixnkbntxUV",
        "livemode": false,
        "quantity": 1,
        "tax_rates": [],
        "taxes": [],
        "type": "invoice_line_item",
        "unit_amount": 1099,
        "unit_amount_decimal": "1099"
      }
    ],
    "has_more": false,
    "url": "/v1/credit_notes/cn_1MxvRqLkdIwHu7ixY0xbUcxk/lines"
  },
  "livemode": false,
  "memo": null,
  "metadata": {},
  "number": "C9E0C52C-0036-CN-01",
  "out_of_band_amount": null,
  "pdf": "https://pay.stripe.com/credit_notes/acct_1M2JTkLkdIwHu7ix/test_YWNjdF8xTTJKVGtMa2RJd0h1N2l4LF9Oak9FOUtQNFlPdk52UXhFd2Z4SU45alpEd21kd0Y4LDcyMjkxNzU50200cROQsSK2/pdf?s=ap",
  "reason": null,
  "refunds": [],
  "shipping_cost": null,
  "status": "issued",
  "subtotal": 1099,
  "subtotal_excluding_tax": 1099,
  "total": 1099,
  "total_excluding_tax": 1099,
  "total_taxes": [],
  "type": "pre_payment",
  "voided_at": null
}
```

## Returns

Returns a credit note object if the call succeeded.

## Parameters

- `invoice` (string, required)
  ID of the invoice.

- `amount` (integer, optional)
  The integer amount in the smallest currency unit representing the total amount of the credit note.

- `credit_amount` (integer, optional)
  The integer amount in the smallest currency unit representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.

- `effective_at` (timestamp, optional)
  The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated ‘Date of issue’ printed on the credit note PDF.

- `email_type` (enum, optional)
  Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`.
Possible enum values:
  - `credit_note`
    credit note email

  - `none`
    no email

- [`lines`](https://docs.stripe.com/api/credit_notes/create.md?query=lines) (array of objects, optional)
  Line items that make up the credit note.

- `memo` (string, optional)
  The credit note’s memo appears on the credit note PDF.

- `metadata` (object, optional)
  Set of [key-value pairs](https://docs.stripe.com/docs/api/metadata.md) 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`.

- `out_of_band_amount` (integer, optional)
  The integer amount in the smallest currency unit representing the amount that is credited outside of Stripe.

- `reason` (enum, optional)
  Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
Possible enum values:
  - `duplicate`
  - `fraudulent`
  - `order_change`
  - `product_unsatisfactory`

- `refund_amount` (integer, optional)
  The integer amount in the smallest currency unit representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.

- [`refunds`](https://docs.stripe.com/api/credit_notes/create.md?query=refunds) (array of objects, optional)
  Refunds to link to this credit note.

- [`shipping_cost`](https://docs.stripe.com/api/credit_notes/create.md?query=shipping_cost) (object, optional)
  When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
