Imports a credit note into Chargebee Billing. This endpoint allows you to import a credit note from external systems, such as accounting software, into Chargebee.
Use this operation during data migration or reconciliation to ensure historical credits are represented in the system. The credit note is linked to a reference invoice and can be allocated to other invoices or recorded as refunded to the customer.
Impacts
Credit Note
The credit note's billing_address, shipping_address, and vat_number are copied from the reference invoice.
Invoices
Reference invoice
Other invoices
- If
allocations[]are provided, then for each allocated invoice:- the invoice's
amount_duedecreases by the allocated amount - the invoice
statuschanges topaidif theamount_duebecomes zero - an applied credit record is created to track the allocation.
- the invoice's
Transactions
If linked_refunds[] are provided, then for each refund provided, a transaction of type refund is created with status set to success.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
The unique identifier for the credit note (credit note number).
Constraints
- Must not conflict with existing credit note numbers in your Chargebee Billing site.
- Must not conflict with future credit note numbers that your Chargebee Billing site may generate.
The unique identifier of the customer for whom the credit note is created.
Required if
subscription_idis not provided.
Constraints
- Must match the customer of the
reference_invoice_id.
The unique identifier of the subscription for which this credit note is created.
Required if
customer_idis not provided.
Constraints
- Must match the subscription of the
reference_invoice_id. - Must not be provided if
line_items[subscription_id][]is provided.
The credit note type. Determines how the credit note can be used. Learn more about credit note types.
Adjustment credit note.
Refundable credit note.
Store credit note.
Constraints
- The
typevaluestoreis not supported for this API operation.
The currency code (ISO 4217 format) for the credit note.
Required if
- Multi-currency pricing is enabled for the site and
customer_idis provided.
The reason code for creating the credit note.
Required if
- Reason codes are mandatory in Chargebee Billing.
Constraints
- Must be a valid and enabled reason code from the list configured in Chargebee Billing.
- The reason code can also be from Refund Credit Note reason codes.
- The codes are case-sensitive.
The date when the credit note was issued.
Constraints
- Must be a date in the past.
- Must be after the
dateof the reference invoice.
The status of the credit note. Determines the current state of the credit note and how it can be used.
Default value
adjustediftypeisadjustment.- if
typeisrefundable:refundedif the credit notetotalis equal to the sum oflinked_refunds[amount][]plus the sum ofallocations[allocated_amount][].refund_dueotherwise.
The credit note has been adjusted against an invoice.
Constraints
- Must only be set when
typeisadjustment. - Requires
allocations[]to be provided andlinked_refunds[]must not be provided.
The entire credit note amount has been used (either allocated to invoices or refunded).
Constraints
- Must only be set when
typeisrefundable. - Requires
linked_refunds[]and/orallocations[]to be provided. - The sum of
linked_refunds[amount][]plus the sum ofallocations[allocated_amount][]must equal the credit notetotal.
The credits are yet to be used or have been partially used.
Constraints
- Must only be set when
typeisrefundable. - The credit note
totalmust be greater than the sum oflinked_refunds[amount][]plus the sum ofallocations[allocated_amount][].
The credit note has been cancelled.
Constraints
linked_refunds[]andallocations[]must not be provided whenstatusisvoided.
The total amount of the credit note.
Constraints
- For refundable credit notes (
type=refundable), this must be less than or equal to the reference invoice's refundable amount. - For adjustment credit notes (
type=adjustment), this must be less than or equal to the reference invoice'samount_to_collect.
The rounded-off amount for the credit note. For example, if the credit note amount is $99.99 and it is rounded off to $100.00, then $0.01 is the round_off_amount.
Constraints
- Not supported for zero-decimal currencies.
An overridden value for the first two characters of the full VAT number.
Only applicable specifically for customers with billing_address
country
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_address
country
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.