Get consumed units for a customer
Changed onHow many units a customer has consumed through this meter in a billing period, alongside the period's boundaries. Without at, this is an O(1) read of the current period's projection — the number billing uses. With at, the units are replayed from the raw events as of that instant, within the billing period containing it, which is the right call for reconstructing what a customer had consumed at a past moment (an invoice date, a support question).
Request
- Base URLhttps://api.creem.io
- AuthAPI key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Query parameters
The customer whose consumption is read
ISO 8601 instant. When present, the consumption is replayed from the raw events as of that point in time, within the billing period that contains it. When absent, the current billing period’s projected total is returned.
Response
Consumed units for the period
Example response
{
"meter_id": "mtr_abc123",
"customer_id": "cust_abc123",
"units": "1280"
}Changes
- info
endpoint added
- info