Examples
Usage events and metrics are a flexible framework for representing a wide range of usage-based pricing models
Transaction volume
CloudPay is a FinTech company that provides open banking and payment infrastructure. They process payments for their customers in multiple currencies and support a range of payment methods, such as bank transfers, direct debits and credit cards. They charge a fixed percentage of each transaction, regardless of the currency and payment method.
To implement this pricing model in Sequence, CloudPay sets up usage events and metrics as follows:
Usage events and metrics for CloudPay
- Each event represents an individual transaction, and carries information about the transaction amount, currency and payment method. Even though the payment method is not used in the current CloudPay pricing model, it is included in case the company decides to charge different fees depending on the payment method in the future.
- The usage metric is defined as the SUM of the amount over all transaction events. To avoid summing together amounts in different currencies, CloudPay creates two separate metrics, one filtered by
currency = GBP
and the other forcurrency = USD
. These two transaction volumes can later be converted to the same currency, which the customer will eventually be charged in.
API calls
Helios is an API-first company offering OCR technology for parsing PDF documents into structured data. They have specialized endpoints for various document types, such as receipts, contracts and resumes. They charge their customers a fixed amount each time an API endpoint is called and it successfully parses the document (returning a 200 response code). They charge the same amount for all their endpoints, but they would like to display the number of API calls to each endpoint on their invoice.
To implement this pricing model in Sequence, Helios sets up usage events and metrics as follows:
Usage events and metrics for Helios
- Each usage event represents an individual API call, and carries information on the endpoint, response code and payload size. Even though the payload size is not used in Helios’ current pricing model, it is included in case the company decides to charge a higher rate for large documents in the future.
- The usage metric is defined as the
COUNT of api_call
events, filtered by the condition that the response code is 200 (since only successful calls are charged). Because the aggregation is a raw count, the aggregation property is left blank. Finally, in order to display a breakdown by endpoint on the invoice, the endpoint property is specified as the grouping property.
Active users
Datalytics is a BI tool for building and viewing dashboards. When a company buys Datalytics, everyone in the company gets access to the tool, but Datalytics charges the company only for active users, where ”active” is defined as having logged at least one session in the last month. Users also have different roles (e.g. admin, developer, viewer), and the charge per user depends on the role.
To implement this pricing model in Sequence, Datalytics sets up usage events and metrics as follows:
Usage events and metrics for Datalytics
Each event represents an individual user session, and includes the user ID and role.
The usage metrics count the number of UNIQUE user_ids
over all user_session events. Therefore, if a user has multiple sessions in the period that the metric is calculated for, it will only contribute 1 to the final value. Additionally, because active users are charged a different fee depending on their role, Datalytics creates a separate metric for each user_role, adding a filter to select only users with that role.