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.
Chargebee supports two types of Credit Notes - Adjustment Credit Note and Refundable Credit Note.
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's subscription_id. The credit note's subscription_id should not be used (which will be null if the credit note has lines from multiple subscriptions).
{
"allocations": [],
"amount_allocated": 0,
"amount_available": 500,
"amount_refunded": 0,
"base_currency_code": "USD",
"create_reason_code": "Product Unsatisfactory",
"currency_code": "USD",
"customer_id": "__test__KyVnHhSBWSy4m5e",
"date": 1517501405,
"deleted": false,
"exchange_rate": 1,
"fractional_correction": 0,
"id": "__demo_cn__1",
"line_item_discounts": [],
"line_item_taxes": [],
"line_items": [
{
"amount": 500,
"customer_id": "__test__KyVnHhSBWSy4m5e",
"date_from": 1517501405,
"date_to": 1517501405,
"description": "Support Charge",
"discount_amount": 0,
"entity_type": "adhoc",
"id": "li___test__KyVnHhSBWSyHE5r",
"is_taxed": false,
"item_level_discount_amount": 0,
"object": "line_item",
"pricing_model": "flat_fee",
"quantity": 1,
"tax_amount": 0,
"tax_exempt_reason": "tax_not_configured",
"unit_amount": 500
}
],
"linked_refunds": [],
"object": "credit_note",
"price_type": "tax_exclusive",
"reason_code": "product_unsatisfactory",
"reference_invoice_id": "__demo_inv__1",
"resource_version": 1517501405000,
"round_off_amount": 0,
"status": "refund_due",
"sub_total": 500,
"taxes": [],
"total": 500,
"type": "refundable",
"updated_at": 1517501405
}
round_off_amount
. If there is no round-off amount
, it will display 0
. billing_address
country
as XI
(which is United Kingdom - Northern Ireland).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. reference_invoice_id
. invoice.linked_taxes_withheld
component of the invoice
associated with this credit_note
. Creates a credit_note
for the specified invoice.
Note:
If the credit_note
type
is refundable
, then linked_taxes_withheld.amount
for the invoice specified can also be included in the total
.
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"
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__7 \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__4/pdf \ -X POST \ -u {site_api_key}:
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
status
is success
or registered
.cbc:EmbeddedDocumentBinaryObject
, which is the Base64-encoded version of the PDF.curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__1/download_einvoice \ -u {site_api_key}:
Refunds a (refundable) credit note to the payment source associated with the transaction. Any linked_tax_withheld_refunds
recorded against the credit note are not refunded.
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__6/refund \ -u {site_api_key}:\ -d customer_notes="Refunding as customer canceled the order." \ -d refund_amount=1000
credit_note
is refunded.
Note: Any linked_tax_withheld_refunds
associated with the credit_note
cannot be refunded via this operation. 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.
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__5/record_refund \ -u {site_api_key}:\ -d comment="Refunding as customer canceled the order." \ -d transaction[amount]=100 \ -d transaction[payment_method]="BANK_TRANSFER" \ -d transaction[date]=1517501412
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.
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__8/void \ -X POST \ -u {site_api_key}:
Lists all the Credit Notes.
curl https://{site}.chargebee.com/api/v2/credit_notes \ -G \ -u {site_api_key}:\ --data-urlencode limit=3 \ --data-urlencode type[is]="refundable" \ --data-urlencode sort_by[asc]=date
status
, see message
. Possible values are : scheduled, skipped, in_progress, success, failed, registered 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.
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__2/delete \ -X POST \ -u {site_api_key}:
linked_tax_withheld_refunds
record from the credit_note
.curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__1/remove_tax_withheld_refund \ -u {site_api_key}:\ -d tax_withheld[id]="tax_wh___test__8astRSmw2zLr24"
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__1/resend_einvoice \ -X POST \ -u {site_api_key}:
This endpoint is used to send an e-invoice for invoice.
To support cases like TDS and invoice edits, we need to stop auto e-invoice sending and be able to send e-invoices manually.
This endpoint schedules e-invoices manually. This operation is not allowed when any of the following condition matches:
If e-invoicing is not enabled at the site and customer level.
If there is an e-invoice generated already for the invoice.
If the “Use automatic e-invoicing “ option is selected.
If there are no generated e-invoices with the failed
or skipped
status.
If the invoice status is voided
or pending
.
curl https://{site}.chargebee.com/api/v2/credit_notes/__demo_cn__1/send_einvoice \ -X POST \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/credit_notes/import_credit_note \ -u {site_api_key}:\ -d id="old_cn_001" \ -d customer_id="__test__XpbBxQiS4HD1nWYL" \ -d subscription_id="__test__XpbBxQiS4HD1nWYL" \ -d date=1517429430 \ -d total=4900 \ -d status="REFUND_DUE" \ -d line_items[date_from][1]=1517429430 \ -d line_items[date_to][1]=1519848630 \ -d line_items[description][1]="Support Charge" \ -d line_items[unit_amount][1]=4900 \ -d line_items[quantity][1]=1 \ -d line_items[entity_type][1]="PLAN" \ -d line_items[entity_id][1]="plan1"
round_off_amount
. If there is no round-off amount
, it will display 0
. billing_address
country
as XI
(which is United Kingdom - Northern Ireland).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.