GET
/v1/credit_notes/previewPreview a credit note
Previews a credit note for an invoice without creating it. Provide invoice and at least one of amount, lines, or shipping_cost, then use the remaining parameters to define credits, refunds, shipping, customer-facing text, and metadata.
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
amountintegeroptional
Total credit note amount in cents or the local currency equivalent.
credit_amountintegeroptional
Amount in cents or the local currency equivalent to credit to the customer's balance for the next invoice.
effective_atintegeroptional
Unix timestamp for the credit note effective date; defaults to the creation time when omitted.
email_typestringoptional
Email behavior: `credit_note` or `none`. Defaults to `credit_note` when omitted.
expandarray<string>optional
Fields to expand in the response; each value must be no more than 5000 characters.
invoicestringrequired
The identifier of the invoice for which to preview the credit note.
linesarray<CreditNoteLineItemParams>optional
Line items making up the credit note; each item must specify `type` as `custom_line_item` or `invoice_line_item`.
memostringoptional
Customer-facing memo displayed on the credit note PDF; maximum 5000 characters.
metadataobjectoptional
Key-value pairs to attach to the credit note preview.
out_of_band_amountintegeroptional
Amount in cents or the local currency equivalent credited outside the API.
reasonstringoptional
Reason for issuing the credit note: `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`.
refund_amountintegeroptional
Amount in cents or the local currency equivalent to refund for the charge associated with the invoice.
refundsarray<CreditNoteRefundParams>optional
Refunds to link to the credit note; each entry uses `refund` or `payment_record_refund` as its `type`.
shipping_costobjectoptional
Shipping cost to include in the credit note, specified with the invoice's `shipping_rate`.
200Returns a credit note preview containing the calculated amounts, invoice association, line items, customer-facing memo, and other credit note details without creating the credit note.
amountintegerrequired
The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax.
amount_shippingintegerrequired
This is the sum of all the shipping amounts.
createdintegerrequired
Time at which the object was created. Measured in seconds since the Unix epoch.
currencystringrequired
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).
customerstringrequired
ID of the customer.
customer_accountstringoptional
ID of the account representing the customer.
customer_balance_transactionstringoptional
Customer balance transaction related to this credit note.
discount_amountintegerrequired
The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
discount_amountsarray<DiscountsResourceDiscountAmount>required
The aggregate amounts calculated per discount for all line items.
effective_atintegeroptional
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.
idstringrequired
Unique identifier for the object.
invoicestringrequired
ID of the invoice.
linesobjectrequired
Line items that make up the credit note
livemodebooleanrequired
If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`.
memostringoptional
Customer-facing text that appears on the credit note PDF.
metadataobjectoptional
Set 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.
numberstringrequired
A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
objectstringrequired
String representing the object's type. Objects of the same type share the same value.
out_of_band_amountintegeroptional
Amount that was credited outside of Stripe.
pdfstringrequired
The link to download the PDF of the credit note.
post_payment_amountintegerrequired
The amount of the credit note that was refunded to the customer, credited to the customer's balance, credited outside of Stripe, or any combination thereof.
pre_payment_amountintegerrequired
The amount of the credit note by which the invoice's `amount_remaining` and `amount_due` were reduced.
pretax_credit_amountsarray<CreditNotesPretaxCreditAmount>required
The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
reasonstringoptional
Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
refundsarray<CreditNoteRefund>required
Refunds related to this credit note.
shipping_costobjectoptional
The details of the cost of shipping, including the ShippingRate applied to the invoice.
statusstringrequired
Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://docs.stripe.com/billing/invoices/credit-notes#voiding).
subtotalintegerrequired
The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
subtotal_excluding_taxintegeroptional
The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
totalintegerrequired
The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
total_excluding_taxintegeroptional
The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
total_taxesarray<BillingBillResourceInvoicingTaxesTax>optional
The aggregate tax information for all line items.
typestringrequired
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.
voided_atintegeroptional
The time that the credit note was voided.
defaultReturned when the API reports an error and includes an `error` object describing the failure.
errorobjectrequired
Error handling
invoice is required, and at least one of amount, lines, or shipping_cost must be provided. email_type must be credit_note or none, reason must be duplicate, fraudulent, order_change, or product_unsatisfactory, and each line or refund entry must use one of its declared type values.