Docs

Log into read the version of docs relevant to your site.

Usecases

Use Case 1: Automating Task-Based Billing for SaaS

Let's consider a business "Acme Inc." that provides automation solutions for SaaS companies. Customers are charged based on the number of automation tasks executed every month. Acme targets customers with varying automation needs, wherein most users have a predictable number of requests each month and even customers with high-volume requests.

Let us look at how Chargebee's usage-based billing can be applied for Acme.

Pricing Model

Acme adopts a hybrid pricing model combining:

  • Included Usage (customer is entitled to certain features/quotas via fixed platform fee)

  • On-demand Usage (customer pays for any excess usage via pay-as-you-go fee)

Configuration in Chargebee Billing

Let's look at how to automate usage-based billing for Acme using Chargebee:

Step 1: Product Catalog

Acme's product catalog must be set up with the following plans and addons:

Plans & AddonsNameConfiguration
Plan 1 (Fixed fee for included usage)Professional MonthlyPriced at $49/month with 100K tasks as included usage.
Plan 2 (Fixed fee for included usage)Team MonthlyPriced at $99/month with 500K tasks as included usage.
Addon 1 (Usage-based fee)Tasks MonthlyPriced at $0.1 per task (per-unit pricing).

Step 2: Usage Events

Acme can send usage events to Chargebee Billing through two API endpoints, Ingest a Usage Event for individual events, and Ingest Usage Events in Batch for bulk submissions.

Alternatively, Acme can also import usage events in bulk using the Chargebee Billing application user interface. The following event details must be passed along with other usage event data.

  • Event Trigger
    • An event is triggered whenever an automation is executed by Acme.
  • Event Attributes
    • id: Universally Unique Identifier(UUID) to identify an event.
    • usage_timestamp: Captures the time when the event occurred (critical for billing and usage insights).
    • subscription_id: Identifies the subscription to which the event is attributed.
    • automation_id: Identifies the executed automation.
    • number_of_tasks: Records the number of tasks executed in the automation.

Step 3: Metered Feature Creation

The following metered feature needs to be created to track the number of the tasks that are automated.

Metered Feature (F1) - Tracks the SUM of tasks executed.

Once the metered feature is created, the next step is to link pricing for the metered feature and map it with relevant plans and addons price points.

Link Items: For Acme's pricing requirement, the following plans and addons need to be linked:

Plans

  • F1 -> Professional Monthly
  • F1 -> Team Monthly

Addon

  • F1 -> Tasks Monthly

Set included usage: This denotes specifying the included usage for the feature for the plan's billing period, in Acme's case specifying the number of tasks per month. Chargebee automatically tracks usage for the feature and when the included usage is exceeded, additional cost is calculated by multiplying the units purchased.

Specify the included usage as follows:

Plans

  • F1 -> Professional Monthly: 100,000 tasks/month.
  • F1 -> Team Monthly: 500,000 tasks/month.

Addon

  • F1 -> Additional Tasks Monthly: On-demand usage(entitlement limit is automatically associated due to usage-based configuration).

Once Acme implements all the steps mentioned above, Chargebee Billing begins to track usage and bills Acme's subscribers appropriately.

Usage Tracking and Billing in Chargebee

Let's take a look into a subscription record to see the usage summary:

Sample Subscription

Assume a customer, John Doe subscribes to the Professional Monthly plan and purchases 100K tasks/month. The subscription details are as follows:

Line Item 1: Professional Monthly

  • Base price for 100K tasks: $49.

Line Item 2: Tasks Monthly

  • Usage over 100K tasks is billed at $0.1 per task.

Usage Tracking

  1. Customer John Doe executes an automation, triggering an event.
  2. Event records the number of tasks executed.
  3. SUM of tasks (F1) is calculated for John Doe for the billing cycle.

