Issue a credit note to adjust the amount of a finalized invoice. For a status=open
invoice, a credit note reduces its amount_
. For a status=paid
invoice, a credit note does not affect its amount_
. Instead, it can result in any combination of the following:
- Refund: create a new refund (using
refund_
) or link an existing refund (usingamount refund
). - Customer balance credit: credit the customer’s balance (using
credit_
) which will be automatically applied to their next invoice when it’s finalized.amount - 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_
or post_
depending on its status
at the time of credit note creation.
Parameters
- invoicestringRequired
ID of the invoice.
- linesarray of objects
Line items that make up the credit note.
- lines.
typeenumRequired Type of the credit note line item, one of
invoice_
orline_ item custom_
line_ item Possible enum valuescustom_
line_ item invoice_
line_ item - lines.
amountinteger The line item amount to credit. Only valid when
type
isinvoice_
. If invoice is set up withline_ item automatic_
, this amount is tax exclusivetax[enabled]=true - lines.
descriptionstring The description of the credit note line item. Only valid when the
type
iscustom_
.line_ item - lines.
invoice_ line_ itemstring The invoice line item to credit. Only valid when the
type
isinvoice_
.line_ item - lines.
quantityinteger The line item quantity to credit.
- lines.
tax_ amountsarray of objects A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with
tax_
.rates - lines.
tax_amounts. amountintegerRequired The amount, in cents, of the tax.
- lines.
tax_amounts. tax_ ratestringRequired The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe.
- lines.
tax_amounts. taxable_ amountintegerRequired The amount on which tax is calculated, in cents.
- lines.
tax_ ratesarray of strings The tax rates which apply to the credit note line item. Only valid when the
type
iscustom_
and cannot be mixed withline_ item tax_
.amounts - lines.
unit_ amountinteger The integer unit amount in cents of the credit note line item. This
unit_
will be multiplied by the quantity to get the full amount to credit for this line item. Only valid whenamount type
iscustom_
.line_ item - lines.
unit_ amount_ decimalstring Same as
unit_
, but accepts a decimal value in cents with at most 12 decimal places. Only one ofamount unit_
andamount unit_
can be set.amount_ decimal
- memostring
The credit note’s memo appears on the credit note PDF.
- metadataobject
Set of key-value pairs 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
. - reasonenum
Reason for issuing this credit note, one of
duplicate
,fraudulent
,order_
, orchange product_
unsatisfactory Possible enum valuesduplicate
fraudulent
order_
change product_
unsatisfactory
More parameters
- amountinteger
The integer amount in cents representing the total amount of the credit note.
- credit_
amountinteger The integer amount in cents representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.
- effective_
attimestamp 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_
typeenum Type of email to send to the customer, one of
credit_
ornote none
and the default iscredit_
.note Possible enum valuescredit_
note credit note email
none
no email
- out_
of_ band_ amountinteger The integer amount in cents representing the amount that is credited outside of Stripe.
- refundstring
ID of an existing refund to link this credit note to.
- refund_
amountinteger The integer amount in cents representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
- shipping_
costobject When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
- shipping_cost.
shipping_ ratestringRequired if shipping cost should be included for credit note The ID of the shipping rate to use for this order.
Returns
Returns a credit note object if the call succeeded.
{ "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, "amount_excluding_tax": 1099, "description": "T-shirt", "discount_amount": 0, "discount_amounts": [], "invoice_line_item": "il_1MxvRlLkdIwHu7ixnkbntxUV", "livemode": false, "quantity": 1, "tax_amounts": [], "tax_rates": [], "type": "invoice_line_item", "unit_amount": 1099, "unit_amount_decimal": "1099", "unit_amount_excluding_tax": "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, "refund": null, "shipping_cost": null, "status": "issued", "subtotal": 1099, "subtotal_excluding_tax": 1099, "tax_amounts": [], "total": 1099, "total_excluding_tax": 1099, "type": "pre_payment", "voided_at": null}