Billing meters represent usage metrics (e.g., API calls, storage use, transaction value) that your applications track and bill for. Each meter defines:
count
, sum
, latest
, or max
)aggregation_field
) to apply that aggregation on;id
is a unique code for a meter (merchant-defined or system generated)Below is the complete list of aggregation types officially supported by XStak.
Aggregation Type | Description | Transcription |
---|---|---|
SUM | Sum a defined property for incoming events | SUM(events.payload.value) |
COUNT | Count the number of times an incoming event occurs | COUNT(events) |
LATEST | Get the latest value of a defined property for incoming events | LAST_VALUE(events) OVER ([PARTITION BY events.timestamp]) |
MAX | Get the maximum value of a defined property for incoming events | MAX(events.payload.value) |
While COUNT
tallies the number of times an event occurs, all other types aggregate over a single property of the event. The result of this aggregation directly determines how your customers are charged.
This resource lets you create, update, get or toggle meters via REST endpoints.
{{base_url}}/public/v1/meter