Export resource represents an export job and contains the status of the job and the download URL, if the job is successfully completed.
Export operations are asynchronous and will return “Export” resource in response . The export resource will contain the status of the export job (like in-process, completed…) . If the status is completed, it will contain the download url pointing to the zip/pdf containing the exported data.
Note: At any given point, only 5 export jobs can be processed. Beyond that, an error stating that the API request limit has been reached will be returned.
{
"created_at": 1527791400,
"id": "__test__KyVnHhSBWTF7H8v",
"mime_type": "zip",
"object": "export",
"operation_type": "Deferred Revenue Report",
"status": "failed"
}
This API gets the status of the export job initiated by the Exports API. If the export job is completed, the downloads resource will also be obtained in the API response. The returned URL in the downloads resource is secure and can be downloaded. The URL expires after 4 hours. Please note that this is a public URL, and can be downloaded by anyone with whom it’s shared.
Note: In case the export is in Failed or In-process state, then the downloads resource will not be available.
curl https://{site}.chargebee.com/api/v2/exports/__test__KyVnHhSBWTF7H8v \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/__test__KyVnHhSBWTF7H8v \ -u {site_api_key}:
Important:
This report is deprecated. Therefore, the endpoint is also deprecated.
This API triggers export for the revenue recognition report.
Note: This API call is asynchronous. You need to check if this operation has completed by checking if the export status is completed. You can do this by retrieving the export in a loop with a minimum delay of 10 secs between two retrieve requests. In case you are using any of the client libraries, use the wait for export completion function provided as an instance method in the library.
curl https://{site}.chargebee.com/api/v2/exports/revenue_recognition \ -u {site_api_key}:\ -d report_by="INVOICE" \ -d report_from_month=6 \ -d report_from_year=2020 \ -d report_to_month=7 \ -d report_to_year=2020
curl https://{site}.chargebee.com/api/v2/exports/revenue_recognition \ -u {site_api_key}:\ -d report_by="INVOICE" \ -d report_from_month=6 \ -d report_from_year=2020 \ -d report_to_month=7 \ -d report_to_year=2020
linked_payments[].txn_amount
for all linked_payments[]
that have txn_status
as success
. total
- amount_paid
- sum of applied_credits.applied_amount
- sum of adjustment_credit_notes.cn_total
- sum of linked_taxes_withheld.amount
. 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. status
last changed to
active
. For example, this value is updated when an in_trial
or
cancelled
subscription activates. current_term_end
unless multiple subscription terms were invoiced in advance using the terms_to_charge
parameter. 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. false
to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Possible values are : true, false 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. Important:
This report is deprecated. Therefore, the endpoint is also deprecated.
This API triggers export for the Deferred Revenue Report.
Note: This API call is asynchronous. You need to check if this operation has completed by checking if the export status is completed. You can do this by retrieving the export in a loop with a minimum delay of 10 secs between two retrieve requests. In case you are using any of the client libraries, use the wait for export completion function provided as an instance method in the library.
curl https://{site}.chargebee.com/api/v2/exports/deferred_revenue \ -u {site_api_key}:\ -d report_by="INVOICE" \ -d report_from_month=6 \ -d report_from_year=2020 \ -d report_to_month=7 \ -d report_to_year=2020
curl https://{site}.chargebee.com/api/v2/exports/deferred_revenue \ -u {site_api_key}:\ -d report_by="INVOICE" \ -d report_from_month=6 \ -d report_from_year=2020 \ -d report_to_month=7 \ -d report_to_year=2020
linked_payments[].txn_amount
for all linked_payments[]
that have txn_status
as success
. total
- amount_paid
- sum of applied_credits.applied_amount
- sum of adjustment_credit_notes.cn_total
- sum of linked_taxes_withheld.amount
. 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. status
last changed to
active
. For example, this value is updated when an in_trial
or
cancelled
subscription activates. current_term_end
unless multiple subscription terms were invoiced in advance using the terms_to_charge
parameter. 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. false
to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Possible values are : true, false 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. This API triggers export of coupon data. The exported zip file contains CSV files with coupon-related data.
curl https://{site}.chargebee.com/api/v2/exports/coupons \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/coupons \ -u {site_api_key}:
Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
Note:
When the coupon ID contains a special character; for example: #
, the API returns an error.
Make sure that you encode the coupon ID in the path parameter before making an API call.
The display name used in web interface for identifying the coupon.
Note:
When the name of the coupon set contains a special character; for example: #
, the API returns an error.
Make sure that you encode the name of the coupon set in the path parameter before making an API call.
This API triggers export of customer data. The exported zip file contains CSV files with customer-related data.
curl https://{site}.chargebee.com/api/v2/exports/customers \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/customers \ -u {site_api_key}:
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. This API triggers export of subscription data. The exported zip file contains CSV files with subscription-related data.
curl https://{site}.chargebee.com/api/v2/exports/subscriptions \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/subscriptions \ -u {site_api_key}:
status
last changed to
active
. For example, this value is updated when an in_trial
or
cancelled
subscription activates. current_term_end
unless multiple subscription terms were invoiced in advance using the terms_to_charge
parameter. 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. false
to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Possible values are : true, false This API triggers export of invoice data. The exported zip file contains CSV files with invoice-related data.
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:
Scenario | Filter Example | Description |
---|---|---|
Export invoices updated after January 1, 2024 | invoice[updated_at][after] = "1704067200" | Export invoices from January 1, 2024 onwards. |
Export invoices for 2023 | invoice[updated_at][between] = "[1672531200,1704067199]" | Export all invoices for the year 2023. |
Export invoices for 2022 | invoice[updated_at][between] = "[1640995200,1672531199]" | Export all invoices for the year 2022. |
If the export still fails, further reduce the date range, for example:
Scenario | Filter Example | Description |
---|---|---|
Export for the second half of 2024 | invoice[updated_at][after] = "1717200000" | Export invoices are updated after June 1, 2024. |
Export for the first half of 2024 | invoice[updated_at][between] = "[1704067200,1717199999]" | Export invoices updated between January 1, 2024, and May 31, 2024. |
Export for the second half of 2023 | invoice[updated_at][between] = "[1685577600,1704067199]" | Export invoices updated between June 1, 2023, and December 31, 2023. |
Export for the first half of 2023 | invoice[updated_at][between] = "[1672531200,1685577599]" | Export invoices updated between January 1, 2023, and May 31, 2023. |
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.
curl https://{site}.chargebee.com/api/v2/exports/invoices \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/invoices \ -u {site_api_key}:
linked_payments[].txn_amount
for all linked_payments[]
that have txn_status
as success
. total
- amount_paid
- sum of applied_credits.applied_amount
- sum of adjustment_credit_notes.cn_total
- sum of linked_taxes_withheld.amount
. 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 about the best practice before performing full export.
This API triggers export of credit note data. The exported zip file contains CSV files with credit note-related data.
curl https://{site}.chargebee.com/api/v2/exports/credit_notes \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/credit_notes \ -u {site_api_key}:
This API triggers export of transaction data. The exported zip file contains CSV files with transaction-related data.
curl https://{site}.chargebee.com/api/v2/exports/transactions \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/transactions \ -u {site_api_key}:
payment_method
= check
. 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. This API triggers export of order data. The exported zip file contains CSV files with order-related data.
curl https://{site}.chargebee.com/api/v2/exports/orders \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/orders \ -u {site_api_key}:
This API triggers export of item family data. The exported zip file contains CSV files with item family-related data.
curl https://{site}.chargebee.com/api/v2/exports/item_families \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/item_families \ -u {site_api_key}:
item_family
. Learn more about all the scenarios before using this filter.
Default value is true
. To exclude site-level resources in specific cases, set this parameter to false
.
This API triggers export of item data. The exported zip file contains CSV files with item-related data.
curl https://{site}.chargebee.com/api/v2/exports/items \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/items \ -u {site_api_key}:
item
. Learn more about all the scenarios before using this filter.
Default value is true
. To exclude site-level resources in specific cases, set this parameter to false
.
true
, the quantity is calculated from usage records. When false
, the quantity
is as determined while adding an item price to the subscription. Applicable only for items of type
plan
or addon
and when Metered Billing is enabled. The value of this attribute cannot be changed. Possible values are : true, false metered
. This value overrides the one set at the site level. Possible values are : sum_of_usages, last_usage, max_usage This API triggers export of item price data. The exported zip file contains CSV files with item price-related data.
curl https://{site}.chargebee.com/api/v2/exports/item_prices \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/item_prices \ -u {site_api_key}:
item_family_id
.item_type
. Possible values are : plan, addon, charge.currency_code
.item_price
. Learn more about all the scenarios before using this filter.
Default value is true
. To exclude site-level resources in specific cases, set this parameter to false
.
price_variant_id
. This API triggers export of attached item data. The exported zip file contains CSV files with attached item-related data.
curl https://{site}.chargebee.com/api/v2/exports/attached_items \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/attached_items \ -u {site_api_key}:
addon
, charge
. Possible values are : plan, addon, charge.type
of attached item. Possible values are : recommended
, mandatory
, optional
. Possible values are : recommended, mandatory, optional This API triggers export of differential price data. The exported zip file contains CSV files with differential price-related data.
curl https://{site}.chargebee.com/api/v2/exports/differential_prices \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/differential_prices \ -u {site_api_key}:
addon
or charge
) whose price should change according to the plan-item it is applied to. This API triggers export of price variant data. The exported zip file contains CSV files with price variant-related data.
curl https://{site}.chargebee.com/api/v2/exports/price_variants \ -u {site_api_key}:
curl https://{site}.chargebee.com/api/v2/exports/price_variants \ -u {site_api_key}:
price_variant
. Learn more about all the scenarios before using this filter.
Default value is true
. To exclude site-level resources in specific cases, set this parameter to false
.