API reference
Credit Notes
Issue a credit note to adjust an invoice's amount after the invoice is finalized. Related guide: Credit notes
Create a credit note
POST/v1/credit_notes
Issue a credit note to adjust the amount of a finalized invoice. A credit note will first reduce the invoice’s amount_remaining (and amount_due), but not below zero. This amount is indicated by the credit note’s pre_payment_amount. The excess amount is indicated by post_payment_amount, and it can result in any combination of the following: Refunds: create a new refund (using refund_amount) or link existing refunds (using refunds). Customer balance credit: credit the customer’s balance (using credit_amount) which will be automatically applied to their next invoice when it’s finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). The sum of refunds, customer balance credits, and outside of Stripe credits must equal the post_payment_amount. You may issue multiple credit notes for an invoice. Each credit note may increment the invoice’s pre_payment_credit_notes_amount, post_payment_credit_notes_amount, or both, depending on the invoice’s amount_remaining at the time of credit note creation. For invoices that also have refunds created through the Refund API, the credit note API subtracts those refund amounts from the maximum creditable amount. This prevents the combined credit notes and refunds from exceeding the invoice amount. If you use both, ensure the combined total does not exceed the invoice’s paid amount.
Body parameters
invoicestringRequiredID of the invoice.
amountintegerThe integer amount in cents (or local equivalent) representing the total amount of the credit note. One of
amount,lines, orshipping_costmust be provided.credit_amountintegerThe integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
effective_atintegerThe date when this credit note is in effect. Same as
createdunless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.email_typestringType of email to send to the customer, one of
credit_noteornoneand the default iscredit_note.Possible valuescredit_notenone
expandarray of stringsSpecifies which fields in the response should be expanded.
linesarray of objectsLine items that make up the credit note. One of
amount,lines, orshipping_costmust be provided.Show 10 child parameters
typestringRequiredPossible valuescustom_line_iteminvoice_line_item
amountintegerdescriptionstringinvoice_line_itemstringmetadataobjectquantityintegertax_amountsarray of objectsShow 3 child parameters
amountintegerRequiredtax_ratestringRequiredtaxable_amountintegerRequired
tax_ratesarray of stringsunit_amountintegerunit_amount_decimalstring
memostringThe credit note's memo appears on the credit note PDF.
metadataobjectSet 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.out_of_band_amountintegerThe integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
reasonstringReason for issuing this credit note, one of
duplicate,fraudulent,order_change, orproduct_unsatisfactoryPossible valuesduplicatefraudulentorder_changeproduct_unsatisfactory
refund_amountintegerThe integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
refundsarray of objectsRefunds to link to this credit note.
Show 4 child parameters
amount_refundedintegerpayment_record_refundobjectShow 2 child parameters
payment_recordstringRequiredrefund_groupstringRequired
refundstringtypestringPossible valuespayment_record_refundrefund
shipping_costobjectWhen shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of
amount,lines, orshipping_costmust be provided.Show 1 child parameter
shipping_ratestring
Returns
The credit_note object.
curl https://api.knoxapi.com/v1/credit_notes \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d invoice=in_1Pgc75B7WZ01zgkWYv4iMwt7const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const creditNote = await stripe.creditNotes.create({
invoice: 'in_1Pgc75B7WZ01zgkWYv4iMwt7',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
credit_note = client.v1.credit_notes.create(params={
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
credit_note = Stripe::CreditNote.create({
invoice: 'in_1Pgc75B7WZ01zgkWYv4iMwt7',
}){
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}List all credit notes
GET/v1/credit_notes
Returns a list of credit notes.
Query parameters
createdobject | integerOnly return credit notes that were created during the given date interval.
Show 4 child parameters
gtintegergteintegerltintegerlteinteger
customerstringOnly return credit notes for the customer specified by this customer ID.
customer_accountstringOnly return credit notes for the account representing the customer specified by this account ID.
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
invoicestringOnly return credit notes for the invoice specified by this invoice ID.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of credit_note objects.
curl -G https://api.knoxapi.com/v1/credit_notes \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const page = await stripe.creditNotes.list({
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
page = client.v1.credit_notes.list(params={
"limit": 3,
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
page = Stripe::CreditNote.list({
limit: 3,
}){
"object": "list",
"url": "/v1/credit_notes",
"has_more": false,
"data": [
{
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}
]
}Preview a credit note
GET/v1/credit_notes/preview
Get a preview of a credit note without creating it.
Query parameters
invoicestringRequiredID of the invoice.
amountintegerThe integer amount in cents (or local equivalent) representing the total amount of the credit note. One of
amount,lines, orshipping_costmust be provided.credit_amountintegerThe integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
effective_atintegerThe date when this credit note is in effect. Same as
createdunless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.email_typestringType of email to send to the customer, one of
credit_noteornoneand the default iscredit_note.Possible valuescredit_notenone
expandarray of stringsSpecifies which fields in the response should be expanded.
linesarray of objectsLine items that make up the credit note. One of
amount,lines, orshipping_costmust be provided.Show 10 child parameters
typestringRequiredPossible valuescustom_line_iteminvoice_line_item
amountintegerdescriptionstringinvoice_line_itemstringmetadataobjectquantityintegertax_amountsarray of objectsShow 3 child parameters
amountintegerRequiredtax_ratestringRequiredtaxable_amountintegerRequired
tax_ratesarray of stringsunit_amountintegerunit_amount_decimalstring
memostringThe credit note's memo appears on the credit note PDF.
metadataobjectSet 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.out_of_band_amountintegerThe integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
reasonstringReason for issuing this credit note, one of
duplicate,fraudulent,order_change, orproduct_unsatisfactoryPossible valuesduplicatefraudulentorder_changeproduct_unsatisfactory
refund_amountintegerThe integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
refundsarray of objectsRefunds to link to this credit note.
Show 4 child parameters
amount_refundedintegerpayment_record_refundobjectShow 2 child parameters
payment_recordstringRequiredrefund_groupstringRequired
refundstringtypestringPossible valuespayment_record_refundrefund
shipping_costobjectWhen shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of
amount,lines, orshipping_costmust be provided.Show 1 child parameter
shipping_ratestring
Returns
The credit_note object.
curl -G https://api.knoxapi.com/v1/credit_notes/preview \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode invoice=in_1Pgc75B7WZ01zgkWYv4iMwt7const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/credit_notes/preview', {
invoice: 'in_1Pgc75B7WZ01zgkWYv4iMwt7',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/credit_notes/preview", invoice="in_1Pgc75B7WZ01zgkWYv4iMwt7")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/credit_notes/preview', {
invoice: 'in_1Pgc75B7WZ01zgkWYv4iMwt7',
}){
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}Update a credit note
POST/v1/credit_notes/{id}
Updates an existing credit note.
Path parameters
idstringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
memostringCredit note memo.
metadataobjectSet 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.
Returns
The credit_note object.
curl https://api.knoxapi.com/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
-d "metadata[order_id]=6735"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const creditNote = await stripe.creditNotes.update('cn_1Pgc75B7WZ01zgkWJMPt5riP', {
metadata: {
order_id: '6735',
},
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
credit_note = client.v1.credit_notes.update("cn_1Pgc75B7WZ01zgkWJMPt5riP", params={
"metadata": {
"order_id": "6735",
},
})require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
credit_note = Stripe::CreditNote.update('cn_1Pgc75B7WZ01zgkWJMPt5riP', {
metadata: {
order_id: '6735',
},
}){
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}Retrieve a credit note
GET/v1/credit_notes/{id}
Retrieves the credit note object with the given identifier.
Path parameters
idstringRequired
Query parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The credit_note object.
curl https://api.knoxapi.com/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const creditNote = await stripe.creditNotes.retrieve('cn_1Pgc75B7WZ01zgkWJMPt5riP');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
credit_note = client.v1.credit_notes.retrieve("cn_1Pgc75B7WZ01zgkWJMPt5riP")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
credit_note = Stripe::CreditNote.retrieve('cn_1Pgc75B7WZ01zgkWJMPt5riP'){
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}Retrieve a credit note preview's line items
GET/v1/credit_notes/preview/lines
When retrieving a credit note preview, you’ll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items.
Query parameters
invoicestringRequiredID of the invoice.
amountintegerThe integer amount in cents (or local equivalent) representing the total amount of the credit note. One of
amount,lines, orshipping_costmust be provided.credit_amountintegerThe integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
effective_atintegerThe date when this credit note is in effect. Same as
createdunless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.email_typestringType of email to send to the customer, one of
credit_noteornoneand the default iscredit_note.Possible valuescredit_notenone
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
linesarray of objectsLine items that make up the credit note. One of
amount,lines, orshipping_costmust be provided.Show 10 child parameters
typestringRequiredPossible valuescustom_line_iteminvoice_line_item
amountintegerdescriptionstringinvoice_line_itemstringmetadataobjectquantityintegertax_amountsarray of objectsShow 3 child parameters
amountintegerRequiredtax_ratestringRequiredtaxable_amountintegerRequired
tax_ratesarray of stringsunit_amountintegerunit_amount_decimalstring
memostringThe credit note's memo appears on the credit note PDF.
metadataobjectSet 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.out_of_band_amountintegerThe integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
reasonstringReason for issuing this credit note, one of
duplicate,fraudulent,order_change, orproduct_unsatisfactoryPossible valuesduplicatefraudulentorder_changeproduct_unsatisfactory
refund_amountintegerThe integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
refundsarray of objectsRefunds to link to this credit note.
Show 4 child parameters
amount_refundedintegerpayment_record_refundobjectShow 2 child parameters
payment_recordstringRequiredrefund_groupstringRequired
refundstringtypestringPossible valuespayment_record_refundrefund
shipping_costobjectWhen shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of
amount,lines, orshipping_costmust be provided.Show 1 child parameter
shipping_ratestring
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of credit_note_line_item objects.
curl -G https://api.knoxapi.com/v1/credit_notes/preview/lines \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode invoice=in_1Pgc6tB7WZ01zgkWu9fdqL6Iconst Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/credit_notes/preview/lines', {
invoice: 'in_1Pgc6tB7WZ01zgkWu9fdqL6I',
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/credit_notes/preview/lines", invoice="in_1Pgc6tB7WZ01zgkWu9fdqL6I")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/credit_notes/preview/lines', {
invoice: 'in_1Pgc6tB7WZ01zgkWu9fdqL6I',
}){
"object": "list",
"url": "/v1/credit_notes/preview/lines",
"has_more": false,
"data": [
{
"amount": 1000,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWPb1sOn7l",
"invoice_line_item": "il_1Pgc75B7WZ01zgkWOwaRplc5",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
]
}Retrieve a credit note's line items
GET/v1/credit_notes/{credit_note}/lines
When retrieving a credit note, you’ll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
Path parameters
credit_notestringRequired
Query parameters
ending_beforestringA cursor for use in pagination.
ending_beforeis an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar, your subsequent call can includeending_before=obj_barin order to fetch the previous page of the list.expandarray of stringsSpecifies which fields in the response should be expanded.
limitintegerA limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_afterstringA cursor for use in pagination.
starting_afteris an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo, your subsequent call can includestarting_after=obj_fooin order to fetch the next page of the list.
Returns
A list of credit_note_line_item objects.
curl -G https://api.knoxapi.com/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines \
-H "Authorization: Bearer $KNOX_SECRET_KEY" \
--data-urlencode limit=3const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const response = await stripe.rawRequest('GET', '/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines', {
limit: 3,
});import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
response = client.raw_request("get", "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines", limit=3)require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
response = Stripe.raw_request(:get, '/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines', {
limit: 3,
}){
"object": "list",
"url": "/v1/credit_notes",
"has_more": false,
"data": [
{
"amount": 1000,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWPb1sOn7l",
"invoice_line_item": "il_1Pgc75B7WZ01zgkWOwaRplc5",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
]
}Void a credit note
POST/v1/credit_notes/{id}/void
Marks a credit note as void. Learn more about voiding credit notes.
Path parameters
idstringRequired
Body parameters
expandarray of stringsSpecifies which fields in the response should be expanded.
Returns
The credit_note object.
curl -X POST https://api.knoxapi.com/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/void \
-H "Authorization: Bearer $KNOX_SECRET_KEY"const Stripe = require('stripe');
const stripe = new Stripe(process.env.KNOX_SECRET_KEY, {host: 'api.knoxapi.com'});
const creditNote = await stripe.creditNotes.voidCreditNote('cn_1Pgc75B7WZ01zgkWJMPt5riP');import os
import stripe
client = stripe.StripeClient(
os.environ["KNOX_SECRET_KEY"],
base_addresses={"api": "https://api.knoxapi.com"},
)
credit_note = client.v1.credit_notes.void_credit_note("cn_1Pgc75B7WZ01zgkWJMPt5riP")require 'stripe'
Stripe.api_key = ENV['KNOX_SECRET_KEY']
Stripe.api_base = 'https://api.knoxapi.com'
credit_note = Stripe::CreditNote.void_credit_note('cn_1Pgc75B7WZ01zgkWJMPt5riP'){
"amount": 1690,
"amount_shipping": 0,
"created": 1234567890,
"currency": "usd",
"customer": "cus_QXg1o8vcGmoR32",
"customer_balance_transaction": null,
"discount_amount": 0,
"discount_amounts": [],
"effective_at": 1234567890,
"id": "cn_1Pgc75B7WZ01zgkWJMPt5riP",
"invoice": "in_1Pgc75B7WZ01zgkWYv4iMwt7",
"lines": {
"data": [
{
"amount": 1190,
"description": "My First Invoice Item (created for API docs)",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkWla6u0GdZ",
"invoice_line_item": "il_1Pgc74B7WZ01zgkWWh45tUBA",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [
{
"active": true,
"country": "DE",
"created": 1721954066,
"description": "VAT Germany",
"display_name": "VAT",
"effective_percentage": null,
"id": "txr_1Pgc74B7WZ01zgkW94BlEhHU",
"inclusive": false,
"jurisdiction": "DE",
"jurisdiction_level": null,
"livemode": false,
"metadata": {},
"object": "tax_rate",
"percentage": 19,
"state": null,
"tax_type": "vat",
"flat_amount": {
"amount": 1413853096,
"currency": "currency"
},
"rate_type": null
}
],
"type": "invoice_line_item",
"unit_amount": null,
"unit_amount_decimal": null,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
},
{
"amount": 500,
"description": "Service credit",
"discount_amount": 0,
"discount_amounts": [],
"id": "cnli_1Pgc75B7WZ01zgkW9m0EaOVh",
"livemode": false,
"object": "credit_note_line_item",
"quantity": 1,
"tax_rates": [],
"type": "custom_line_item",
"unit_amount": 500,
"unit_amount_decimal": "500",
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"taxes": null,
"metadata": null
}
],
"has_more": false,
"object": "list",
"url": "/v1/credit_notes/cn_1Pgc75B7WZ01zgkWJMPt5riP/lines"
},
"livemode": false,
"memo": null,
"metadata": {},
"number": "ABCD-1234-CN-01",
"object": "credit_note",
"out_of_band_amount": null,
"pdf": "https://sangeekp-15t6ai--manage-mydev.dev.stripe.me/credit_notes/acct_1PgafTB7WZ01zgkW/cnst_123456789/pdf?s=ap",
"shipping_cost": {
"amount_subtotal": 1555417355,
"amount_tax": 1424534716,
"amount_total": 1117121693,
"shipping_rate": null
},
"status": "issued",
"subtotal": 1690,
"subtotal_excluding_tax": 1690,
"total": 1690,
"total_excluding_tax": null,
"type": "pre_payment",
"voided_at": 1234567890,
"pretax_credit_amounts": [
{
"amount": 1413853096,
"type": "credit_balance_transaction"
}
],
"total_taxes": null,
"refunds": [
{
"amount_refunded": 1387154914,
"refund": "refund",
"payment_record_refund": {
"payment_record": "payment_record",
"refund_group": "refund_group"
},
"type": null
}
],
"post_payment_amount": 1355257296,
"pre_payment_amount": 251024947,
"reason": null,
"customer_account": null
}Operations and schemas come from the pinned Stripe OpenAPI specification (MIT); response examples from its fixtures. Nested object definitions and enums are in the complete specification.