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}:
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. 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. Use the method waitForExportCompletion() on the returned Export resource which will wait until the export status changes. 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. Use the method waitForExportCompletion() on the returned Export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which will wait until the export status changes. 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. Use the method WaitForExportCompletion on the returned Export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which wait until the export status changes.
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 \ -d invoice[status][is_not]="paid" \ -d invoice[total][lt]=1000 \ -d subscription[status][is]="active" \ -d customer[first_name][is]="John" \ -d customer[last_name][is]="Doe" \ -d customer[email][is]="john@test.com"
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 \ -d invoice[status][is_not]="paid" \ -d invoice[total][lt]=1000 \ -d subscription[status][is]="active" \ -d customer[first_name][is]="John" \ -d customer[last_name][is]="Doe" \ -d customer[email][is]="john@test.com"
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.true
, there are subscription changes scheduled on next renewal. Possible values are : true, falseupdated_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, falseupdated_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 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. 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. Use the method waitForExportCompletion() on the returned Export resource which will wait until the export status changes. 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. Use the method waitForExportCompletion() on the returned Export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which will wait until the export status changes. 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. Use the method WaitForExportCompletion on the returned Export resource which will wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which wait until the export status changes. 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. Use the method wait_for_export_completion on the returned export resource which wait until the export status changes.
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 \ -d invoice[status][is_not]="paid" \ -d invoice[total][lt]=1000 \ -d subscription[status][is]="active" \ -d customer[first_name][is]="John" \ -d customer[last_name][is]="Doe" \ -d customer[email][is]="john@test.com"
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 \ -d invoice[status][is_not]="paid" \ -d invoice[total][lt]=1000 \ -d subscription[status][is]="active" \ -d customer[first_name][is]="John" \ -d customer[last_name][is]="Doe" \ -d customer[email][is]="john@test.com"
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.true
, there are subscription changes scheduled on next renewal. Possible values are : true, falseupdated_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, falseupdated_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}:\ -d coupon[duration_type][is]="forever" \ -d coupon[status][is_not]="active"
curl https://{site}.chargebee.com/api/v2/exports/coupons \ -u {site_api_key}:\ -d coupon[duration_type][is]="forever" \ -d coupon[status][is_not]="active"
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}:\ -d customer[first_name][is_not]="John" \ -d customer[last_name][is_not]="Doe"
curl https://{site}.chargebee.com/api/v2/exports/customers \ -u {site_api_key}:\ -d customer[first_name][is_not]="John" \ -d customer[last_name][is_not]="Doe"
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}:\ -d subscription[status][is]="active"
curl https://{site}.chargebee.com/api/v2/exports/subscriptions \ -u {site_api_key}:\ -d subscription[status][is]="active"
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.true
, there are subscription changes scheduled on next renewal. Possible values are : true, falseupdated_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, falseThis API triggers export of invoice data. The exported zip file contains CSV files with invoice-related data.
curl https://{site}.chargebee.com/api/v2/exports/invoices \ -u {site_api_key}:\ -d invoice[status][is_not]="paid" \ -d invoice[total][lte]=1000
curl https://{site}.chargebee.com/api/v2/exports/invoices \ -u {site_api_key}:\ -d invoice[status][is_not]="paid" \ -d invoice[total][lte]=1000
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.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}:\ -d credit_note[type][is]="adjustment" \ -d credit_note[total][lte]=1200
curl https://{site}.chargebee.com/api/v2/exports/credit_notes \ -u {site_api_key}:\ -d credit_note[type][is]="adjustment" \ -d credit_note[total][lte]=1200
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}:\ -d transaction[payment_method][is_not]="card" \ -d transaction[status][is]="success"
curl https://{site}.chargebee.com/api/v2/exports/transactions \ -u {site_api_key}:\ -d transaction[payment_method][is_not]="card" \ -d transaction[status][is]="success"
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}:\ -d order[status][is]="shipped" \ -d order[amount_paid][is]=1000
curl https://{site}.chargebee.com/api/v2/exports/orders \ -u {site_api_key}:\ -d order[status][is]="shipped" \ -d order[amount_paid][is]=1000
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 \ -X POST \ -u {site_api_key}:\ -d item_family[name][is]="acme-INC"
curl https://{site}.chargebee.com/api/v2/exports/item_families \ -X POST \ -u {site_api_key}:\ -d item_family[name][is]="acme-INC"
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 \ -X POST \ -u {site_api_key}:\ -d item[status][is]="active"
curl https://{site}.chargebee.com/api/v2/exports/items \ -X POST \ -u {site_api_key}:\ -d item[status][is]="active"
item_family_id
.type
. Possible values are : plan, addon, charge.name
.item_applicability
. Possible values are : all, restricted.status
. Possible values are : active, archived, deleted.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, falsemetered
. 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 \ -X POST \ -u {site_api_key}:\ -d item_price[pricing_model][is]="per_unit"
curl https://{site}.chargebee.com/api/v2/exports/item_prices \ -X POST \ -u {site_api_key}:\ -d item_price[pricing_model][is]="per_unit"
item_family_id
.item_type
. Possible values are : plan, addon, charge.currency_code
.name
s.pricing_model
. Possible values are : flat_fee, per_unit, tiered, volume, stairstep.item_id
.trial_period
.trial_period_unit
. Possible values are : day, month.status
. Possible values are : active, archived, deleted.updated_at
.period_unit
. Possible values are : day, week, month, year.period
.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 \ -X POST \ -u {site_api_key}:\ -d attached_item[type][is]="mandatory"
curl https://{site}.chargebee.com/api/v2/exports/attached_items \ -X POST \ -u {site_api_key}:\ -d attached_item[type][is]="mandatory"
addon
, charge
. Possible values are : plan, addon, charge.item_id
of the item being attached.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 \ -X POST \ -u {site_api_key}:\ -d differential_price[parent_item_id][is]="ssl"
curl https://{site}.chargebee.com/api/v2/exports/differential_prices \ -X POST \ -u {site_api_key}:\ -d differential_price[parent_item_id][is]="ssl"
addon
or charge
) whose price should change according to the plan-item it is applied to.