# GetCreditNotesPreview

From **Stripe API**.

`GET /v1/credit_notes/preview`

<p>Get a preview of a credit note without creating it.</p>

## Parameters

### `amount`

- Location: query
- Required: false
- Type: `integer`

The integer amount in %s representing the total amount of the credit note.

### `credit_amount`

- Location: query
- Required: false
- Type: `integer`

The integer amount in %s representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.

### `expand`

- Location: query
- Required: false
- Type: `array`

Specifies which fields in the response should be expanded.

### `invoice`

- Location: query
- Required: true
- Type: `string`
- maxLength: `5000`

ID of the invoice.

### `lines`

- Location: query
- Required: false
- Type: `array`

Line items that make up the credit note.

### `memo`

- Location: query
- Required: false
- Type: `string`
- maxLength: `5000`

The credit note's memo appears on the credit note PDF.

### `metadata`

- Location: query
- Required: false
- Type: `object`

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`.

### `out_of_band_amount`

- Location: query
- Required: false
- Type: `integer`

The integer amount in %s representing the amount that is credited outside of Stripe.

### `reason`

- Location: query
- Required: false
- Type: `string`
- Allowed values: `"duplicate"`, `"fraudulent"`, `"order_change"`, `"product_unsatisfactory"`

Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`

### `refund`

- Location: query
- Required: false
- Type: `string`

ID of an existing refund to link this credit note to.

### `refund_amount`

- Location: query
- Required: false
- Type: `integer`

The integer amount in %s representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.

## Request body

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

- Type: `object`

```json
{"additionalProperties":false,"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`

Issue a credit note to adjust an invoice's amount after the invoice is finalized.

Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes).

```json
{"description":"Issue a credit note to adjust an invoice's amount after the invoice is finalized.\n\nRelated guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes).","properties":{"amount":{"description":"The integer amount in %s representing the total amount of the credit note, including tax.","type":"integer"},"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"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"ID of the customer.","x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"customer_balance_transaction":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer_balance_transaction"}],"description":"Customer balance transaction related to this credit note.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer_balance_transaction"}]}},"discount_amount":{"description":"The integer amount in %s representing the total amount of discount that was credited.","type":"integer"},"discount_amounts":{"description":"The aggregate amounts calculated per discount for all line items.","items":{"$ref":"#/components/schemas/discounts_resource_discount_amount"},"type":"array"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"invoice":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/invoice"}],"description":"ID of the invoice.","x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/invoice"}]}},"lines":{"description":"Line items that make up the credit note","properties":{"data":{"description":"Details about each object.","items":{"$ref":"#/components/schemas/credit_note_line_item"},"type":"array"},"has_more":{"description":"True if this list has another page of items after this one that can be fetched.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value. Always has the value `list`.","enum":["list"],"type":"string"},"url":{"description":"The URL where this list can be accessed.","maxLength":5000,"type":"string"}},"required":["data","has_more","object","url"],"title":"CreditNoteLinesList","type":"object","x-expandableFields":["data"]},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"memo":{"description":"Customer-facing text that appears on the credit note PDF.","maxLength":5000,"nullable":true,"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"},"number":{"description":"A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.","maxLength":5000,"type":"string"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["credit_note"],"type":"string"},"out_of_band_amount":{"description":"Amount that was credited outside of Stripe.","nullable":true,"type":"integer"},"pdf":{"description":"The link to download the PDF of the credit note.","maxLength":5000,"type":"string"},"reason":{"description":"Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`","enum":["duplicate","fraudulent","order_change","product_unsatisfactory"],"nullable":true,"type":"string"},"refund":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/refund"}],"description":"Refund related to this credit note.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/refund"}]}},"status":{"description":"Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).","enum":["issued","void"],"type":"string"},"subtotal":{"description":"The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.","type":"integer"},"tax_amounts":{"description":"The aggregate amounts calculated per tax rate for all line items.","items":{"$ref":"#/components/schemas/credit_note_tax_amount"},"type":"array"},"total":{"description":"The integer amount in %s representing the total amount of the credit note, including tax and all discount.","type":"integer"},"type":{"description":"Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid.","enum":["post_payment","pre_payment"],"type":"string"},"voided_at":{"description":"The time that the credit note was voided.","format":"unix-time","nullable":true,"type":"integer"}},"required":["amount","created","currency","customer","discount_amount","discount_amounts","id","invoice","lines","livemode","number","object","pdf","status","subtotal","tax_amounts","total","type"],"title":"CreditNote","type":"object","x-expandableFields":["customer","customer_balance_transaction","discount_amounts","invoice","lines","refund","tax_amounts"],"x-resourceId":"credit_note"}
```

### `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 GET \
  --url https://api.stripe.com/v1/credit_notes/preview \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{}'
```
