Idempotency Supported
Try in API ExplorerRemoves the specified adjustment credit or refundable credit allocation applied to the invoice.
Prerequisites & Constraints
- The invoice status must not be
voidedorpending. - The credit note status must not be
voided. - The credit note type must be
adjustmentorrefundable. - Refundable credit allocation cannot be removed if the amount allocated exceeds the refundable amount on the invoice. See Implementation Notes for more details.
Impacts
Invoice
- The
amount_dueincreases by theallocations[i].allocated_amountof the credit note. - The
amount_adjusteddecreases by theallocations[i].allocated_amountof the credit note if thecredit_note.typeisadjustment. - The
write_off_amountdecreases by theallocations[i].allocated_amountof the credit note if thecredit_note.create_reason_codeisWrite Off. - If the invoice status was
payment_due,not_paid, orposted, the status does not change after the credit note is removed. - If the invoice status was
paid:- The status changes to
postedif thedue_dateis in the future. - The status changes to
not_paidif the due date is in the past.
- The status changes to
Credit note
- The
amount_allocateddecreases and theamount_availableincreases by theallocations[i].allocated_amount, whereiis such thatallocations[i].invoice_id=invoice.id.
Implementation Notes
Before you call this API, make sure that:
- The invoice status is not
voidedorpending. - The credit note status is not
voided. - The credit note type is
adjustmentorrefundable. - For refundable credit notes, the amount allocated to the invoice via the credit note must not exceed the refundable amount on the invoice. The refundable amount on the invoice is calculated as: (total amount paid) + (total refundable credits allocated to the invoice) + (total tax withheld recorded on the invoice) - (total refundable credits issued against the invoice). Each of these amounts can be obtained as follows:
- amount allocated to the invoice via the credit note:
credit_note.allocations[i].allocated_amountwherecredit_note.allocations[i].invoice_id==invoice.id. - total amount paid:
invoice.amount_paid. - total refundable credits allocated to the invoice: sum of
invoice.applied_credits[i].applied_amount - total tax withheld recorded on the invoice: sum of
invoice.linked_taxes_withheld[i].amount - total refundable credits issued against the invoice: sum of
invoice.issued_credit_notes[i].cn_total
- amount allocated to the invoice via the credit note:
Sample Request
URL Format
POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/remove_credit_note
Input Parameters
Returns
invoiceInvoice object
Resource object representing invoice
credit_noteCredit note object
Resource object representing credit_note