POST /subscriptions/{subscription-id}/regenerate_invoice

Use this API to regenerate the current-term invoice for a subscription. The new invoice will contain non-metered charges from the current term and metered charges from the previous term. If a customer was billed incorrectly, because of a wrong plan, price, or tax configuration, you can first void or delete the erroneous invoice, update the subscription or usage records, and then run this operation to issue the corrected invoice.

Prerequisites & Constraints {#PreRequisites}

Before regenerating an invoice, ensure the following conditions are met:

Impacts {#ImpactsOfTheOperation}

Current-Term Invoice
Chargebee does not modify the voided or deleted invoice for the current term. Instead, it creates a new invoice.

The new invoice includes:

The new invoice does not include:

If every charge for the current-term has a value of zero, and your site is configured to hide zero-value line items, the invoice is not generated.

If you delete the original invoice, the associated usage data is also deleted. To ensure accurate billing for metered items, add or bulk import usage records before regenerating the invoice.
Payment Collection
If auto-collection is on, Chargebee attempts to collect payment for the regenerated invoice. If the payment collection fails , the invoice regeneration also fails.

Note : Chargebee applies any customer balances, such as unapplied payment from the voided invoice, before attempting to collect the remaining amount.

Implementation Notes {#ImplNotes}

Before calling this API, perform the following checks:

Servers

Path parameters

Name Type Required Description
subscription-id String Yes

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Possible values:

  • "all-disabled"
chargebee-business-entity-id String No

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

chargebee-event-actions String No

skip all actions to be done on the events

Possible values:

  • "all-disabled"
chargebee-request-origin-user String No

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Possible values:

  • "all-disabled"

Request body fields

Name Type Required Description
prorate Boolean No

Whether the charges should be prorated according to the term specified by date_from and date_to. Should not be passed without date_from and date_to.

invoice_immediately Boolean No

Only applicable when Consolidated Invoicing is enabled for the customer. Set to false to leave the current term charge for the subscription as unbilled. Once you have done this for all suitable subscriptions of the customer, call Create an invoice for unbilled charges to invoice them.

date_from Integer No

The start date of the period being invoiced. The default value is current_term_start.

date_to Integer No

The end date of the period being invoiced. The default value is current_term_end.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.