List usage
Changed onReturns the usage billed by each billable metric, aggregated over the requested period and time granularity. This is a premium feature. On a non-premium license the response always covers the last 30 days with a daily granularity, and only the billable_metric_code filter is applied.
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
The time granularity of usage analytics. Possible values are 'daily', 'weekly' and 'monthly'. Defaults to 'daily'.
The currency of usage analytics. Format must be ISO 4217.
The start date of the period for which the usage analytics is calculated.
The end date of the period for which the usage analytics is calculated.
The type of customer for which the usage analytics is calculated. Possible values are 'individual', 'company'.
The external identifier of the customer for which the usage analytics is calculated.
The country of the customer for which the usage analytics is calculated.
The external identifier of the subscription for which the usage analytics is calculated.
Indicates whether the billable metric associated with the usage is recurring.
The code of the plan for which the usage analytics is calculated.
The code of the usage-based billable metrics for which the usage analytics is calculated.
Response
Usage
Example response
{
"usages": [
{
"organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"start_of_period_dt": "2023-11-01",
"end_of_period_dt": "2023-11-30",
"amount_currency": "USD",
"amount_cents": 50000,
"billable_metric_code": "code1",
"units": "1.0"
}
]
}Changes
- breaking
for the
queryrequest parametertime_granularity, default valuedailywas added - warning
added the new
SYPenum value to the//response property for the response status - warning
added the new
TNDenum value to the//response property for the response status - info
added the enum value
SYPto the propertyallOf[Currency]/of thequeryrequest parametercurrency - info
added the enum value
TNDto the propertyallOf[Currency]/of thequeryrequest parametercurrency - info
the response property
//became required for the status
- breaking