Billing
Additional features
Credit notes

Credit notes

Learn how to adjust or refund finalized invoices with credit notes.

Credit notes are documents that decrease the amount owed on an invoice. They’re the only way to adjust the amount of a finalized invoice other than voiding and recreating the invoice. Some example scenarios where you might use credit notes include:

  • You accidentally overbilled a customer — You accidentally charged your customer 110 USD instead of 100 USD because of a data entry mistake. Use a credit note to give your customer a 10 USD credit for the overcharge.
  • You’re short on inventory — You billed your customer for 15 items, but when it’s time to ship them you realize you only have 13 items left in stock. Use a credit note to refund your customer for the 2 items they didn’t receive.
  • Discounts — Rather than voiding and reissuing a new invoice, you can use a credit note to adjust the amount owed on the existing invoice by a negotiated discount amount.

Issuing credit notes

You can issue a credit note for open and paid invoices. When you issue a credit note for an open invoice, it decreases the amount due on the invoice. When you issue one for a paid invoice, it’s commonly because you need to refund or credit a specified amount to the customer. The sum of all credit notes cannot exceed the invoice’s total amount.

You can credit the quantity or amount of an item by adjusting these values on existing line items. For example, if a customer purchases two shirts, and you accidentally charge them for three shirts, you can credit one shirt back. For reporting and tracking purposes, this is the recommended process because the line item and the credit are tied to each other.

If adjusting an existing line item doesn’t cover your use case, you can add a custom line item. For example, if you need to give a general discount on an invoice, you can create a custom line item to decrease the total invoice amount. This makes tracking and reporting the credit note difficult though because the credit isn’t connected to an existing line item.

Issuing credit notes using the Stripe Dashboard

You can create credit notes from the invoice details page for any open or paid invoice.

  1. Open the Invoices page in the Dashboard.
  2. Click on the invoice you want to add a credit note to.
  3. Click the ••• button and select Issue a credit note.
  4. Edit line item quantities or amounts.
  5. If needed, click Add item to add a custom line item.
  6. Optionally, click Customize tax to edit the tax amount to be credited.
  7. Click the Issue credit note button to submit the credit note.

Issuing a credit note in the Dashboard

Issuing credit notes using the API

You can use the API to generate credit notes programmatically. The process is different depending on whether the invoice is open or paid.

Open invoices

When you create a custom line item on a credit note for an open invoice, the amount_due on the invoice is decreased by the custom_line_items in the credit note. This is in addition to any adjustments made to existing invoice_line_items. For example, if the amount due on an open invoice is 100 USD and you create a custom_line_item with quantity=1 and unit_amount=2000, the new amount due on the invoice is 80 USD.

On an invoice, credit notes are represented as items below the applications of discounts and taxes—they’re actually a post-tax adjusted amount. The invoice amount due is calculated using the following order:

  1. Sum of invoice line items
  2. Discounts
  3. Pre-tax invoice total
  4. Taxes
  5. Customer credit balance
  6. Credit notes applied (to gross amount due)
  7. New amount due

If applying a credit note to an invoice changes the invoice amount due to zero, the invoice automatically transitions into the paid state.

If you want to change the quantity or amount of an existing line item, pass the invoice ID, the line item ID, and the new quantity or amount. If a line item has a quantity and an amount, only the quantity can be updated. Otherwise, only the amount can be changed. The example below adjusts the quantity to two:

