Sample - Stripe API
GET/v1/credit_notes/preview/lines

List credit note preview line items

Lists the line items for a credit note preview. Provide the same preview inputs used to define the credit note, including invoice and one of amount, lines, or shipping_cost, then use the pagination cursors to retrieve additional items.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

17 parameters
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.
Allowed:credit_notenone
ending_beforestringoptional
Pagination cursor identifying the line item before which to return results.
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 credit note line items.
limitintegeroptional
Maximum number of line items to return. Must be between 1 and 100; defaults to 10 when omitted.
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`.
Allowed:duplicatefraudulentorder_changeproduct_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`.
starting_afterstringoptional
Pagination cursor identifying the line item after which to return results.

2 status codes
200Returns a paginated list object containing credit note line items in `data`, a `has_more` indicator, the list object type, and the collection URL.
dataarray<CreditNoteLineItem>required
Details about each object.
has_morebooleanrequired
True if this list has another page of items after this one that can be fetched.
objectstringrequired
String representing the object's type. Objects of the same type share the same value. Always has the value `list`.
Allowed:list
urlstringrequired
The URL where this list can be accessed.
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. limit must be an integer from 1 through 100, while line and refund entries must use their declared type values and starting_after or ending_before must identify valid cursors.