ChargebeeAPI

Remove credit note from an invoice

Idempotency Supported
Try in API Explorer

Removes the specified adjustment credit or refundable credit allocation applied to the invoice.

Prerequisites & Constraints

  • The invoice status must not be voided or pending.
  • The credit note status must not be voided.
  • The credit note type must be adjustment or refundable.
  • 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_due increases by the allocations[i].allocated_amount of the credit note.
  • The amount_adjusted decreases by the allocations[i].allocated_amount of the credit note if the credit_note.type is adjustment.
  • The write_off_amount decreases by the allocations[i].allocated_amount of the credit note if the credit_note.create_reason_code is Write Off.
  • If the invoice status was payment_due, not_paid, or posted, the status does not change after the credit note is removed.
  • If the invoice status was paid:
    • The status changes to posted if the due_date is in the future.
    • The status changes to not_paid if the due date is in the past.

Credit note

  • The amount_allocated decreases and the amount_available increases by the allocations[i].allocated_amount, where i is such that allocations[i].invoice_id = invoice.id.

Implementation Notes

Before you call this API, make sure that:

  • The invoice status is not voided or pending.
  • The credit note status is not voided.
  • The credit note type is adjustment or refundable.
  • 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_amount where credit_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

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/invoices/{invoice-id}/remove_credit_note

Input Parameters

credit_note
optional, string

Parameters for credit_note

Returns

invoiceInvoice object

Resource object representing invoice

credit_noteCredit note object

Resource object representing credit_note