Exports is an asynchronous API. Once the POST request to start an export is made, the export ID is fetched as response. This export ID can be used to poll the retrieve export api until the export is completed, and download url is fetched. 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 shown.

Sample export [ JSON ]

{ "operation_type": "Revenue Recognition Report", "mime_type": "zip", "status": "in_process", "created_at": 1528093652, "id": "5SK0b8q3QtyvEj0C", "object": "export" }

API Index URL GET

https://{site}.chargebee.com/api/v2/exports
operation_type
Describes the type of export.
string, max chars=100
mime_type
Describes the mime type of download file.
enumerated string, default=zip
Possible values are
pdfPDF.zipZIP.
status
Current status of the export operation.
enumerated string, default=in_process
Possible values are
in_processIn Process.completedCompleted.failedFailed.
created_at
Export created time.
timestamp(UTC) in seconds
id
The identifier of the exports.
optional, string, max chars=50
Downloads resource of the export.
optional, download
Download attributes
download_url
download url for the requested content.
string, max chars=1250
valid_till
The vailidity of the download url returned.
timestamp(UTC) in seconds
Retrieve export for a specific id.
Sample Request
curl  https://{site}.chargebee.com/api/v2/exports/5SK0b8q3QtyvEj0C \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/exports/5SK0b8q3QtyvEj0C \
     -u {site_api_key}:

Sample Response [ JSON ]

{"export": { "created_at": 1525076855, "id": "5SK0b4FKQqgl42AA", "mime_type": "zip", "object": "export", "operation_type": "Deferred Revenue Report", "status": "in_process" }}

URL Format GET

https://{site}.chargebee.com/api/v2/exports/{export_id}
Resource object representing export.
always returned

This API triggers export for the revenue recognition report. Values for parameters report_from_month and report_to_month must be between 1 and 12, where 1 is January and 12 is December. If no currency_code input is given, then consolidated report based on base currency will be obtained.

Sample Request
curl  https://{site}.chargebee.com/api/v2/exports/revenue_recognition \
     -u {site_api_key}: \
     -d report_by="invoice" \
     -d report_from_year="2018" \
     -d report_to_year="2018" \
     -d report_to_month="4" \
     -d report_from_month="1" \
     -d invoice[status][is]="paid" \
     -d invoice[total][is]="1000" \
     -d subscription[plan_id][is_not]="basic" \
     -d subscription[status][is_not]="active" \
     -d customer[first_name][is]="John" \
     -d customer[last_name][is]="Doe" \
     -d customer[email][is]="john@test.com"
copy
curl  https://{site}.chargebee.com/api/v2/exports/revenue_recognition \
     -u {site_api_key}: \
     -d report_by="invoice" \
     -d report_from_year="2018" \
     -d report_to_year="2018" \
     -d report_to_month="4" \
     -d report_from_month="1" \
     -d invoice[status][is]="paid" \
     -d invoice[total][gt]="1000" \
     -d subscription[plan_id][is]="basic" \
     -d subscription[status][is]="active" \
     -d customer[first_name][is_not]="John" \
     -d customer[last_name][is]="Doe" \
     -d customer[email][is]="john@test.com"

Sample Response [ JSON ]

{"export": { "created_at": 1525076855, "id": "5SK0b4FKQqgl42AA", "mime_type": "zip", "object": "export", "operation_type": "Deferred Revenue Report", "status": "in_process" }}

URL Format POST

https://{site}.chargebee.com/api/v2/exports/revenue_recognition
report_by
Obtain reports based on the format.
required, enumerated string
Possible values are
customerCustomer.invoiceInvoice.productProduct.subscriptionSubscription.
currency_code
The currency code (ISO 4217 format) of the export.
default=null, string, max chars=3
report_from_year
Obtains report data from the specified year, combined with the value specified for report_from_month.
required, integer
report_to_year
Obtains report data until the specified date combined with report_to_month.
required, integer
report_to_month
Obtains report data from the specified month, combined with the value specified for report_to_year.
required, integer
report_from_month
Obtains report data from the specified month, combined with the value specified for report_from_year.
required, integer
include_discounts
Apply discounts in the report.
optional, boolean, default=true
invoice
Parameters for invoice
pass parameters as invoice[<param name>][<operator>]
invoice[id][operator]
To filter based on Invoice Id.
Supported operators : is, is_not, starts_with, in, not_in

