New in Chargebee: Explore Reveal and understand your payment performance end-to-end.

Use cases

Query billing data, investigate failures, and export records with the Chargebee CLI.

Before you start

Commands use your configured site. Write operations require a test site.

List commands return one page of JSON results. Set the page size with limit; pass the returned next_offset as offset to retrieve additional pages.

Look up a customer with the CLI

Find customers by email:

chargebee customer list -d 'email[is]=ada@example.com' -d limit=20

List subscriptions for a customer:

chargebee subscription list -d 'customer_id[is]=cust_123' -d limit=20

Review subscriptions in trial

List subscriptions that are currently in trial:

chargebee subscription list -d 'status[is]=in_trial' -d limit=20

trial_end is a Unix timestamp in seconds.

Review subscription cancellations

List canceled subscriptions:

chargebee subscription list -d 'status[is]=cancelled' -d limit=20

Inspect cancelled_at, cancel_reason, and cancel_reason_code when present to decide which cancellations to investigate.

Find outstanding invoices with the CLI

List invoices with a payment_due or not_paid status:

chargebee invoice list -d 'status[in]=["payment_due","not_paid"]' -d limit=20

Check customer_id, amount_due, and currency_code in each invoice. Amounts use the currency's smallest unit, such as cents for USD.

Find failed payments with the CLI

List payment transactions with a failure or late_failure status:

chargebee transaction list -d 'type[is]=payment' -d 'status[in]=["failure","late_failure"]' -d limit=20

Inspect error_code and error_text when present for details about the failure.

Find failed webhook deliveries with the CLI

List up to 20 events with failed webhook deliveries, newest first:

chargebee event list -d 'webhook_status[is]=failed' -d 'sort_by[desc]=occurred_at' -d limit=20

Retrieve an event payload:

chargebee event retrieve ev_123

To test your local handler, use Webhook forwarding.

Export customer data to a JSON file

Save a page of up to 100 customers to a file:

chargebee customer list -d limit=100 > customers.json

This exports one page. For field selection, see Process responses.

Update a customer on a test site

Turn off automatic collection for a test customer:

chargebee customer update cust_123 -d auto_collection=off