ChargebeeAPI

Close a pending invoice

Idempotency Supported
Try in API Explorer

Invoices for a subscription are created with a pending status when the subscription has create_pending_invoices attribute set to true. This API call finalizes a pending invoice. Any refundable_credits and excess_payments for the customer are applied to the invoice, and any payment due is collected automatically if auto_collection is on for the customer.

Automation

This operation can be automated by using a site setting. Moreover, the automation can be overridden at the customer and subscription level.

Sample Request

URL Format

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

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 .

invoice_note
optional, string, max chars=2000

A note for this particular invoice. This, and all other notes for the invoice are displayed on the PDF invoice sent to the customer.

remove_general_note
optional, boolean, default=false

Set as true to remove the general note from this invoice.

invoice_date
optional, timestamp(UTC) in seconds

Set the invoice date. Must lie between the date when the invoice was generated and current date. Can only be passed when the site setting to allow overriding is enabled. If not passed, then the default value set at the site level is used.

notes_to_remove
optional, enumerated string

Parameters for notes_to_remove

Returns

invoiceInvoice object

Resource object representing invoice