Bill every successful outcome with outcome-based pricing
Overview
In outcome-based pricing, customers are billed when your product delivers a defined unit of value, rather than for time, seats, or raw consumption. This guide shows you how to build that model in Chargebee Billing: one metered feature per outcome type, a $99 monthly plan that includes 100 resolutions, and a metered addon per outcome type.
Throughout this guide, you configure one running example. An AI support agent charges for two outcomes:
| Outcome type | Included with the plan | Unit price |
|---|---|---|
| Resolution | 100 per month | $0.99 |
| Procedure handoff | None | $1.00 |
At most one outcome is billed per conversation. The included resolutions are granted at the start of each monthly billing cycle. Resolutions past that allowance, and every procedure handoff, are rated and invoiced monthly.
If your customer gets a yearly included usage/ free resolutions limit and you charge them for the overages every month, refer to the Bill annually for a plan with yearly included usage per product, and charge overage monthly.
How this billing model works
The illustration below explains how this billing model works:
Before you start
If you don't already have a Chargebee Billing account, click here to sign up.
Confirm your access. You need an admin role to change site configuration and build the Product Catalog.
Advanced Usage-Based Billing is enabled by default for new Chargebee Billing sites. If you are an existing user, enable it before you build the model.
Validate before go-live
Before enabling this on a live site, validate the full pricing flow on a test site. You can test your billing setup in Chargebee's test site using Time Machine. Time Machine lets you simulate billing cycle progression, from subscription creation through the first invoice to later monthly cycles, without waiting for real calendar time.
When you enter Time Machine, existing subscriptions and customer details on the test site are erased. Export the data first if you need a backup.
When you are ready to go live, copy the configuration and Product Catalog from the test site to the live site with Transfer Configurations. To transfer customer, subscription, or invoices data, you can import them on your live site.
Implementation steps
Follow these steps in order. Each step shows how to do the task in the Chargebee Billing app and with the API.
1. Send outcome events into Chargebee Billing
Start by streaming your product's outcomes into Chargebee Billing. For this example, a usage event is generated every time a conversation reaches a terminal state, and it includes outcome_quantity and outcome_type.
Chargebee's ingestion is schemaless. Chargebee Billing stores any additional properties you send alongside the required attributes and deduplicates repeated events.
| Field | Purpose |
|---|---|
deduplication_id | Set this to the conversation ID. Chargebee Billing uses it to drop a repeated event for the same subscription. |
subscription_id | The Chargebee Billing subscription that should be billed for the outcome. |
usage_timestamp | When the outcome was delivered, in milliseconds. This determines which billing period the event falls into. |
outcome_type | One of resolution or procedure_handoff. This decides which metered feature picks up the event. |
outcome_quantity | 1 for a delivered outcome. |
You can send usage in one of the following ways, based on how your product emits usage.
Using the app
CSV bulk upload. Export a CSV from your data warehouse and upload it in Chargebee Billing. Each row must include a deduplication ID, subscription ID, and usage timestamp in milliseconds.
- Go to Usages > Usage Events > Add Usage Events.
- Select the Quick file upload tab, upload the file, and click Proceed to review.
- Review the data, then click Import Events.
Using the API
Send events in real time or in micro-batches as they happen. You can send events using Ingest a usage event and Ingest usage events in batch. Usage events use the ingest host ({site}.ingest.chargebee.com), not the standard Chargebee API host.
Ingest a single usage event
curl https://{site}.ingest.chargebee.com/api/v2/usage_events \
-u {site_api_key}:\
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
"deduplication_id": "conv_123",
"subscription_id": "{subscription_id}",
"usage_timestamp": "1737612931000",
"properties": {
"outcome_type": "resolution",
"outcome_quantity": 1
}
}'Ingest usage events in batch (up to 500 events per request)
curl https://{site}.ingest.chargebee.com/api/v2/batch/usage_events \
-u {site_api_key}:\
--header 'Content-Type: application/json;charset=UTF-8' \
--data '{
"events": [
{
"deduplication_id": "conv_123",
"subscription_id": "{subscription_id}",
"usage_timestamp": "1737612931000",
"properties": {
"outcome_type": "resolution",
"outcome_quantity": 1
}
},
{
"deduplication_id": "conv_124",
"subscription_id": "{subscription_id}",
"usage_timestamp": "1737612991000",
"properties": {
"outcome_type": "procedure_handoff",
"outcome_quantity": 1
}
}
]
}'Using Amazon S3
Upload usage event files from an S3 bucket. Chargebee Billing picks them up and processes them automatically. See Ingesting usage from Amazon S3.
Backdated ingestion limits differ by method and site type. On a live site, the Usage Events API accepts events from the last 12 hours (configurable on request); CSV and S3 uploads accept events from the last 30 days. On a test site, the API window is 12 hours and file uploads accept events from the last year. See Usage-Based Billing limits.
2. Define the outcomes your product delivers
Now that usage is flowing, decide what feature(s) or product(s) you offer in the plan. In Chargebee Billing, you capture that unit by defining a metered feature. Create a metered feature for each of the outcome types to be billed. You set the aggregation rule and a filter on the feature, and from that point, Chargebee rolls up matching events against it.
For this example, create one metered feature per outcome type. Each feature uses Sum on outcome_quantity and a filter on outcome_type.
Using the app
- Go to Usages > Metered Features and click Create Metered Feature.
- Enter a name for the feature, such as Resolutions.
- Under Usage Calculation, select Sum and select the
outcome_quantityevent property. - Add a filter condition where
outcome_typeequalsresolution. - Review the usage calculation formula and preview, then click Create.
- Repeat for procedure handoffs. Name the feature Procedure Handoffs, sum
outcome_quantity, and filter whereoutcome_typeequalsprocedure_handoff.
Using the API
The aggregation method and filter are expressed as a SQL query over usage event properties. Chargebee Billing returns a meter whose id is also the feature ID you use in later entitlement and usage calls. The following example creates the Resolutions feature.
curl https://{site}.chargebee.com/api/v2/metered_features \
-u {site_api_key}:\
-d name="Resolutions" \
-d feature_unit="resolution" \
-d description="Number of successful resolutions." \
-d query="SELECT SUM(outcome_quantity) from events WHERE outcome_type = 'resolution'" \
-d "column_definitions[column_name][0]"="outcome_quantity" \
-d "column_definitions[data_type][0]"="NUMBER" \
-d "column_definitions[column_name][1]"="outcome_type" \
-d "column_definitions[data_type][1]"="STRING"Repeat the call for procedure handoffs. Use name="Procedure Handoffs", feature_unit="procedure_handoff", and query="SELECT SUM(outcome_quantity) from events WHERE outcome_type = 'procedure_handoff'".
3. Package your offerings into a plan
This step creates the monthly plan, sets its price, and defines how many resolutions are included each month.
3a. Create the plan
Create a Standard plan that carries the monthly platform fee, and link pricing to the plan in the next step.
Using the app
- Go to Product Catalog > Plans > + Create Plan.
- Select a product family, enter the plan details, and click Create.
| Field | Value |
|---|---|
| Internal name | Standard |
| Plan ID | standard |
Using the API
Create the plan item with Create an item. Replace {item_family_id} with your product family ID.
curl https://{site}.chargebee.com/api/v2/items \
-u {site_api_key}:\
-d id="standard" \
-d name="Standard" \
-d type="PLAN" \
-d item_family_id="{item_family_id}"3b. Define the plan price point
Once the plan is saved, create a price point for it.
Using the app
- Open the plan details page. In the Pricing section, click Set Price for the monthly frequency and currency you want.
- Set the pricing model to Flat fee and the price to $99, then click Create.
Using the API
Create the monthly price point with Create an item price. price is in the minor unit of the currency: 9900 is $99.00.
curl https://{site}.chargebee.com/api/v2/item_prices \
-u {site_api_key}:\
-d id="standard-USD-monthly" \
-d item_id="standard" \
-d name="Standard USD monthly" \
-d pricing_model="FLAT_FEE" \
-d price=9900 \
-d currency_code="USD" \
-d period_unit="MONTH" \
-d period=13c. Grant the included resolutions
Link the Resolutions metered feature from Step 2 and set the included usage. Only resolutions are included with the plan, and linking is not needed for the procedure handoffs.
Using the app
- Go to Usages > Metered Features and select Resolutions.
- Click Link to items.
- Select the Standard plan and click Next: Set Included Usage.
- Set the included usage for the monthly plan to 100, then click Link to Items.
Using the API
Grant the included quota with Manage entitlements for a feature. Use the metered feature ID returned when you created the feature. This example uses resolutions.
curl https://{site}.chargebee.com/api/v2/entitlements \
-u {site_api_key}:\
-d action="UPSERT" \
-d "entitlements[feature_id][0]"="resolutions" \
-d "entitlements[entity_id][0]"="standard" \
-d "entitlements[entity_type][0]"="PLAN" \
-d "entitlements[value][0]"="100"4. Price overages for the outcomes
A metered addon measures and rates a metered feature. Create one metered addon per outcome type. Resolution Overage bills every resolution after the 100 included resolutions are used. Procedure Handoff Outcome bills every procedure handoff, because that outcome has no included usage.
4a. Create the addons
Using the app
- Go to Product Catalog > Addons > + Create Addon.
- Enter the addon details below, select This addon is metered, and click Create.
- Repeat for the other outcome type.
| Internal name | Addon ID | Metered | Metered feature |
|---|---|---|---|
| Resolution Overage | resolution-overage | Yes | Resolutions |
| Procedure Handoff Outcome | procedure-handoff-outcome | Yes | Procedure Handoffs |
Using the API
Create each metered addon with Create an item. Set metered to true. The following example creates the Resolution Overage addon. Repeat with id="procedure-handoff-outcome" and name="Procedure Handoff Outcome".
curl https://{site}.chargebee.com/api/v2/items \
-u {site_api_key}:\
-d id="resolution-overage" \
-d name="Resolution Overage" \
-d type="ADDON" \
-d item_family_id="{item_family_id}" \
-d metered=trueLink each addon to its metered feature as on-demand usage with Manage entitlements for a feature. Entitlements on metered addons are unlimited by default, so there is no internal cap on consumption and every unit beyond the plan quota is billable.
curl https://{site}.chargebee.com/api/v2/entitlements \
-u {site_api_key}:\
-d action="UPSERT" \
-d "entitlements[feature_id][0]"="resolutions" \
-d "entitlements[entity_id][0]"="resolution-overage" \
-d "entitlements[entity_type][0]"="ADDON" \
-d "entitlements[value][0]"="unlimited"Repeat that call for procedure handoffs. Use the Procedure Handoffs feature ID and entitlements[entity_id][0]=procedure-handoff-outcome.
4b. Define the addon price points
Create a monthly price point for each addon.
Using the app
- Open the addon details page. In the Pricing section, click Set Price for the monthly frequency.
- Configure the pricing as follows, then click Create.
- Repeat for the other addon.
| Addon | Pricing model | Price | Billing frequency |
|---|---|---|---|
| Resolution Overage | Per Unit | $0.99 per resolution | Monthly |
| Procedure Handoff Outcome | Per Unit | $1.00 per procedure handoff | Monthly |
You can also use tiered, staircase, or volume pricing on an addon. Use per unit pricing for this model.
Using the API
Create the monthly price point with Create an item price. price is in the minor unit of the currency: 99 is $0.99 and 100 is $1.00.
curl https://{site}.chargebee.com/api/v2/item_prices \
-u {site_api_key}:\
-d id="resolution-overage-USD-monthly" \
-d item_id="resolution-overage" \
-d name="Resolution Overage USD monthly" \
-d pricing_model="PER_UNIT" \
-d price=99 \
-d currency_code="USD" \
-d period_unit="MONTH" \
-d period=1For Procedure Handoff Outcome, use id="procedure-handoff-outcome-USD-monthly", item_id="procedure-handoff-outcome", name="Procedure Handoff Outcome USD monthly", and price=100.
5. Be notified on usage and spends and take desired action
Use a Usages alert on Resolutions so you know when a customer approaches the included quota, and a Spends alert so you know when accrued outcome charges reach an amount you choose.
A Usages alert triggers when a subscription's usage of a metered feature exceeds a percentage of included usage. Procedure handoffs are billed from the first unit and have no included usage. Watch those charges with a Spends alert. A Spends alert triggers when usage charges from metered addons (overage charges) exceed an amount you set.
See Usage Alerts and Setting up Alerts. Configure a webhook endpoint and include the alert_status_changed event before you rely on the alerts. See Webhook settings.
Create a Usages alert
On Standard, 80 percent of included usage is 80 resolutions.
Using the app
- Go to Usages > Alerts and click Create Alert.
- Enter an Alert name, such as Resolutions 80 percent, and an Alert description.
- Under Alert Type, select Usages.
- In Set criteria for sending alert, select Resolutions.
- Enter 80. The form shows exceeds and of included usage.
- Under Apply Alert to, select All Subscriptions or Subscriptions containing specific items.
- Under Alert delivery channel, click Manage connected webhooks and select the endpoint that will receive
alert_status_changed. Chargebee Billing opens Settings > Configure Chargebee > API Keys and Webhooks on the Webhooks tab. - Click Save Alert.
Using the API
Create a usage_exceeded alert with Create an alert. threshold[mode] is percentage.
curl https://{site}.chargebee.com/api/v2/alerts \
-u {site_api_key}:\
-d type="usage_exceeded" \
-d name="Resolutions 80 percent" \
-d description="Notify when resolutions cross 80 percent of included usage" \
-d metered_feature_id="resolutions" \
-d "threshold[mode]"="percentage" \
-d "threshold[value]"=80To limit an alert to one plan price, pass filter_conditions for plan_price_id. To scope an alert to one subscription, pass subscription_id.
Create a Spends alert
This example fires when accrued outcome charges exceed $100.
Using the app
- Go to Usages > Alerts and click Create Alert.
- Enter an Alert name, such as Outcome spend 100, and an Alert description.
- Under Alert Type, select Spends.
- In Set criteria for sending alert, select USD - $ US Dollars.
- Enter 100. The form shows exceeds and the currency symbol after the amount.
- Under Apply Alert to, select All Subscriptions or Subscriptions containing specific items.
- Under Alert delivery channel, click Manage connected webhooks and select the endpoint that will receive
alert_status_changed. - Click Save Alert.
Using the API
Create a spend_exceeded alert with Create an alert. Provide currency_code. The threshold amount is in major units of that currency: 100 is $100. threshold[mode] is absolute.
curl https://{site}.chargebee.com/api/v2/alerts \
-u {site_api_key}:\
-d type="spend_exceeded" \
-d name="Outcome spend 100" \
-d description="Notify when accrued outcome charges reach 100 USD" \
-d currency_code="USD" \
-d "threshold[mode]"="absolute" \
-d "threshold[value]"=100Do not send unit_id or metered_feature_id on this alert type. To limit an alert to one plan price, pass filter_conditions for plan_price_id. To scope an alert to one subscription, pass subscription_id and omit filter_conditions.
Take action when the threshold is reached
When resolutions exceed the percentage you set, or when accrued outcome charges exceed the amount you set, the alert status changes from within_limit to in_alarm. Chargebee sends an alert_status_changed webhook. Use that webhook to email the customer, show an upgrade prompt, or start another workflow. Chargebee Billing records the outcomes and does not enforce a stop.
For a Usages alert, when usage resets at the start of a new billing cycle, the alert status returns to within_limit.
6. Create the customer and subscription
With the catalog in place, create the customer and their subscription. A customer record must exist before a subscription can be created. You can create it first, or create both together in the same flow. Create the subscription for John Doe on the Standard plan, and attach both metered addons so resolutions past the allowance and procedure handoffs can be rated monthly.
Using the app
- Go to Customers and create a customer record for John Doe if one does not already exist.
- From the customer, create a subscription and add the Standard monthly plan item price.
- Attach the Resolution Overage and Procedure Handoff Outcome monthly addon item prices.
- Review and create the subscription.
Using the API
Create the customer with Create a customer:
curl https://{site}.chargebee.com/api/v2/customers \
-u {site_api_key}:\
-d first_name="John" \
-d last_name="Doe" \
-d email="jdoe@example.com"Create the subscription with Create a subscription for items. Attach the plan price and both metered addon prices:
curl https://{site}.chargebee.com/api/v2/customers/{customer_id}/subscription_for_items \
-u {site_api_key}:\
-d "subscription_items[item_price_id][0]"="standard-USD-monthly" \
-d "subscription_items[item_price_id][1]"="resolution-overage-USD-monthly" \
-d "subscription_items[item_price_id][2]"="procedure-handoff-outcome-USD-monthly"When you create the subscription, you can override the plan's default entitlement to give this customer a custom included quota. For example, grant John Doe 150 resolutions per month instead of 100, without creating a new plan. You can set the override at creation or update it later.
curl https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/entitlement_overrides \
-X POST \
-u {site_api_key}:\
-d action="UPSERT" \
-d "entitlement_overrides[feature_id][0]"="resolutions" \
-d "entitlement_overrides[value][0]"="150"See Upsert or remove entitlement overrides for a subscription.
The active subscription looks like this:
| Line item | Billing frequency | Invoicing |
|---|---|---|
| Standard (non-metered) | Monthly | $99 invoiced at the start of each billing cycle, granting 100 included resolutions for that month. |
| Resolution Overage (metered) | Monthly | $0.99 per resolution, invoiced monthly only after the 100 resolutions are used. |
| Procedure Handoff Outcome (metered) | Monthly | $1.00 per procedure handoff, invoiced monthly from the first unit. |
7. Track usage against your subscriptions and share with customers
Use the following options to monitor outcomes, review billed consumption, and answer customer questions about their invoice.
Monitor usage during the current period
Using the app
Open the subscription and review cumulative resolutions against the 100 included resolutions under Usage summary. The same section shows the aggregated total for procedure handoffs. For example: Resolutions 120, Procedure Handoffs 9.
Using the API
Retrieve usage summary to show consumed usage for a feature over a reporting window. If you omit timeframe_start and timeframe_end, Chargebee Billing defaults to the start of the current subscription term through now. Call it once per metered feature.
curl https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/usage_summary \
-G \
-u {site_api_key}: \
--data-urlencode feature_id="resolutions"See Retrieve usage summary for a subscription.
Retrieve usage charges to show accrued overage and outcome charges before the monthly invoice is generated. This returns the current unbilled snapshot, including included usage, total usage, and the overage amount when a metered addon is attached.
curl https://{site}.chargebee.com/api/v2/subscriptions/{subscription_id}/usage_charges \
-u {site_api_key}:Review usage after invoicing and share details with customers
Using the app
Open the generated invoice and select View Usage PDF to review or share the outcome breakdown.
Using the API
Use Retrieve an invoice to read the line items on the generated usage invoice. The response includes those invoiced line items. This operation does not return current unbilled usage charges.
Related use cases
Handle outcome reversals
An outcome can be invalidated after it was delivered. In this example, a customer returns to a resolved conversation, and the original resolution should come out of the billable count.
If a later reversal is accepted, its timestamp applies only to the billing period that contains it. That reversal does not reduce a closed invoice from an earlier period. Correcting a closed invoice requires the applicable credit note workflow, or voiding the invoice and regenerating it. A compensating event affects only a later invoice.
Whether the ingest API and a SUM meter accept a negative outcome_quantity is [unverified]. If that value is accepted, send a second usage event with outcome_quantity set to -1, a new deduplication ID, and usage_timestamp set to the current time. A SUM aggregation would then include that event only in the billing period that contains the reversal timestamp.
| Event | What to send |
|---|---|
| Original outcome | deduplication_id is conv_123, outcome_type is resolution, outcome_quantity is 1, and usage_timestamp is when the conversation was resolved. |
| Reversal | deduplication_id is a new value, such as conv_123_reversal_{timestamp}, outcome_type is resolution, outcome_quantity is -1, and usage_timestamp is the current time. |
The reversal must use a new deduplication ID. If you reuse conv_123, Chargebee Billing discards the reversal as a duplicate.
Manage outcome invoices
At the end of each monthly billing period, Chargebee Billing creates the usage invoice for resolutions past the allowance and for procedure handoffs in a Pending state. While an invoice is pending, you can still ingest usage events dated within the accepted backdating window, including reversal events, and they are included in the final charge. Pending invoices do not trigger payment collection.
You manage how pending invoices close under Settings > Configure Chargebee > Billing LogIQ > Usage Based Billing. Two behaviors are available:
- Manual close. Review all usage, then close the invoice yourself.
- Auto-close. Chargebee Billing closes the invoice automatically at a time you define.
Once an invoice is closed, no further usage can be added to it, and payment collection begins. If you need to correct a closed invoice, void it and regenerate it with the updated usage, or send a compensating event so the correction lands on the next invoice.
See Actions for pending invoices, the Invoices API, and the Credit Notes API.
Summary
This guide showed you how to turn outcome events into one metered feature per outcome type, grant 100 included resolutions each month on a $99 plan, and rate resolutions past that allowance and every procedure handoff with monthly metered addons. You can monitor usage and validate the cycle with Time Machine.
The same pattern works for any product that can define a discrete unit of value and emit one event per unit.