A Credit Note is a document that specifies the money owed by a business to its customer. The seller usually issues a Credit Note for the same or lower amount than the invoice, and then repays the money to the customer or set it off against other 'due' invoices.
Adjustment Credit Notes are created for the 'unpaid' component of the invoice and it can have statuses - Adjusted and Voided.
Refundable Credit Notes are created for 'paid' component of the invoice and it can have statuses - Refunded, Refund Due and Voided.
The credits available in the Refundable Credit Notes will be automatically applied when a new invoice gets generated for the customer.
Note: If you have enabled consolidated invoicing, to know the subscriptions attached with a credit note you have to refer line_item'ssubscription_id. The credit note's subscription_id should not be used (which will be null if the credit note has lines from multiple subscriptions).
string, max chars=50 The identifier of the customer this Credit Note belongs to.
subscription_id
optional, string, max chars=50 The identifier of the subscription this Credit Note belongs to. Note: If consolidated invoicing is enabled, to know the subscriptions attached with this Credit Note you have to refer line_item'ssubscription_id. This attribute should not be used (which will be null if this credit note has lines from multiple subscriptions).
reference_invoice_id
string, max chars=50 The identifier of the invoice against which this Credit Note is issued
optional, enumerated string The reason for issuing this Credit Note. The following reason codes are supported now[Deprecated; use the create_reason_code parameter instead]
Possible values are
write_offThis reason will be set automatically for the Credit Notes created during invoice Write Off operation.subscription_changeThis reason will be set automatically for Credit Notes created during Change Subscription operation when proration is enabled.subscription_cancellationThis reason will be set automatically for Credit Notes created during cancel subscription operation.subscription_pauseThis reason will be automatically set to credit notes created during pause/resume subscription operation.
chargebackCan be set when you are recording your customer Chargebacks.product_unsatisfactoryProduct Unsatisfactory.service_unsatisfactoryService Unsatisfactory.order_changeOrder Change.order_cancellationOrder Cancellation.waiverWaiver.otherCan be set when none of the above reason codes are applicable.fraudulentFRAUDULENT.
adjustedWhen the Credit Note has been adjusted against an invoice.refundedWhen the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).refund_dueWhen the credits are yet to be used, or have been partially used.voidedWhen the Credit Note has been cancelled.
vat_number
optional, string, max chars=20 VAT number of the customer for whom this Credit Note is raised.
date
optional, timestamp(UTC) in seconds The date the Credit Note is issued.
price_type
enumerated string, default=tax_exclusive The price type of the Credit Note.
Possible values are
tax_exclusiveAll amounts in the document are exclusive of tax.tax_inclusiveAll amounts in the document are inclusive of tax.
currency_code
string, max chars=3 The currency code (ISO 4217 format) for the credit note
total
optional, in cents, default=0, min=0 Credit Note amount in cents.
amount_allocated
optional, in cents, default=0, min=0 The amount allocated to the invoices.
amount_refunded
optional, in cents, default=0, min=0 The refunds issued from this Credit Note.
amount_available
optional, in cents, default=0, min=0 The yet to be used credits of this Credit Note.
refunded_at
optional, timestamp(UTC) in seconds The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
voided_at
optional, timestamp(UTC) in seconds Timestamp indicating the date and time this Credit Note gets voided.
generated_at
optional, timestamp(UTC) in seconds The date/time when the credit note was raised. This date/time can be backdated, which means that the date/time can be earlier than the date/time the credit note was created.
resource_version
optional, long Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at
optional, timestamp(UTC) in seconds Timestamp indicating when this Credit Note was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
channel
optional, enumerated string The subscription channel this object originated from and is maintained in.
Possible values are
webThe object was created (and is maintained) for the web channel directly in Chargebee via API or UI.app_storeThe object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.play_storeThe object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
In-App Subscriptions is currently in early access. Contact eap@chargebee.com for more information.
.
sub_total
in cents, min=0 The Credit Note sub-total
sub_total_in_local_currency
optional, in cents, min=0 Invoice subtotal in the currency of the place of supply.
total_in_local_currency
optional, in cents, min=0 Total invoice amount in the currency of the place of supply.
local_currency_code
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed.
round_off_amount
optional, in cents, min=-99, max=99 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount. If there is no round-off amount, it will display 0.
fractional_correction
optional, in cents, min=0 Indicates the fractional correction amount.
deleted
boolean Indicates that this resource has been deleted.
tax_category
optional, string, max chars=null Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.
local_currency_exchange_rate
optional, bigdecimal, min=1E-9, max=999999999.999999999 This parameter represents the exchange rate as a relative price of the base currency that appears as local currency in invoices and credit notes. The local currency exchange rate specifically refers to the exchange rate of a country's currency when converting it to another currency.
For example, if you want to convert US dollars to euros, the local currency exchange rate would be the rate at which you can convert US dollars to euros.
create_reason_code
optional, string, max chars=100 Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Create Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive
vat_number_prefix
optional, string, max chars=10 An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_addresscountry as XI (which is United Kingdom - Northern Ireland).
When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_addresscountry as XI. That’s the code for United Kingdom - Northern
Ireland. The first two characters of the VAT number in such a case is
XI by default. However, if the VAT number was registered in UK, the value should be GB. Set
vat_number_prefix to GB for such cases.
business_entity_id
string, max chars=50 The ID of the business entity created for the site. For Product Catalog 1.0, all the site data is tied to this business entity.
optional, einvoice An e-invoice or electronic invoice is a structured representation of an invoice that is interoperable between computerized invoicing systems. Depending on the country, e-invoicing can be necessary to meet financial/taxation authority regulations.
Einvoice attributes
id
string, max chars=50 The unique id for the e-invoice. This is auto-generated by Chargebee.
reference_number
optional, string, max chars=100 This attribute is used to populate the unique reference number assigned to an invoice on the Invoice Registration Portal (IRP) network. It is essential for identifying and tracking invoices that are processed through the IRP network.
In the future, this field may be used to store similar reference numbers for other networks.
status
enumerated string The status of processing the e-invoice. To obtain detailed information about the current status, see message.
Possible values are
scheduledSending the e-invoice to the customer has been scheduled.skippedThe e-invoice was not sent. This could be due to missing information or because the entity_identifier is not registered on the e-invoicing network.in_progressThe e-invoice has been sent and Chargebee is waiting for confirmation from the receiving entity.successThe e-invoice has been successfully delivered to the customer.failedThe e-invoice was sent and there was an error due to which it was not delivered.registeredThe e-invoice was sent and there was an error due to which it was not delivered but got cleared in the IRP.
message
optional, string, max chars=250 Detailed information about the status of the e-invoice. When status is skipped or failed, this contains the reason or error details. The following are some valid examples:
Invoice successfully sent to customer via the e-invoicing network 9090:123456
Invoice successfully sent to customer via email id abc@acme.com
optional, in cents Total amount of this line item. Typically equals to unit amount x quantity
pricing_model
optional, enumerated string The pricing scheme for this item.
Possible values are
flat_feeA fixed price that is not quantity-based.per_unitA fixed price per unit quantity.tieredThe per unit price is based on the tier that the total quantity falls in.volumeThere are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.stairstepA quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.
is_taxed
boolean, default=false Specifies whether this line item is taxed or not
tax_amount
optional, in cents, default=0, min=0 The tax amount charged for this item
tax_rate
optional, double, min=0.0, max=100.0 Rate of tax used to calculate tax for this lineitem
unit_amount_in_decimal
optional, string, max chars=39 The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
quantity_in_decimal
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
amount_in_decimal
optional, string, max chars=39 The decimal representation of the amount for the line_item, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.
discount_amount
optional, in cents, min=0 Total discounts for this line
item_level_discount_amount
optional, in cents, min=0 Line Item-level discounts for this line.
reference_line_item_id
optional, string, max chars=40 Invoice Reference Line Item ID
description
string, max chars=250 Detailed description about this line item.
entity_description
optional, string, max chars=500 Detailed description about this item.
entity_type
enumerated string Specifies the modelled entity this line item is based on.
Possible values are
plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan idplanIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan idaddonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon idadhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case
tax_exempt_reason
optional, enumerated string The reason due to which the line item price/amount is exempted from tax.
Possible values are
tax_not_configuredIf tax is not enabled for the siteregion_non_taxableIf the product sold is not taxable in this region, but it is taxable in other regions, hence this region is not part of the Taxable jurisdictionexportYou are not registered for tax in the customer’s region. This is also the reason code when both billing_address and shipping_address have not been provided for the customer and subscription respectivelycustomer_exemptIf the Customer is marked as Tax exempt
product_exemptIf the Plan or Addon is marked as Tax exemptzero_ratedIf the rate of tax is 0% and no Sales/ GST tax is collectable for that line itemreverse_chargeIf the Customer is identified as B2B customer (when VAT Number is entered), applicable for EU onlyhigh_value_physical_goodsIf physical goods are sold from outside Australia to customers in Australia, and the price of all the physical good line items is greater than AUD 1000, then tax will not be appliedzero_value_itemIf the total invoice value/amount is equal to zero. E.g., If the total order value is $10 and a $10 coupon has been applied against that order, the total order value becomes $0. Hence the invoice value also becomes $0.
optional, list of discount The list of discounts applied to this Credit Note
Discount attributes
amount
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
description
optional, string, max chars=250 Description for this deduction.
line_item_id
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type] is item_level_coupon or document_level_coupon.
entity_type
enumerated string The type of deduction and the amount to which it is applied.
Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id is passed as entity_id.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total. The coupon id is passed as entity_id.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id is null in this case. The legacy credits feature is superseded by adjustment_credit_notes.
entity_id
optional, string, max chars=100 When the deduction is due to a coupon, then this is the id of the coupon.
coupon_set_code
optional, string, max chars=50 The coupon code, if applicable, used to provide the discount. The coupon.id is available in entity_id.
optional, list of line_item_discount The list of discount(s) applied for each line item of this invoice.
Line item discount attributes
line_item_id
string, max chars=50 The unique id of the line item that this deduction is for.
discount_type
enumerated string The type of deduction and the amount to which it is applied.
Possible values are
item_level_couponThe deduction is due to a coupon applied to a line item of the invoice. The coupon id is available as entity_id.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total. The coupon id is available as entity_id.promotional_creditsThe deduction is due to a promotional credit applied to the invoice. The entity_id is null in this case.prorated_creditsThe deduction is due to a legacy adjustment credit applied to the invoice. The entity_id is null in this case. The legacy credits feature is superseded by adjustment_credit_notes.
coupon_id
optional, string, max chars=50 When the deduction is due to a coupon, then this is the id of the coupon.
discount_amount
in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
optional, list of line_item_tier The list of tiers applicable for this line item
Line item tier attributes
line_item_id
optional, string, max chars=40 Uniquely identifies a line_item
starting_unit
integer, min=0 The lower limit of a range of units for the tier
ending_unit
optional, integer The upper limit of a range of units for the tier
quantity_used
integer, min=0 The number of units purchased in a range.
unit_amount
in cents, min=0 The price of the tier if the charge model is a stairtstep pricing , or the price of each unit in the tier if the charge model is tiered/volume pricing.
starting_unit_in_decimal
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
ending_unit_in_decimal
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
quantity_used_in_decimal
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
unit_amount_in_decimal
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
optional, list of line_item_tax The list of taxes applied on line items
Line item tax attributes
line_item_id
optional, string, max chars=40 The unique reference id of the line item for which the tax is applicable
tax_name
string, max chars=100 The name of the tax applied
tax_rate
double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
is_partial_tax_applied
optional, boolean Indicates if tax is applied only on a portion of the line item amount.
is_non_compliance_tax
optional, boolean Indicates the non-compliance tax that should not be reported to the jurisdiction.
taxable_amount
in cents, min=0 Indicates the actual portion of the line item amount that is taxable.
tax_amount
in cents, min=0 The tax amount
tax_juris_type
optional, enumerated string The type of tax jurisdiction
Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
tax_juris_name
optional, string, max chars=250 The name of the tax jurisdiction
tax_juris_code
optional, string, max chars=250 The tax jurisdiction code
tax_amount_in_local_currency
optional, in cents, min=0 Total tax amount in the currency of the place of supply. This is applicable only for Invoice and Credit Notes API.
local_currency_code
optional, string, max chars=3 The currency code (ISO 4217 format) of the place of supply in which VAT needs to be converted and displayed. This is applicable only for Invoice and Credit Notes API.
optional, list of credit_note_transaction Payment Refunds issued from this Credit Note
Linked refund attributes
txn_id
string, max chars=40 Uniquely identifies the transaction.
applied_amount
in cents, min=0 The transaction amount applied to this invoice
applied_at
timestamp(UTC) in seconds Time when the transaction amount applied to this invoice
txn_status
optional, enumerated string The status of this transaction.
Possible values are
in_progressTransaction is being processed by the gateway. This typically happens for direct debit transactions or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method.successThe transaction is successful.voidedThe transaction got voided or authorization expired at gateway.failureTransaction failed. Refer the 'error_code' and 'error_text' fields to know the reason for failuretimeoutTransaction failed because of Gateway not accepting the connection.needs_attentionConnection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually
txn_date
optional, timestamp(UTC) in seconds Indicates when this transaction occurred.
txn_amount
optional, in cents, min=1 Total amount of the transaction
refund_reason_code
optional, string, max chars=100 Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Refund Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive
optional, list of linked_tax_withheld_refund The details of refunds recorded against the invoice.linked_taxes_withheld component of the invoiceassociated with this credit_note.
Linked tax withheld refund attributes
id
string, max chars=40 An auto-generated unique identifier for the tax withheld. The value starts with the prefix tax_wh_. For example, tax_wh_16BdDXSlbu4uV1Ee6.
amount
optional, in cents, min=1 The amount withheld by the customer as tax from the invoice. The unit depends on the type of currency.
description
optional, string, max chars=65k The description for this tax withheld.
date
optional, timestamp(UTC) in seconds Date or time associated with the tax withheld.
reference_number
optional, string, max chars=100 A unique external reference number for the tax withheld. Typically, this is the reference number used by the system you are integrating the API with. Depending on your integration, this could be the reference number issued by the taxation authority to identify the customer or the specific tax transaction.
optional, list of applied_credit Invoice allocations made from this Credit Note.
Allocation attributes
invoice_id
string, max chars=50 Unique identifier of the invoice.
allocated_amount
in cents, min=0 Amount of this refund transaction.
allocated_at
timestamp(UTC) in seconds Indicates when this refund occured.
invoice_date
optional, timestamp(UTC) in seconds Closing date of the invoice. Typically this is the date on which invoice is generated
invoice_status
enumerated string Current status of the invoice.
Possible values are
paidIndicates a paid invoice.postedIndicates the payment is not yet collected and will be in this state till the due date to indicate the due periodpayment_dueIndicates the payment is not yet collected and is being retried as per retry settings.not_paidIndicates the payment is not made and all attempts to collect is failed.voidedIndicates a voided invoice.pending
The invoice is yet to be closed (sent for payment collection). An invoice is generated with this status when it has line items that belong to items that are metered or when the subscription.create_pending_invoicesattribute is set to true.
The invoice is yet to be closed (sent for payment collection). All invoices are generated with this status when Metered Billing is enabled for the site.
optional, shipping_address Shipping address for the quote.
Shipping address attributes
first_name
optional, string, max chars=150 The first name of the contact.
last_name
optional, string, max chars=150 The last name of the contact.
email
optional, string, max chars=70 The email address.
company
optional, string, max chars=250 The company name.
phone
optional, string, max chars=50 The phone number.
line1
optional, string, max chars=150 Address line 1
line2
optional, string, max chars=150 Address line 2
line3
optional, string, max chars=150 Address line 3
city
optional, string, max chars=50 The name of the city.
state_code
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
state
optional, string, max chars=50 The state/province name.
country
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.
zip
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
validation_status
optional, enumerated string, default=not_validated The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
index
integer, min=0 The index number of the subscription/one-time group to which the item price is added. Provide a unique number between 0 and 9 (inclusive) for each group that is to be created. To increase this limit, contact Chargebee Support
optional, billing_address Billing address for the quote.
Billing address attributes
first_name
optional, string, max chars=150 The first name of the billing contact.
last_name
optional, string, max chars=150 The last name of the billing contact.
email
optional, string, max chars=70 The email address.
company
optional, string, max chars=250 The company name.
phone
optional, string, max chars=50 The phone number.
line1
optional, string, max chars=150 Address line 1
line2
optional, string, max chars=150 Address line 2
line3
optional, string, max chars=150 Address line 3
city
optional, string, max chars=50 The name of the city.
state_code
optional, string, max chars=50 The ISO 3166-2 state/province code without the country prefix. Currently supported for USA, Canada and India. For instance, for Arizona (USA), set state_code as AZ (not US-AZ). For Tamil Nadu (India), set as TN (not IN-TN). For British Columbia (Canada), set as BC (not CA-BC).
state
optional, string, max chars=50 State or Province
country
optional, string, max chars=50 The billing address country of the customer. Must be one of ISO 3166 alpha-2 country code.
Note: If you enter an invalid country code, the system will return an error.
Brexit
If you have enabled EU VAT in 2021 or later, or have manually enable the Brexit configuration, then XI (the code for United Kingdom – Northern Ireland) is available as an option.
zip
optional, string, max chars=20 Zip or postal code. The number of characters is validated according to the rules specified here.
validation_status
optional, enumerated string, default=not_validated The address verification status.
Possible values are
not_validatedAddress is not yet validated.validAddress was validated successfully.partially_validThe address is valid for taxability but has not been validated for shipping.invalidAddress is invalid.
If the credit_notetype is refundable, then linked_taxes_withheld.amount for the invoice specified can also be included in the total.
Sample Request
curl https://{site}.chargebee.com/api/v2/credit_notes \
-u {site_api_key}:\
-d reference_invoice_id="__demo_inv__1" \
-d total=500 \
-d type="refundable" \
-d reason_code="product_unsatisfactory" \
-d customer_notes="Products were returned because they were defective"
copy
curl https://{site}.chargebee.com/api/v2/credit_notes \
-u {site_api_key}:\
-d reference_invoice_id="__demo_inv__1" \
-d total=500 \
-d type="refundable" \
-d reason_code="product_unsatisfactory" \
-d customer_notes="Products were returned because they were defective"
required, string, max chars=50 The identifier of the invoice against which this Credit Note is issued.
total
optional, in cents, default=0, min=0 Credit Note amount in cents. You can either pass the total parameter or the line_items parameter. Passing both will result in an error.
optional, enumerated string The reason for issuing this Credit Note. The following reason codes are supported now[Deprecated; use the create_reason_code parameter instead].
Possible values are
product_unsatisfactoryProduct Unsatisfactoryservice_unsatisfactoryService Unsatisfactoryorder_changeOrder Changeorder_cancellationOrder CancellationwaiverWaiverotherCan be set when none of the above reason codes are applicable
optional, string, max chars=100 Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Create Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive.
date
optional, timestamp(UTC) in seconds The date the Credit Note is issued.
customer_notes
optional, string, max chars=2000 A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the Credit Note PDF.
comment
optional, string, max chars=300 An internal comment to be added for this operation, to the credit note. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Credit Note PDF.
+
line_items
Parameters for line_items. Multiple line_items can be passed by specifying unique indices.
pass parameters as line_items[<param name>][<idx:0..n>]
line_items[reference_line_item_id][0..n]
required, string, max chars=40 Uniquely identifies a line_item
line_items[unit_amount][0..n]
optional, in cents Unit amount of the line item. Required for FLAT_FEE, PER_UNIT and VOLUME pricing model.
line_items[unit_amount_in_decimal][0..n]
optional, string, max chars=39 The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Applicable for the line_item when the pricing_model is flat_fee, per_unit or volume. Can be provided only when multi-decimal pricing is enabled.
line_items[quantity][0..n]
optional, integer, default=1 Quantity of the line item. Required for PER_UNIT and VOLUME pricing model.
line_items[quantity_in_decimal][0..n]
optional, string, max chars=33 The decimal representation of the quantity of the line_item. Applicable for the line_item when the pricing_model is per_unit and volume. Can be provided only when multi-decimal pricing is enabled.
line_items[amount][0..n]
optional, in cents Amount of the line item. Applicable only for STAIRSTEP, TIERED pricing_model.
line_items[date_from][0..n]
optional, timestamp(UTC) in seconds Start date of this line item.
line_items[date_to][0..n]
optional, timestamp(UTC) in seconds End date of this line item.
line_items[description][0..n]
optional, string, max chars=250 Description for the line item.
Download the e-invoice for the credit note in both XML and PDF formats. The response consists of a download object for each format. The XML format follows the structure as per Peppol BIS Billing v3.0.
Note
You can only download e-invoices when their status is success or registered.
There are some cases in which the PDF is not available for download. In such cases, you can obtain it from the XML by decoding the value for cbc:EmbeddedDocumentBinaryObject, which is the Base64-encoded version of the PDF.
optional, in cents, min=1 The amount to be refunded. If not specified, the entire refundable amount for this credit_note is refunded.
Note: Any linked_tax_withheld_refunds associated with the credit_note cannot be refunded via this operation.
customer_notes
optional, string, max chars=2000 A note to be added for this operation, to the credit note. This note is displayed on customer-facing documents such as the Credit Note PDF.
refund_reason_code
optional, string, max chars=100 Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Refund Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive.
Refunds a (refundable) credit note. The refund is provided against linked_payments first and then against any linked_taxes_withheld for the invoice associated with the credit_note. For payments made via online transactions, the refund request is processed via the payment source associated with the transaction.
optional, string, max chars=100 Reason code for the refund. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Refund Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive.
comment
optional, string, max chars=300 Remarks, if any, on the refund.
+
transaction
Parameters for transaction
pass parameters as transaction[<param name>]
transaction[amount]
optional, in cents, min=1 The amount to be refunded (for online payments) or recorded as refunded (for offline payments). If not specified, the entire refundable amount for this credit_note is refunded.
Note: Any linked_tax_withheld_refunds associated with the credit_note can also be recorded as refunded via this operation.
transaction[payment_method]
required, enumerated string, default=card The payment method of this transaction
Possible values are
cashCashcheckCheckchargebackOnly applicable for a transaction of type = refund. This value is set by Chargebee when an automated chargeback occurs. You can also set this explicitly when recording a refund.
bank_transferBank TransferotherPayment Methods other than the above typescustomCustom
Use this API to void a credit note. A voided credit is a null entity and cannot be used again. A credit note which has already been voided or refunded cannot be voided. An error message will be displayed when you render such credit notes void.
Note: When adjustment credit notes are voided, the associated invoice will reflect as NOT PAID, and the amount in the invoice will be recalculated to reflect the amount after considering the voided credit note.
Sample Request
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__8/void \
-X POST \
-u {site_api_key}:
copy
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__8/void \
-X POST \
-u {site_api_key}:
optional, integer, default=10, min=1, max=100 The number of resources to be returned.
offset
optional, string, max chars=1000 Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
include_deleted
optional, boolean, default=false If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
sort_by[<sort-order>]
optional, string filter Sorts based on the specified attribute. Supported attributes : date Supported sort-orders : asc, desc
Example →sort_by[asc] = "date" This will sort the result based on the 'date' attribute in ascending(earliest first) order.
optional, string filter Credit-note id. Supported operators : is, is_not, starts_with, in, not_in
Example →id[is] = "CN_123"
customer_id[<operator>]
optional, string filter The identifier of the customer this Credit Note belongs to. Supported operators : is, is_not, starts_with, in, not_in
Example →customer_id[is] = "4gmiXbsjdm"
subscription_id[<operator>]
optional, string filter To filter based on subscription_id. NOTE: Not to be used if consolidated invoicing feature is enabled. Supported operators : is, is_not, starts_with, is_present, in, not_in
Example →subscription_id[is] = "4gmiXbsjdm"
reference_invoice_id[<operator>]
optional, string filter The identifier of the invoice against which this Credit Note is issued. Supported operators : is, is_not, starts_with, in, not_in
Example →reference_invoice_id[is_not] = "INVOICE_876"
type[<operator>]
optional, enumerated string filter The credit note type. Possible values are : adjustment, refundable. Supported operators : is, is_not, in, not_in
Example →type[is] = "adjustment"
reason_code[<operator>]
optional, enumerated string filter The reason for issuing this Credit Note. The following reason codes are supported now[Deprecated; use the create_reason_code parameter instead]. Possible values are : write_off, subscription_change, subscription_cancellation, subscription_pause, chargeback, product_unsatisfactory, service_unsatisfactory, order_change, order_cancellation, waiver, other, fraudulent. Supported operators : is, is_not, in, not_in
Example →reason_code[is_not] = "waiver"
create_reason_code[<operator>]
optional, string filter Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Create Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive. Supported operators : is, is_not, starts_with, in, not_in
Example →create_reason_code[is] = "Other"
status[<operator>]
optional, enumerated string filter The credit note status. Possible values are : adjusted, refunded, refund_due, voided. Supported operators : is, is_not, in, not_in
Example →status[is_not] = "adjusted"
date[<operator>]
optional, timestamp(UTC) in seconds filter The date the Credit Note is issued. Supported operators : after, before, on, between
Example →date[on] = "1435054328"
total[<operator>]
optional, in cents filter Credit Note amount in cents. Supported operators : is, is_not, lt, lte, gt, gte, between
Example →total[is] = "1200"
price_type[<operator>]
optional, enumerated string filter The price type of the Credit Note. Possible values are : tax_exclusive, tax_inclusive. Supported operators : is, is_not, in, not_in
Example →price_type[is] = "tax_exclusive"
amount_allocated[<operator>]
optional, in cents filter The amount allocated to the invoices. Supported operators : is, is_not, lt, lte, gt, gte, between
Example →amount_allocated[is_not] = "1200"
amount_refunded[<operator>]
optional, in cents filter The refunds issued from this Credit Note. Supported operators : is, is_not, lt, lte, gt, gte, between
Example →amount_refunded[is] = "130"
amount_available[<operator>]
optional, in cents filter The yet to be used credits of this Credit Note. Supported operators : is, is_not, lt, lte, gt, gte, between
Example →amount_available[is] = "1400"
voided_at[<operator>]
optional, timestamp(UTC) in seconds filter Timestamp indicating the date and time this Credit Note gets voided. Supported operators : after, before, on, between
Example →voided_at[after] = "1435054328"
updated_at[<operator>]
optional, timestamp(UTC) in seconds filter To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28. Supported operators : after, before, on, between
Example →updated_at[on] = "1243545465"
channel[<operator>]
optional, enumerated string filter The subscription channel this object originated from and is maintained in. Possible values are : web, app_store, play_store. Supported operators : is, is_not, in, not_in
Example →channel[is_not] = "APP STORE"
+
einvoice
Parameters for einvoice
pass parameters as einvoice[<param name>][<operator>]
einvoice[status][operator]
optional, enumerated string filter The status of processing the e-invoice. To obtain detailed information about the current status, see message. Possible values are : scheduled, skipped, in_progress, success, failed, registered. Supported operators : is, is_not, in, not_in
always returned
Resource object representing credit_note
next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter “offset”.
This API deletes a credit note. A credit note once deleted, is deleted permanently. You cannot delete a credit which has already been deleted or refunded. If you try to delete a refunded or deleted credit note, an error message will be displayed.
Sample Request
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__2/delete \
-X POST \
-u {site_api_key}:
copy
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__2/delete \
-X POST \
-u {site_api_key}:
Parameters for tax_withheld
pass parameters as tax_withheld[<param name>]
tax_withheld[id]
required, string, max chars=40 An auto-generated unique identifier for the tax withheld. The value starts with the prefix tax_wh_. For example, tax_wh_16BdDXSlbu4uV1Ee6.
required if Multicurrency is enabled, string, max chars=3 The currency code (ISO 4217 format) for the credit note.
create_reason_code
required, string, max chars=100 Reason code for creating the credit note. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Credit Notes > Create Credit Note. Must be passed if set as mandatory in the app. The codes are case-sensitive.
date
required, timestamp(UTC) in seconds The date the Credit Note is issued.
status
optional, enumerated string The credit note status.
Possible values are
adjustedWhen the Credit Note has been adjusted against an invoice.refundedWhen the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).refund_dueWhen the credits are yet to be used, or have been partially used.voidedWhen the Credit Note has been cancelled.
total
optional, in cents, default=0, min=0 Credit Note amount in cents.
refunded_at
optional, timestamp(UTC) in seconds The time this Credit Note gets fully used. Please note that this field is not present when partial refunds are issued.
voided_at
optional, timestamp(UTC) in seconds Timestamp indicating the date and time this Credit Note gets voided.
sub_total
optional, in cents, min=0 The Credit Note sub-total.
round_off_amount
optional, in cents, min=-99, max=99 Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the round_off_amount. If there is no round-off amount, it will display 0.
fractional_correction
optional, in cents, min=0 Indicates the fractional correction amount.
vat_number_prefix
optional, string, max chars=10 An overridden value for the first two characters of the full VAT
number. Only applicable specifically for customers with billing_addresscountry as XI (which is United Kingdom - Northern Ireland).
When you have enabled EU VAT in 2021 or have manually
enabled the Brexit configuration, you have the option of setting billing_addresscountry as XI. That’s the code for United Kingdom - Northern
Ireland. The first two characters of the VAT number in such a case is
XI by default. However, if the VAT number was registered in UK, the value should be GB. Set
vat_number_prefix to GB for such cases.
+
line_items
Parameters for line_items. Multiple line_items can be passed by specifying unique indices.
pass parameters as line_items[<param name>][<idx:0..n>]
line_items[reference_line_item_id][0..n]
optional, string, max chars=40 Uniquely identifies a line_item of invoice for which this reversal represents.
line_items[id][0..n]
optional, string, max chars=40 Uniquely identifies a line_item
line_items[date_from][0..n]
optional, timestamp(UTC) in seconds Start date of this line item.
line_items[date_to][0..n]
optional, timestamp(UTC) in seconds End date of this line item.
line_items[subscription_id][0..n]
optional, string, max chars=50 A unique identifier for the subscription this line item belongs to.
line_items[description][0..n]
required, string, max chars=250 Description for this line item
line_items[unit_amount][0..n]
optional, in cents Unit amount of the line item.
line_items[quantity][0..n]
optional, integer, default=1
Quantity of the recurring item which is represented by this line item. For metered line items, this value is updated from usages once when the invoice is generated as pending and finally when the invoice is closed.
optional, in cents Total amount of this lineitem. Not required if the line_items[unit_amount] param is passed
line_items[unit_amount_in_decimal][0..n]
optional, string, max chars=39 The decimal representation of the unit amount of the line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
line_items[quantity_in_decimal][0..n]
optional, string, max chars=33 The decimal representation of the quantity of this line_item. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
line_items[amount_in_decimal][0..n]
optional, string, max chars=39 The decimal representation of the amount for the line_item, in major units of the currency. Typically equals to unit_amount_in_decimal x quantity_in_decimal. Returned when multi-decimal pricing is enabled.
line_items[entity_type][0..n]
optional, enumerated string, default=adhoc Specifies the modelled entity this line item is based on.
Possible values are
plan_setupIndicates that this lineitem is based on 'Plan Setup' charge. The 'entity_id' attribute specifies the plan idplanIndicates that this lineitem is based on 'Plan' entity. The 'entity_id' attribute specifies the plan idaddonIndicates that this lineitem is based on 'Addon' entity. The 'entity_id' attribute specifies the addon idadhocIndicates that this lineitem is not modelled. i.e created adhoc. So the 'entity_id' attribute will be null in this case
line_items[entity_id][0..n]
optional, string, max chars=100 The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type
line_items[item_level_discount1_entity_id][0..n]
optional, string, max chars=50 First item level discount entity id
line_items[item_level_discount1_amount][0..n]
optional, in cents, min=0 First item level discount amount
line_items[item_level_discount2_entity_id][0..n]
optional, string, max chars=50 Second item level discount entity id
line_items[item_level_discount2_amount][0..n]
optional, in cents, min=0 Second item level discount amount
line_items[tax1_name][0..n]
optional, string, max chars=50 First tax name
line_items[tax1_amount][0..n]
optional, in cents, min=0 First tax amount
line_items[tax2_name][0..n]
optional, string, max chars=50 Second tax name
line_items[tax2_amount][0..n]
optional, in cents, min=0 Second tax amount
line_items[tax3_name][0..n]
optional, string, max chars=50 Third tax name
line_items[tax3_amount][0..n]
optional, in cents, min=0 Third tax amount
line_items[tax4_name][0..n]
optional, string, max chars=50 Fourth tax name
line_items[tax4_amount][0..n]
optional, in cents, min=0 Fourth tax amount
line_items[tax5_name][0..n]
optional, string, max chars=50 Fifth tax name
line_items[tax5_amount][0..n]
optional, in cents, min=0 Fifth tax amount
line_items[tax6_name][0..n]
optional, string, max chars=50 Sixth tax name
line_items[tax6_amount][0..n]
optional, in cents, min=0 Sixth tax amount
line_items[tax7_name][0..n]
optional, string, max chars=50 Seventh tax name
line_items[tax7_amount][0..n]
optional, in cents, min=0 Seventh tax amount
line_items[tax8_name][0..n]
optional, string, max chars=50 Eighth tax name
line_items[tax8_amount][0..n]
optional, in cents, min=0 Eighth tax amount
line_items[tax9_name][0..n]
optional, string, max chars=50 Ninth tax name
line_items[tax9_amount][0..n]
optional, in cents, min=0 Ninth tax amount
line_items[tax10_name][0..n]
optional, string, max chars=50 Tenth tax name
line_items[tax10_amount][0..n]
optional, in cents, min=0 Tenth tax amount
line_items[reference_line_item_id][0..n]
optional, string, max chars=40 Uniquely identifies a line_item of invoice for which this reversal represents.
+
line_item_tiers
Parameters for line_item_tiers. Multiple line_item_tiers can be passed by specifying unique indices.
pass parameters as line_item_tiers[<param name>][<idx:0..n>]
line_item_tiers[line_item_id][0..n]
required, string, max chars=40 Uniquely identifies a line_item
line_item_tiers[starting_unit][0..n]
optional, integer, min=0 The lower limit of a range of units for the tier
line_item_tiers[ending_unit][0..n]
optional, integer The upper limit of a range of units for the tier
line_item_tiers[quantity_used][0..n]
optional, integer, min=0 The number of units purchased in a range.
line_item_tiers[unit_amount][0..n]
optional, in cents, min=0 The price of the tier if the charge model is a stairtstep pricing , or the price of each unit in the tier if the charge model is tiered/volume pricing.
line_item_tiers[starting_unit_in_decimal][0..n]
optional, string, max chars=33 The decimal representation of the the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as ending_unit_in_decimal of the next lower tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
line_item_tiers[ending_unit_in_decimal][0..n]
optional, string, max chars=33 The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the starting_unit_in_decimal of the next higher tier. Returned only when the line_items.pricing_model is tiered, volume or stairstep and multi-decimal pricing is enabled.
line_item_tiers[quantity_used_in_decimal][0..n]
optional, string, max chars=33 The decimal representation of the quantity purchased from this tier. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
line_item_tiers[unit_amount_in_decimal][0..n]
optional, string, max chars=40 The decimal representation of the per-unit price for the tier when the pricing_model is tiered or volume. When the pricing_model is stairstep, it is the decimal representation of the total price for line_item. The value is in major units of the currency. Returned when the line_item is quantity-based and multi-decimal pricing is enabled.
+
discounts
Parameters for discounts. Multiple discounts can be passed by specifying unique indices.
pass parameters as discounts[<param name>][<idx:0..n>]
discounts[line_item_id][0..n]
optional, string, max chars=40 The unique id of the line item that this deduction is for. Is required when discounts[entity_type] is item_level_coupon or document_level_coupon.
discounts[entity_type][0..n]
required, enumerated string The type of deduction and the amount to which it is applied.
Possible values are
item_level_couponThe deduction is due to a coupon applied to line item. The coupon id is passed as entity_id.document_level_couponThe deduction is due to a coupon applied to the invoice sub_total. The coupon id is passed as entity_id.promotional_creditsThe deduction is due to a promotional credit applied to the invoice.
discounts[entity_id][0..n]
optional, string, max chars=100 When the deduction is due to a coupon, then this is the id of the coupon. Is required when discounts[entity_type] is item_level_coupon or document_level_coupon.
discounts[description][0..n]
optional, string, max chars=250 Description for this deduction.
discounts[amount][0..n]
required, in cents, min=0 The amount deducted. The format of this value depends on the kind of currency.
+
taxes
Parameters for taxes. Multiple taxes can be passed by specifying unique indices.
pass parameters as taxes[<param name>][<idx:0..n>]
taxes[name][0..n]
required, string, max chars=100 The name of the tax applied
taxes[rate][0..n]
required, double, default=0.0, min=0.0, max=100.0 The rate of tax used to calculate tax amount
taxes[amount][0..n]
optional, in cents, min=0 Total tax amount charged for this invoice
taxes[description][0..n]
optional, string, max chars=50 Description of tax
taxes[juris_type][0..n]
optional, enumerated string, default=other The type of tax jurisdiction
Possible values are
countryThe tax jurisdiction is a countryfederalThe tax jurisdiction is a federalstateThe tax jurisdiction is a statecountyThe tax jurisdiction is a countycityThe tax jurisdiction is a cityspecialSpecial tax jurisdiction.unincorporatedCombined tax of state and county.otherJurisdictions other than the ones listed above.
taxes[juris_name][0..n]
optional, string, max chars=250 The name of the tax jurisdiction
taxes[juris_code][0..n]
optional, string, max chars=250 The tax jurisdiction code
+
allocations
Parameters for allocations. Multiple allocations can be passed by specifying unique indices.
pass parameters as allocations[<param name>][<idx:0..n>]
allocations[invoice_id][0..n]
required, string, max chars=50 The unique invoice ID for the allocation
allocations[allocated_amount][0..n]
required, in cents, min=1 The allocated amount for the credit note
allocations[allocated_at][0..n]
required, timestamp(UTC) in seconds Time when the allocation was occurred
+
linked_refunds
Parameters for linked_refunds. Multiple linked_refunds can be passed by specifying unique indices.
pass parameters as linked_refunds[<param name>][<idx:0..n>]
linked_refunds[amount][0..n]
required, in cents, min=1 Amount of this refund transaction.
linked_refunds[payment_method][0..n]
required, enumerated string Mode of refund.
Possible values are
cashCashcheckCheck
bank_transferBank TransferotherPayment Methods other than the above typescustomCustom