curl https://api.stripe.com/v1/credit_notes \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d invoice=in_18jwqyLlRB0eXbMtrUQ97YBw \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"=ii_1F4CjLAJVYItwOKq8ubuinVO \ -d "lines[0][quantity]"=2
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.CreditNote.create( invoice='in_1B8vcnAJVYItwOKqIl7mv02f', lines=[ { 'type': 'invoice_line_item', 'invoice_line_item': 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity': '2', }, ], )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\CreditNote::create([ 'invoice' => 'in_1B8vcnAJVYItwOKqIl7mv02f', 'lines' => [ [ 'type' => 'invoice_line_item', 'invoice_line_item' => 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity' => '2', ], ], ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNoteCreateParams params = CreditNoteCreateParams.builder() .setInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw") .addLine( CreditNoteCreateParams.Line.builder() .setType(CreditNoteCreateParams.Line.Type.INVOICE_LINE_ITEM) .setInvoiceLineItem("ii_1F4CjLAJVYItwOKq8ubuinVO") .setQuantity(2L) .build()) .build(); CreditNote.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const creditNote = await stripe.creditNotes.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteParams{ Invoice: stripe.String("in_1B8vcnAJVYItwOKqIl7mv02f"), Lines: []*stripe.CreditNoteLineItemsParams{ { Type: stripe.String("invoice_line_item"), InvoiceLineItem: stripe.String("ii_1F4CjLAJVYItwOKq8ubuinVO"), Quantity: stripe.Int64(2), }, }, } cn, _ := creditnote.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteCreateOptions { Invoice = "in_18jwqyLlRB0eXbMtrUQ97YBw", Lines = new List<CreditNoteLineOptions> { new CreditNoteLineOptions { Type = "invoice_line_item", InvoiceLineItem = "in_18jwqyLlRB0eXbMtrUQ97YBw", Quantity = 2, }, }, }; var service = new CreditNoteService(); var creditNote = service.Create(options);

To create a custom line item on the credit note, pass the invoice ID, a description, the quantity, and the unit amount. You can optionally set a tax rate as well. This example creates a custom line item on the credit note for 10 USD:

curl https://api.stripe.com/v1/credit_notes \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d invoice=in_18jwqyLlRB0eXbMtrUQ97YBw \ -d "lines[0][type]"=custom_line_item \ -d "lines[0][description]"="Courtesy credit" \ -d "lines[0][quantity]"=1 \ -d "lines[0][unit_amount]"=1000
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'custom_line_item', description: 'Courtesy credit', quantity: '1', unit_amount: '1000', }, ], })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.CreditNote.create( invoice='in_1B8vcnAJVYItwOKqIl7mv02f', lines=[ { 'type': 'custom_line_item', 'description': 'Courtesy credit', 'quantity': '1', 'unit_amount': '1000', }, ], )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\CreditNote::create([ 'invoice' => 'in_1B8vcnAJVYItwOKqIl7mv02f', 'lines' => [ [ 'type' => 'custom_line_item', 'description' => 'Courtesy credit', 'quantity' => '1', 'unit_amount' => '1000', ], ], ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNoteCreateParams params = CreditNoteCreateParams.builder() .setInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw") .addLine( CreditNoteCreateParams.Line.builder() .setType(CreditNoteCreateParams.Line.Type.CUSTOM_LINE_ITEM) .setDescription("Courtesy credit") .setQuantity(1L) .setUnitAmount(1000L) .build()) .build(); CreditNote.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const creditNote = await stripe.creditNotes.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'custom_line_item', description: 'Courtesy credit', quantity: '1', unit_amount: '1000', }, ], });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteParams{ Invoice: stripe.String("in_1B8vcnAJVYItwOKqIl7mv02f"), Lines: []*stripe.CreditNoteLineItemsParams{ { Type: stripe.String("custom_line_item"), Description: stripe.String("Courtesy credit"), Quantity: stripe.Int64(1), UnitAmount: stripe.Int64(1000), }, }, } cn, err := creditnote.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteCreateOptions { Invoice = "in_18jwqyLlRB0eXbMtrUQ97YBw", Lines = new List<CreditNoteLineOptions> { new CreditNoteLineOptions { Type = "custom_line_item", Description = "Courtesy credit", Quantity = 1, UnitAmount = 1000, }, }, }; var service = new CreditNoteService(); var creditNote = service.Create(options);

When you create a credit note for a paid invoice, the amount due on the invoice doesn’t change. Instead, the user can choose one or more of the following options:

Action Description
Create a refund Refund the invoice’s charge back to the customer’s payment method.
Link a refund Link an existing refund for the invoice’s charge.
Credit the customer credit balance Credit the customer credit balance, which is automatically applied to their future invoices.
Credit outside of Stripe Credit the invoice for an amount made in an adjustment outside of Stripe.

In this example, the credit note creates a refund.

curl https://api.stripe.com/v1/credit_notes \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d invoice=in_18jwqyLlRB0eXbMtrUQ97YBw \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"=ii_1F4CjLAJVYItwOKq8ubuinVO \ -d "lines[0][quantity]"=2 \ -d refund_amount=500
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], refund_amount: 500, })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.CreditNote.create( invoice='in_1B8vcnAJVYItwOKqIl7mv02f', lines=[ { 'type': 'invoice_line_item', 'invoice_line_item': 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity': '2', }, ], refund_amount=500, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\CreditNote::create([ 'invoice' => 'in_1B8vcnAJVYItwOKqIl7mv02f', 'lines' => [ [ 'type' => 'invoice_line_item', 'invoice_line_item' => 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity' => '2', ], ], 'refund_amount' => 500, ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNoteCreateParams params = CreditNoteCreateParams.builder() .setInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw") .addLine( CreditNoteCreateParams.Line.builder() .setType(CreditNoteCreateParams.Line.Type.INVOICE_LINE_ITEM) .setInvoiceLineItem("ii_1F4CjLAJVYItwOKq8ubuinVO") .setQuantity(2L) .build()) .setRefundAmount(500L) .build(); CreditNote.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const creditNote = await stripe.creditNotes.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], refund_amount: 500, });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteParams{ Invoice: stripe.String("in_1B8vcnAJVYItwOKqIl7mv02f"), Lines: []*stripe.CreditNoteLineItemsParams{ { Type: stripe.String("invoice_line_item"), InvoiceLineItem: stripe.String("ii_1F4CjLAJVYItwOKq8ubuinVO"), Quantity: stripe.Int64(2), }, }, RefundAmount: stripe.Int64(500), } cn, err := creditnote.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteCreateOptions { Invoice = "in_18jwqyLlRB0eXbMtrUQ97YBw", RefundAmount = 500, Lines = new List<CreditNoteLineOptions> { new CreditNoteLineOptions { Type = "invoice_line_item", InvoiceLineItem = "in_18jwqyLlRB0eXbMtrUQ97YBw", Quantity = 2, }, }, }; var service = new CreditNoteService(); var creditNote = service.Create(options);

Here, the credit note creates a credit to the customer credit balance.

curl https://api.stripe.com/v1/credit_notes \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d invoice=in_18jwqyLlRB0eXbMtrUQ97YBw \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"=ii_1F4CjLAJVYItwOKq8ubuinVO \ -d "lines[0][quantity]"=2 \ -d credit_amount=500
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], credit_amount: 500, })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.CreditNote.create( invoice='in_1B8vcnAJVYItwOKqIl7mv02f', lines=[ { 'type': 'invoice_line_item', 'invoice_line_item': 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity': '2', }, ], credit_amount=500, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\CreditNote::create([ 'invoice' => 'in_1B8vcnAJVYItwOKqIl7mv02f', 'lines' => [ [ 'type' => 'invoice_line_item', 'invoice_line_item' => 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity' => '2', ], ], 'credit_amount' => 500, ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNoteCreateParams params = CreditNoteCreateParams.builder() .setInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw") .addLine( CreditNoteCreateParams.Line.builder() .setType(CreditNoteCreateParams.Line.Type.INVOICE_LINE_ITEM) .setInvoiceLineItem("ii_1F4CjLAJVYItwOKq8ubuinVO") .setQuantity(2L) .build()) .setCreditAmount(500L) .build(); CreditNote.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const creditNote = await stripe.creditNotes.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], credit_amount: 500, });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteParams{ Invoice: stripe.String("in_1B8vcnAJVYItwOKqIl7mv02f"), Lines: []*stripe.CreditNoteLineItemsParams{ { Type: string.String("invoice_line_item"), InvoiceLineItem: stripe.String("ii_1F4CjLAJVYItwOKq8ubuinVO"), Quantity: stripe.Int64(2), }, }, CreditAmount: stripe.Int64(500), } cn, err := creditnote.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteCreateOptions { Invoice = "in_18jwqyLlRB0eXbMtrUQ97YBw", CreditAmount = 500, Lines = new List<CreditNoteLineOptions> { new CreditNoteLineOptions { Type = "invoice_line_item", InvoiceLineItem = "in_18jwqyLlRB0eXbMtrUQ97YBw", Quantity = 2, } }, }; var service = new CreditNoteService(); var creditNote = service.Create(options);

You can also combine multiple parameters. Funds left over after subtracting the refund and credit amounts from the amount on the invoice results in a credit outside of Stripe, usually with cash or a check.

curl https://api.stripe.com/v1/credit_notes \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d invoice=in_18jwqyLlRB0eXbMtrUQ97YBw \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"=ii_1F4CjLAJVYItwOKq8ubuinVO \ -d "lines[0][quantity]"=2 \ -d refund_amount=100 \ -d credit_amount=200 \ -d out_of_band_amount=200
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], refund_amount: 100, credit_amount: 200, out_of_band_amount: 200, })
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.CreditNote.create( invoice='in_1B8vcnAJVYItwOKqIl7mv02f', lines=[ { 'type': 'invoice_line_item', 'invoice_line_item': 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity': '2', }, ], refund_amount=100, credit_amount=200, out_of_band_amount=200, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\CreditNote::create([ 'invoice' => 'in_1B8vcnAJVYItwOKqIl7mv02f', 'lines' => [ [ 'type' => 'invoice_line_item', 'invoice_line_item' => 'ii_1F4CjLAJVYItwOKq8ubuinVO', 'quantity' => '2', ], ], 'refund_amount' => 100, 'credit_amount' => 200, 'out_of_band_amount' => 200, ]);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNoteCreateParams params = CreditNoteCreateParams.builder() .setInvoice("in_18jwqyLlRB0eXbMtrUQ97YBw") .addLine( CreditNoteCreateParams.Line.builder() .setType(CreditNoteCreateParams.Line.Type.INVOICE_LINE_ITEM) .setInvoiceLineItem("ii_1F4CjLAJVYItwOKq8ubuinVO") .setQuantity(2L) .build()) .setRefundAmount(100L) .setCreditAmount(200L) .setOutOfBandAmount(200L) .build(); CreditNote.create(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const creditNote = await stripe.creditNotes.create({ invoice: 'in_1B8vcnAJVYItwOKqIl7mv02f', lines: [ { type: 'invoice_line_item', invoice_line_item: 'ii_1F4CjLAJVYItwOKq8ubuinVO', quantity: '2', }, ], refund_amount: 100, credit_amount: 200, out_of_band_amount: 200, });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteParams{ Invoice: stripe.String("in_1B8vcnAJVYItwOKqIl7mv02f"), Lines: []*stripe.CreditNoteLineItemsParams{ { Type: stripe.String("invoice_line_item"), InvoiceLineItem: stripe.String("ii_1F4CjLAJVYItwOKq8ubuinVO"), Quantity: stripe.Int64(2), }, }, RefundAmount: stripe.Int64(100), CreditAmount: stripe.Int64(200), OutOfBandAmount: stripe.Int64(200), } cn, err := creditnote.New(params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteCreateOptions { Invoice = "in_18jwqyLlRB0eXbMtrUQ97YBw", Lines = new List<CreditNoteLineOptions> { new CreditNoteLineOptions { Type = "invoice_line_item", InvoiceLineItem = "in_18jwqyLlRB0eXbMtrUQ97YBw", Quantity = 2, } }, RefundAmount = 100, CreditAmount = 200, OutOfBandAmount = 200, }; var service = new CreditNoteService(); var creditNote = service.Create(options);

Invoices with applied credit balances or discounts

Credit notes issued for invoices with a customer credit balance applied to them sometimes result in funds being credited to the credit balance instead of their initial payment method. For example, if a credit balance of 150 USD is applied to an invoice for 200 USD, then the finalized invoice is for 50 USD. If you issue a credit note for 50 USD or less, the funds are refunded to the customer’s payment method. Anything above 50 USD is added to the customer’s credit balance and is applied to the next invoice.

Discounts are applied evenly to all line items on an invoice. For example, applying a 50% discount to an invoice with 10 line items at 10 USD each results in each line item costing 5 USD instead. If you credit back one line item, 5 USD is returned to the customer.

Discounts with a set amount work in a similar way. Applying a 10 USD discount to an invoice with 10 line items at 10 USD each results in each line item costing 9 USD instead. If you credit back a single item, 9 USD is returned to the customer. However, this means that the original 10 USD discount ends up only being 9 USD. If you want to make sure the customer receives the full 10 USD discount, you can add a custom line item for 1 USD in the credit note to credit back the single item.

Voiding credit notes

You can only void a credit note on open invoices. Voiding a credit note reverses its adjustment, effectively restoring the amount due on the invoice to its pre-credit-note amount.

curl https://api.stripe.com/v1/credit_notes/cn_w82laPzlw48z/void \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -X POST
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::CreditNote.void_credit_note('cn_w82laPzlw48z')
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' credit_note = stripe.CreditNote.void_credit_note('cn_w82laPzlw48z')
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); $credit_note = \Stripe\CreditNote::retrieve('cn_w82laPzlw48z'); $credit_note->voidCreditNote();
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; CreditNote creditNote = CreditNote.retrieve("cn_w82laPzlw48z"); creditNote.voidCreditNote();
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); stripe.creditNotes.voidCreditNote('cn_w82laPzlw48z', function(err, creditNote) { // asynchronously called });
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.CreditNoteVoidParams{} cn, err := creditNote.VoidCreditNote("cn_w82laPzlw48z", params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CreditNoteVoidOptions{}; var service = new CreditNoteService(); var creditNote = service.VoidCreditNote("cn_w82laPzlw48z", options);