
All text matching in Sequence is case-sensitive. Make sure you use the same cases for event types in your usage event and metrics, and for customer aliases in your usage events and customers.
Aggregation type | Requires aggregation property | Description | SQL equivalent |
---|---|---|---|
COUNT | no | Total number of events | COUNT(*) |
SUM | yes | Sum of a numeric property | SUM(properties[‘property_name’]) |
UNIQUE | yes | Count of unique values of a property | COUNT(DISTINCT properties[‘property_name’]) |
SUM
and UNIQUE
require you to specify an event property as the argument of the aggregation, enter the name of this property in the “Aggregation property” field.
When the billing engine runs, it calculates all usage metrics for each of your customers over the last billing period. This calculated value is then combined with a price to determine the charge that will appear on the invoice.
1: Numerical values (such as transaction amount, duration, size, etc) must conform with ISO 31-0.
Filtering
You can further refine the scope of a usage metric using filters. A filter limits the aggregation input to events that match a specific event property value. For example, if your events have a property calledmethod
,
you can filter your metric to events where method = card_payment
:

Grouping
Use grouping to customize the layout of a usage-based charge on an invoice by breaking down usage by an event property. For example, grouping bymethod
will let you display the usage for method = card_payment
and method = direct_debit
on separate lines on the invoice.
To learn more about customizing your invoice layout via grouping, reach out to the Sequence team.
Grouping has been deprecated until further notice. Use parent-child customer hierarchies and roll-up billing to break down usage by child account instead.
Editing metrics
Updating and deleting usage metrics is currently only supported via the API. Making changes to a metric will not retroactively affect invoices already created. To update or correct existing invoices after changing a metric, recalculate a draft invoice, or issue a credit note against an issued invoice.Usage calculation period
When your pricing includes graduated usage tiers, you can just the usage calculation period to achieve more advanced usage based pricing scenarios, such as billing for monthly overages over an annual running total of customer usage. Options:- Billing period (default): Usage is calculated for each billing period.
- Cumulative usage: Usage is counted from the billing schedule start date and accumulates with each billing period.
- Quarter: Usage is counted over a quarterly period. Tiers in each billing period are based on quarterly usage.
- Annual: Usage is counted over an annual period. Tiers in each billing period are based on annual usage.

Worked examples
Worked examples
Example with a tiered pricing model (graduated), billed monthly in arrears:
- Tier 1: 0 - 100 events @ $1 per event
- Tier 2: 101 - 500 events @ $2 per event
- Month 1 bill: $60
- Month 2 bill: $60
- …
- Month 12 bill: $60
- Month 1 bill: 1)
- Month 2 bill: 1 + 20 events * $20)
- Month 3 bill: 2)
- Month 4 bill: 2) …
- Month 1 bill: 1)
- Month 2 bill: 1 + 20 events * $20)
- Month 3 bill: 2)
- Month 4 bill (usage resets): 1)
- Month 1 bill: 1)
- Month 2 bill: 1 + 20 events * $20)
- Month 3 bill: 2)
- …
- Month 1 (year 2): 1)