Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.
Chargebeechargebee API

Create a metered feature

Idempotency Supported

Creates a metered feature.

Sample Request

create a simple metered feature

Sample Result[JSON]

URL Format

POST https://[site].chargebee.com/api/v2/metered_features

Input Parameters

name
required, string, max chars=50

A case-sensitive name for the metered feature. For example: API Calls, Input Tokens.

description
optional, string, max chars=250

A brief description of the metered feature.

feature_unit
required, string, max chars=50

Unit of measure for the metered feature, in singular form. It is pluralized automatically as needed. For example, request or token.

query
required, string, max chars=500

The SQL query used to measure usage from usage_event properties. For example: SELECT SUM(api_calls) FROM events.

Constraint:

  • The properties referenced in the query must be one of column_definitions.column_name.
column_definitions[0..n]
Parameters for column_definitions. Multiple column_definitions can be passed by specifying unique indices.
pass parameters as column_definitions[<param name>][<idx:0..n>]

Returns

Meter object
Resource object representing meter