ChargebeeAPI

Void an invoice

Idempotency Supported
Try in API Explorer

Voids the specified invoice.

Use this operation when:

  • The invoice was generated in error.
  • The invoice amount is incorrect.
  • The customer requests a change to the invoice.
  • The customer cancels the order.

Voiding preserves the audit trail and allows for future reference and compliance without removing the original record.

Regenerate or import an invoice

Prerequisites & Constraints

  • The invoice status must be payment_due, posted, or not_paid.
  • The invoice must not have any linked_payments with txn_status set to success or in_progress.
  • The amount_adjusted on the invoice must be zero.
  • The invoice must not have any applied_credits with cn_status set to refunded or refund_due.
  • The invoice must not have any issued_credit_notes with cn_status set to refunded or refund_due.
  • The invoice must not have any linked_taxes_withheld.

Impacts

Invoices

  • Chargebee sets the invoice status to voided.

Subscription

  • If the invoice is for the current term of a subscription and you change the subscription later within the same term with proration enabled, Chargebee does not issue prorated credits.

Customer

Credit Note

  • If the Void invoices with credit note setting is enabled, Chargebee creates a credit note for the voided invoice:
    • The credit note type is adjustment.
    • The credit note status is adjusted.
    • The credit note create_reason_code is Invoice Void.

Usages

  • Chargebee delinks the usage resources associated with the invoice by clearing the invoice_id attribute.

Integrations

  • Review how voiding an invoice impacts your accounting integrations.

Implementation Notes

Before calling this API, ensure the following:

  • The invoice status is payment_due, posted, or not_paid.
  • Remove any linked_payments with txn_status set to success or in_progress.
  • Remove the following credits:
    • any applied_credits with cn_status set to refunded or refund_due
    • any issued_credit_notes with cn_status set to refunded or refund_due
    • any adjustment_credit_notes with cn_status set to adjusted
  • Remove any linked_taxes_withheld.

Sample Request

URL Format

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

Input Parameters

comment
optional, string, max chars=300

An internal comment to be added for this operation, to the invoice. This comment is displayed on the Chargebee UI. It is not displayed on any customer-facing Hosted Page or any document such as the Invoice PDF .

void_reason_code
optional, string, max chars=100

Reason code for voiding the invoice. Select from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Invoices > Void invoice. Must be passed if set as mandatory in the app. The codes are case-sensitive.

Returns

invoiceInvoice object

Resource object representing invoice

credit_noteCredit note object

Resource object representing credit_note