Example invoice[id][is] = "INVOICE_654"
optional, string filter
invoice[recurring][operator]
To filter based on Invoice Recurring. Possible values are : true, false
Supported operators : is

Example invoice[recurring][is] = "true"
optional, boolean filter
invoice[status][operator]
To filter based on Invoice Status. Possible values are : paid, posted, payment_due, not_paid, voided, pending.
Supported operators : is, is_not, in, not_in

Example invoice[status][is_not] = "paid"
optional, enumerated string filter
invoice[price_type][operator]
To filter based on Invoice Price Type. Possible values are : tax_exclusive, tax_inclusive.
Supported operators : is, is_not, in, not_in

Example invoice[price_type][is_not] = "tax_exclusive"
optional, enumerated string filter
invoice[date][operator]
To filter based on Invoice End Date.
Supported operators : after, before, on, between

Example invoice[date][after] = "1394532759"
optional, timestamp(UTC) in seconds filter
invoice[paid_at][operator]
To filter based on Invoice Paid On.
Supported operators : after, before, on, between

Example invoice[paid_at][before] = "1394532759"
optional, timestamp(UTC) in seconds filter
invoice[total][operator]
To filter based on Invoice Amount.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[total][is] = "1000"
optional, in cents filter
invoice[amount_paid][operator]
To filter based on Invoice Amount Paid.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_paid][gt] = "800"
optional, in cents filter
invoice[amount_adjusted][operator]
To filter based on Invoice Amount Adjusted.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_adjusted][is] = "100"
optional, in cents filter
invoice[credits_applied][operator]
To filter based on Invoice Amount Credited.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[credits_applied][lt] = "100"
optional, in cents filter
invoice[amount_due][operator]
To filter based on Invoice Amount Due.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_due][lt] = "200"
optional, in cents filter
invoice[dunning_status][operator]
To filter based on Invoice Dunning Status. Possible values are : in_progress, exhausted, stopped, success.
Supported operators : is, is_not, in, not_in, is_present

