Voids all outstanding scheduled-capture authorizations linked to an invoice before capture, then voids or writes off the invoice.
Use this operation when an invoice has an outstanding delayed-capture authorization that must be released before the invoice is either voided or written off. Use invoice_action to choose whether the invoice is voided or written off.
Prerequisites & Constraints
- The invoice must have at least one outstanding scheduled-capture authorization with a capturable amount greater than zero.
- The invoice
statusmust bepayment_due,posted, ornot_paid. - The invoice must not have successful payments, taxes withheld, applied credit notes, adjustment amounts, refundable credits, or refunds in progress.
- The outstanding authorization must not already have a successful or in-progress capture.
- This operation is not supported for 2Checkout.
Impacts
Authorizations
- Chargebee voids all eligible outstanding scheduled-capture authorizations linked to the invoice at the payment gateway.
Invoice
- When
invoice_actionisvoid, Chargebee voids the invoice. The invoicestatusbecomesvoided. - When
invoice_actioniswrite_off, Chargebee writes off the invoice. The invoicestatusbecomespaid, andwrite_off_amountis set to the invoiceamount_due.
Credit Note
- When
invoice_actioniswrite_off, Chargebee creates an adjustment credit note for the write-off. The response includes thecredit_noteresource when one is generated.
Implementation Notes
Before calling this API, ensure that the scheduled-capture authorization is still outstanding. If it has already been captured, if no eligible authorization remains, or if another conflicting payment operation is in progress, the API returns HTTP 409 with api_error_code set to invalid_state_for_request.
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
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 .
Reason code for voiding the invoice. Applicable only when invoice_action is void. Select from the reason codes configured in Settings > Configure Chargebee > Reason Codes > Invoices > Void invoice. This parameter is required when a void reason code is configured as mandatory. The codes are case-sensitive.
Determines whether Chargebee voids or writes off the invoice after voiding all eligible outstanding scheduled-capture authorizations. Possible values are void and write_off. This is not related to Close a pending invoice.
Default value
void
Voids the invoice after all eligible outstanding scheduled-capture authorizations are voided.
Writes off the invoice after all eligible outstanding scheduled-capture authorizations are voided. void_reason_code is not applicable for this value.
Returns
The updated invoice.
The adjustment credit note generated when the invoice is written off. This resource is returned only when a credit note is generated.