POST /exports/invoices

This API triggers export of invoice data. The exported zip file contains CSV files with invoice-related data.

Invoice Export Best Practice {#invoice_export_best_practice}

For a full export, Chargebee recommends exporting data in batches by using date filters. The table below provides examples of how to set the filters:

ScenarioFilter ExampleDescription
Export invoices updated after January 1, 2024invoice[updated_at][after] = "1704067200"Export invoices from January 1, 2024 onwards.
Export invoices for 2023invoice[updated_at][between] = "[1672531200,1704067199]"Export all invoices for the year 2023.
Export invoices for 2022invoice[updated_at][between] = "[1640995200,1672531199]"Export all invoices for the year 2022.

If the export still fails, further reduce the date range, for example:

ScenarioFilter ExampleDescription
Export for the second half of 2024invoice[updated_at][after] = "1717200000"Export invoices are updated after June 1, 2024.
Export for the first half of 2024invoice[updated_at][between] = "[1704067200,1717199999]"Export invoices updated between January 1, 2024, and May 31, 2024.
Export for the second half of 2023invoice[updated_at][between] = "[1685577600,1704067199]"Export invoices updated between June 1, 2023, and December 31, 2023.
Export for the first half of 2023invoice[updated_at][between] = "[1672531200,1685577599]"Export invoices updated between January 1, 2023, and May 31, 2023.

Note

The date ranges in the examples above are just suggestions; you can adjust the date window to fit your specific needs. If an export fails due to large data volume, reduce the date window further and retry the export.

Servers

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
invoice Object No

Parameters for invoice

invoice.credits_applied Object No

Total credits applied against this invoice.

invoice.credits_applied.gt String No
invoice.credits_applied.lte String No
invoice.credits_applied.between String No
invoice.credits_applied.gte String No
invoice.credits_applied.is_not String No
invoice.credits_applied.lt String No
invoice.credits_applied.is String No
invoice.amount_adjusted Object No

Total adjustments made against this invoice.

invoice.amount_adjusted.gt String No
invoice.amount_adjusted.lte String No
invoice.amount_adjusted.between String No
invoice.amount_adjusted.gte String No
invoice.amount_adjusted.is_not String No
invoice.amount_adjusted.lt String No
invoice.amount_adjusted.is String No
invoice.recurring Object No

Boolean indicating whether this invoice belongs to a subscription

invoice.recurring.is String No

Possible values:

  • "false"
  • "true"
invoice.dunning_status Object No

Current dunning status of the invoice.

invoice.dunning_status.not_in String No
invoice.dunning_status.in String No
invoice.dunning_status.is_not String No

* `in_progress` - Dunning is still in progress. * `exhausted` - Maximum number of attempts have been made. * `stopped` - Dunning has stopped for this invoice. * `success` - Payment successfully collected during dunning process.

Possible values:

  • "in_progress"
  • "success"
  • "exhausted"
  • "stopped"
invoice.dunning_status.is String No

* `in_progress` - Dunning is still in progress. * `exhausted` - Maximum number of attempts have been made. * `stopped` - Dunning has stopped for this invoice. * `success` - Payment successfully collected during dunning process.

Possible values:

  • "in_progress"
  • "success"
  • "exhausted"
  • "stopped"
invoice.dunning_status.is_present String No

Possible values:

  • "false"
  • "true"
invoice.status Object No

Current status of this invoice.

invoice.status.not_in String No
invoice.status.in String No
invoice.status.is_not String No

* `paid` - Indicates a paid invoice. * `posted` - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period * `payment_due` - Indicates the payment is not yet collected and is being retried as per retry settings. * `not_paid` - Indicates the payment is not made and all attempts to collect is failed. * `voided` - Indicates a voided invoice. * `pending` -
The invoice is yet to be closed (sent for payment collection). An invoice is generated with this status when it has line items that belong to items that are metered or when the subscription.create_pending_invoicesattribute is set to true.
The invoice is yet to be closed (sent for payment collection). All invoices are generated with this status when Metered Billing is enabled for the site.

Possible values:

  • "posted"
  • "paid"
  • "payment_due"
  • "not_paid"
  • "voided"
  • "pending"
invoice.status.is String No

* `paid` - Indicates a paid invoice. * `posted` - Indicates the payment is not yet collected and will be in this state till the due date to indicate the due period * `payment_due` - Indicates the payment is not yet collected and is being retried as per retry settings. * `not_paid` - Indicates the payment is not made and all attempts to collect is failed. * `voided` - Indicates a voided invoice. * `pending` -
The invoice is yet to be closed (sent for payment collection). An invoice is generated with this status when it has line items that belong to items that are metered or when the subscription.create_pending_invoicesattribute is set to true.
The invoice is yet to be closed (sent for payment collection). All invoices are generated with this status when Metered Billing is enabled for the site.

Possible values:

  • "posted"
  • "paid"
  • "payment_due"
  • "not_paid"
  • "voided"
  • "pending"
invoice.price_type Object No

The price type of the invoice.

invoice.price_type.not_in String No
invoice.price_type.in String No
invoice.price_type.is_not String No

* `tax_exclusive` - All amounts in the document are exclusive of tax. * `tax_inclusive` - All amounts in the document are inclusive of tax.

Possible values:

  • "tax_exclusive"
  • "tax_inclusive"
invoice.price_type.is String No

* `tax_exclusive` - All amounts in the document are exclusive of tax. * `tax_inclusive` - All amounts in the document are inclusive of tax.

Possible values:

  • "tax_exclusive"
  • "tax_inclusive"
invoice.date Object No

The document date displayed on the invoice PDF.

invoice.date.on String No
invoice.date.after String No
invoice.date.between String No
invoice.date.before String No
invoice.paid_at Object No

Timestamp indicating the date \& time this invoice got paid.

invoice.paid_at.on String No
invoice.paid_at.after String No
invoice.paid_at.between String No
invoice.paid_at.before String No
invoice.total Object No

Invoiced amount displayed in cents; that is, a decimal point is not present between the whole number and the decimal part. For example, $499.99 is displayed as 49999, and so on.

invoice.total.gt String No
invoice.total.lte String No
invoice.total.between String No
invoice.total.gte String No
invoice.total.is_not String No
invoice.total.lt String No
invoice.total.is String No
invoice.updated_at Object No

To filter based on `updated_at`. This attribute will be present only if the resource has been updated after 2016-09-28. It is advisable when using this filter, to pass the `sort_by` input parameter as `updated_at` for a faster response. [Learn more](exports#invoice_export_best_practice) about the best practice before performing full export.

invoice.updated_at.on String No
invoice.updated_at.after String No
invoice.updated_at.between String No
invoice.updated_at.before String No
invoice.id Object No

The invoice number. Acts as a identifier for invoice and typically generated sequentially.

invoice.id.not_in String No
invoice.id.starts_with String No
invoice.id.in String No
invoice.id.is_not String No
invoice.id.is String No
invoice.customer_id Object No

The identifier of the customer this invoice belongs to.

invoice.customer_id.not_in String No
invoice.customer_id.starts_with String No
invoice.customer_id.in String No
invoice.customer_id.is_not String No
invoice.customer_id.is String No
invoice.channel Object No

The subscription channel this object originated from and is maintained in.

invoice.channel.not_in String No
invoice.channel.in String No
invoice.channel.is_not String No

* `web` - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. * `app_store` - The object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed. * `play_store` - The object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.

In-App Subscriptions is currently in early access. Contact eap@chargebee.com for more information.

Possible values:

  • "web"
  • "play_store"
  • "app_store"
invoice.channel.is String No

* `web` - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI. * `app_store` - The object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed. * `play_store` - The object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.

In-App Subscriptions is currently in early access. Contact eap@chargebee.com for more information.

Possible values:

  • "web"
  • "play_store"
  • "app_store"
invoice.amount_due Object No

The unpaid amount that is due on the invoice. This is calculated as: [total](invoices#invoice_total) - [amount_paid](invoices#invoice_amount_paid) - sum of [applied_credits](invoices#invoice_applied_credits)`.applied_amount` - sum of [adjustment_credit_notes](invoices#invoice_adjustment_credit_notes)`.cn_total` - sum of [linked_taxes_withheld](invoices#invoice_linked_taxes_withheld)`.amount`.

invoice.amount_due.gt String No
invoice.amount_due.lte String No
invoice.amount_due.between String No
invoice.amount_due.gte String No
invoice.amount_due.is_not String No
invoice.amount_due.lt String No
invoice.amount_due.is String No
invoice.amount_paid Object No

Payments collected successfully for the invoice. This is the sum of [linked_payments[]](invoices#invoice_linked_payments)`.txn_amount` for all `linked_payments[]` that have `txn_status` as `success`.

invoice.amount_paid.gt String No
invoice.amount_paid.lte String No
invoice.amount_paid.between String No
invoice.amount_paid.gte String No
invoice.amount_paid.is_not String No
invoice.amount_paid.lt String No
invoice.amount_paid.is String No
invoice.subscription_id Object No

To filter based on subscription_id. NOTE: Not to be used if *consolidated invoicing* is enabled.

invoice.subscription_id.not_in String No
invoice.subscription_id.starts_with String No
invoice.subscription_id.in String No
invoice.subscription_id.is_not String No
invoice.subscription_id.is String No
invoice.subscription_id.is_present String No

Possible values:

  • "false"
  • "true"
payment_owner Object No

optional, string filter Payment owner of an invoice. **Supported operators :** is, is_not, starts_with, in, not_in **Example →** *payment_owner\[is\] = "payment_customer"*

payment_owner.not_in String No
payment_owner.starts_with String No
payment_owner.in String No
payment_owner.is_not String No
payment_owner.is String No

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.