Billing

  1. If the total tasks exceed the included usage which is 100K tasks/month, overages are billed at $0.1 per task via the Tasks Monthly addon.
  2. Usage and billing insights are updated in real-time based on recorded events.
  3. Upon renewal, a pending invoice gets generated and events continue to be recorded for upto 30 days in the past even after invoice generation. Once the invoice is finalised, any additional events will not be billed.
  4. John Doe is invoiced with the usage summary doc.

This setup allows Acme to scale billing based on actual usage while offering predictable pricing for customers within their plan limits.

Use Case 2: Implementing Pure Pay-As-You-Go Usage-Based Billing

Let's consider a business, DataStream Inc., that offers real-time data enrichment API to SaaS companies. DataStream’s customers have highly variable usage patterns. While some may make a few thousand API calls per month, others may make millions. To keep pricing simple and fair, DataStream wants to charge customers only for the API calls they make, without offering any bundled or included usage.

Pricing Model

DataStream adopts a pure pay-as-you-go pricing model, where:

  • There is no included usage.
  • Every unit of usage is billed.
  • Pricing is based entirely on usage recorded during the billing period.

Configuration in Chargebee Billing

Let's look at how to automate usage-based billing for DataStream using Chargebee:

Step 1: Product Catalog

DataStream’s product catalog must be set up with the following plans and addons:

Item TypeNameConfiguration
PlanAPI Access Monthly$0/month (This is mandatory)
AddonAPI Calls Monthly$0.05 per API call (per-unit pricing)

Note:

  • The plan does not include any usage or usage-based pricing.
  • All usage charges are driven entirely by the addon which is linked to the metered feature while creating the addon itself.

Step 2: Usage Events

DataStream can send usage events to Chargebee Billing whenever an API call is made.

Usage events can be sent using:

  • Ingest a Usage Event API (for real-time ingestion)
  • Ingest Usage Events in Batch API (for bulk submission)
  • Bulk import via the Chargebee Billing UI

Event Trigger An event is triggered whenever a customer makes an API call and each usage event should include the mandatory attributes along with the api consumption data.

Step 3: Metered Feature Creation

A metered feature is required to track API usage.

Metered Feature (F1) - Tracks the SUM of API calls.

This feature aggregates all API call usage recorded for a subscription within a billing cycle.

Once the metered feature is created, the next step is to link pricing for the metered feature and map it with relevant plans and addons price points.

Link Items: For DataStream's pricing requirement, the following plans and addons need to be linked:

Plans

  • F1 -> API Access Monthly: $0/month

Addon

  • F1 -> API Calls Monthly: $0.05 per API call (per-unit pricing)

Usage Tracking and Billing in Chargebee

Let’s walk through how usage is tracked and billed for a customer subscription.

Sample Subscription

Assume a customer, Jane Smith, subscribes to the API Access Monthly plan.

Subscription Line Items

  • Line Item 1: API Access Monthly
    • Price: $0/month
  • Line Item 2: API Calls Monthly
    • Price: $0.05 per API call

Usage Tracking

  1. Jane makes an API call.
  2. DataStream sends a usage event to Chargebee.
  3. The event records one API call.
  4. Chargebee aggregates usage for Metered Feature F1 (SUM of API calls).
  5. All recorded usage is considered billable since there is no included usage.

Billing Behavior

  • Usage charges accumulate throughout the billing cycle.
  • Charges are calculated by multiplying total API calls by the addon price.
  • Usage and billing insights update in near real-time.
  • At renewal:
    • A pending invoice is generated.
    • Usage events can still be recorded for up to 30 days in the past after invoice generation.
    • Once the invoice is finalized, any additional events are not billed.
  • Jane receives an invoice that includes a detailed usage summary.

Example Invoice Calculation

If Jane makes 120,000 API calls in a billing cycle:

  • API Calls: 120,000 × $0.05
  • Total Usage Charge: $6,000

All usage is tracked via metered features and billed strictly based on actual consumption, without entitlements or included limits. This approach gives customers maximum flexibility while ensuring accurate, transparent billing based on real usage.

Was this article helpful?