Example invoice[dunning_status][is_not] = "in_progress"
optional, enumerated string filter
invoice[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example invoice[updated_at][before] = "1243545465"
optional, timestamp(UTC) in seconds filter
subscription
Parameters for subscription
pass parameters as subscription[<param name>][<operator>]
subscription[id][operator]
To filter based on Subscription Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[id][is] = "8gsnbYfsMLds"
optional, string filter
subscription[customer_id][operator]
To filter based on Subscription Customer Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[customer_id][is] = "8gsnbYfsMLds"
optional, string filter
subscription[plan_id][operator]
To filter based on Subscription Plan Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[plan_id][is] = "basic"
optional, string filter
subscription[status][operator]
To filter based on Subscription State. Possible values are : future, in_trial, active, non_renewing, paused, cancelled.
Supported operators : is, is_not, in, not_in

Example subscription[status][is_not] = "active"
optional, enumerated string filter
subscription[cancel_reason][operator]
To filter based on Subscription Cancel Reason. Possible values are : not_paid, no_card, fraud_review_failed, non_compliant_eu_customer, tax_calculation_failed, currency_incompatible_with_gateway, non_compliant_customer.
Supported operators : is, is_not, in, not_in, is_present

Example subscription[cancel_reason][is_not] = "not_paid"
optional, enumerated string filter
subscription[remaining_billing_cycles][operator]
To filter based on Subscription Remaining Billing Cycles.
Supported operators : is, is_not, lt, lte, gt, gte, between, is_present

Example subscription[remaining_billing_cycles][gte] = "3"
optional, integer filter
subscription[created_at][operator]
To filter based on Subscription Created At.
Supported operators : after, before, on, between

Example subscription[created_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[activated_at][operator]
To filter based on Subscription Activated At.
Supported operators : after, before, on, between, is_present

Example subscription[activated_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[next_billing_at][operator]
To filter based on Subscription Next Billing At.
Supported operators : after, before, on, between

Example subscription[next_billing_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[cancelled_at][operator]
To filter based on Subscription Cancelled At.
Supported operators : after, before, on, between

Example subscription[cancelled_at][on] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[has_scheduled_changes][operator]
To filter based on Subscription Has Scheduled Changes. Possible values are : true, false
Supported operators : is

Example subscription[has_scheduled_changes][is] = "true"
optional, boolean filter
subscription[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example subscription[updated_at][before] = "1243545465"
optional, timestamp(UTC) in seconds filter
customer
Parameters for customer
pass parameters as customer[<param name>][<operator>]
customer[id][operator]
To filter based on Customer Id.
Supported operators : is, is_not, starts_with, in, not_in

Example customer[id][is] = "9bsvnHgsvmsI"
optional, string filter
customer[first_name][operator]
To filter based on Customer First Name.
Supported operators : is, is_not, starts_with, is_present

Example customer[first_name][is] = "John"
optional, string filter
customer[last_name][operator]
To filter based on Customer Last Name.
Supported operators : is, is_not, starts_with, is_present

Example customer[last_name][is] = "Clint"
optional, string filter
customer[email][operator]
To filter based on Customer Email.
Supported operators : is, is_not, starts_with, is_present

Example customer[email][is] = "john@test.com"
optional, string filter
customer[company][operator]
To filter based on Customer Company.
Supported operators : is, is_not, starts_with, is_present

Example customer[company][is] = "Globex Corp"
optional, string filter
customer[phone][operator]
To filter based on Customer Phone.
Supported operators : is, is_not, starts_with, is_present

Example customer[phone][is] = "(541) 754-3010"
optional, string filter
customer[auto_collection][operator]
To filter based on Customer Auto Collection. Possible values are : on, off.
Supported operators : is, is_not, in, not_in

Example customer[auto_collection][is] = "on"
optional, enumerated string filter
customer[taxability][operator]
To filter based on Customer Taxability. Possible values are : taxable, exempt.
Supported operators : is, is_not, in, not_in

Example customer[taxability][is] = "taxable"
optional, enumerated string filter
customer[created_at][operator]
To filter based on Customer Created At.
Supported operators : after, before, on, between

Example customer[created_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
customer[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example customer[updated_at][before] = "1243545465"
optional, timestamp(UTC) in seconds filter
Resource object representing export.
always returned

This API triggers export for the Deferred Revenue Report. Values for parameters report_from_month and report_to_month must be between 1 and 12, where 1 is January and 12 is December. If no currency_code input is given, then consolidated report based on base currency will be obtained.

Sample Request
curl  https://{site}.chargebee.com/api/v2/exports/deferred_revenue \
     -u {site_api_key}: \
     -d report_by="invoice" \
     -d report_from_year="2018" \
     -d report_to_year="2018" \
     -d report_to_month="4" \
     -d report_from_month="1" \
     -d invoice[status][is]="paid" \
     -d invoice[total][gt]="1000" \
     -d subscription[plan_id][is]="basic" \
     -d subscription[status][is_not]="active" \
     -d customer[first_name][is]="John" \
     -d customer[last_name][is]="Doe" \
     -d customer[email][is_not]="john@test.com"
copy
curl  https://{site}.chargebee.com/api/v2/exports/deferred_revenue \
     -u {site_api_key}: \
     -d report_by="invoice" \
     -d report_from_year="2018" \
     -d report_to_year="2018" \
     -d report_to_month="4" \
     -d report_from_month="1" \
     -d invoice[status][is]="paid" \
     -d invoice[total][lte]="1000" \
     -d subscription[plan_id][is]="basic" \
     -d subscription[status][is]="active" \
     -d customer[first_name][is_not]="John" \
     -d customer[last_name][is]="Doe" \
     -d customer[email][is]="john@test.com"

Sample Response [ JSON ]

{"export": { "created_at": 1525076855, "id": "5SK0b4FKQqgl42AA", "mime_type": "zip", "object": "export", "operation_type": "Deferred Revenue Report", "status": "in_process" }}

URL Format POST

https://{site}.chargebee.com/api/v2/exports/deferred_revenue
report_by
Obtain reports based on the format.
required, enumerated string
Possible values are
customerCustomer.invoiceInvoice.productProduct.subscriptionSubscription.
currency_code
The currency code (ISO 4217 format) of the export.
default=null, string, max chars=3
report_from_year
Obtains report data from the specified year, combined with the value specified for report_from_month.
required, integer
report_to_year
Obtains report data until the specified date combined with report_to_month.
required, integer
report_to_month
Obtains report data from the specified month, combined with the value specified for report_to_year.
required, integer
report_from_month
Obtains report data from the specified month, combined with the value specified for report_from_year.
required, integer
include_discounts
Apply discounts in the report.
optional, boolean, default=true
invoice
Parameters for invoice
pass parameters as invoice[<param name>][<operator>]
invoice[id][operator]
To filter based on Invoice Id.
Supported operators : is, is_not, starts_with, in, not_in

Example invoice[id][is] = "INVOICE_654"
optional, string filter
invoice[recurring][operator]
To filter based on Invoice Recurring. Possible values are : true, false
Supported operators : is

Example invoice[recurring][is] = "true"
optional, boolean filter
invoice[status][operator]
To filter based on Invoice Status. Possible values are : paid, posted, payment_due, not_paid, voided, pending.
Supported operators : is, is_not, in, not_in

Example invoice[status][is] = "paid"
optional, enumerated string filter
invoice[price_type][operator]
To filter based on Invoice Price Type. Possible values are : tax_exclusive, tax_inclusive.
Supported operators : is, is_not, in, not_in

Example invoice[price_type][is] = "tax_exclusive"
optional, enumerated string filter
invoice[date][operator]
To filter based on Invoice End Date.
Supported operators : after, before, on, between

Example invoice[date][before] = "1394532759"
optional, timestamp(UTC) in seconds filter
invoice[paid_at][operator]
To filter based on Invoice Paid On.
Supported operators : after, before, on, between

Example invoice[paid_at][after] = "1394532759"
optional, timestamp(UTC) in seconds filter
invoice[total][operator]
To filter based on Invoice Amount.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[total][lt] = "1000"
optional, in cents filter
invoice[amount_paid][operator]
To filter based on Invoice Amount Paid.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_paid][is] = "800"
optional, in cents filter
invoice[amount_adjusted][operator]
To filter based on Invoice Amount Adjusted.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_adjusted][gte] = "100"
optional, in cents filter
invoice[credits_applied][operator]
To filter based on Invoice Amount Credited.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[credits_applied][lte] = "100"
optional, in cents filter
invoice[amount_due][operator]
To filter based on Invoice Amount Due.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example invoice[amount_due][is_not] = "200"
optional, in cents filter
invoice[dunning_status][operator]
To filter based on Invoice Dunning Status. Possible values are : in_progress, exhausted, stopped, success.
Supported operators : is, is_not, in, not_in, is_present

Example invoice[dunning_status][is] = "in_progress"
optional, enumerated string filter
invoice[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example invoice[updated_at][before] = "1243545465"
optional, timestamp(UTC) in seconds filter
subscription
Parameters for subscription
pass parameters as subscription[<param name>][<operator>]
subscription[id][operator]
To filter based on Subscription Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[id][is_not] = "8gsnbYfsMLds"
optional, string filter
subscription[customer_id][operator]
To filter based on Subscription Customer Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[customer_id][is] = "8gsnbYfsMLds"
optional, string filter
subscription[plan_id][operator]
To filter based on Subscription Plan Id.
Supported operators : is, is_not, starts_with, in, not_in

Example subscription[plan_id][is] = "basic"
optional, string filter
subscription[status][operator]
To filter based on Subscription State. Possible values are : future, in_trial, active, non_renewing, paused, cancelled.
Supported operators : is, is_not, in, not_in

Example subscription[status][is] = "active"
optional, enumerated string filter
subscription[cancel_reason][operator]
To filter based on Subscription Cancel Reason. Possible values are : not_paid, no_card, fraud_review_failed, non_compliant_eu_customer, tax_calculation_failed, currency_incompatible_with_gateway, non_compliant_customer.
Supported operators : is, is_not, in, not_in, is_present

Example subscription[cancel_reason][is] = "not_paid"
optional, enumerated string filter
subscription[remaining_billing_cycles][operator]
To filter based on Subscription Remaining Billing Cycles.
Supported operators : is, is_not, lt, lte, gt, gte, between, is_present

Example subscription[remaining_billing_cycles][is_not] = "3"
optional, integer filter
subscription[created_at][operator]
To filter based on Subscription Created At.
Supported operators : after, before, on, between

Example subscription[created_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[activated_at][operator]
To filter based on Subscription Activated At.
Supported operators : after, before, on, between, is_present

Example subscription[activated_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[next_billing_at][operator]
To filter based on Subscription Next Billing At.
Supported operators : after, before, on, between

Example subscription[next_billing_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[cancelled_at][operator]
To filter based on Subscription Cancelled At.
Supported operators : after, before, on, between

Example subscription[cancelled_at][before] = "1435054328"
optional, timestamp(UTC) in seconds filter
subscription[has_scheduled_changes][operator]
To filter based on Subscription Has Scheduled Changes. Possible values are : true, false
Supported operators : is

Example subscription[has_scheduled_changes][is] = "true"
optional, boolean filter
subscription[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example subscription[updated_at][after] = "1243545465"
optional, timestamp(UTC) in seconds filter
customer
Parameters for customer
pass parameters as customer[<param name>][<operator>]
customer[id][operator]
To filter based on Customer Id.
Supported operators : is, is_not, starts_with, in, not_in

Example customer[id][is_not] = "9bsvnHgsvmsI"
optional, string filter
customer[first_name][operator]
To filter based on Customer First Name.
Supported operators : is, is_not, starts_with, is_present

Example customer[first_name][is] = "John"
optional, string filter
customer[last_name][operator]
To filter based on Customer Last Name.
Supported operators : is, is_not, starts_with, is_present

Example customer[last_name][is] = "Clint"
optional, string filter
customer[email][operator]
To filter based on Customer Email.
Supported operators : is, is_not, starts_with, is_present

Example customer[email][is] = "john@test.com"
optional, string filter
customer[company][operator]
To filter based on Customer Company.
Supported operators : is, is_not, starts_with, is_present

Example customer[company][is] = "Globex Corp"
optional, string filter
customer[phone][operator]
To filter based on Customer Phone.
Supported operators : is, is_not, starts_with, is_present

Example customer[phone][is] = "(541) 754-3010"
optional, string filter
customer[auto_collection][operator]
To filter based on Customer Auto Collection. Possible values are : on, off.
Supported operators : is, is_not, in, not_in

Example customer[auto_collection][is] = "on"
optional, enumerated string filter
customer[taxability][operator]
To filter based on Customer Taxability. Possible values are : taxable, exempt.
Supported operators : is, is_not, in, not_in

Example customer[taxability][is] = "taxable"
optional, enumerated string filter
customer[created_at][operator]
To filter based on Customer Created At.
Supported operators : after, before, on, between

Example customer[created_at][after] = "1435054328"
optional, timestamp(UTC) in seconds filter
customer[updated_at][operator]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example customer[updated_at][after] = "1243545465"
optional, timestamp(UTC) in seconds filter
Resource object representing export.
always returned