v1

latestOpenAPI 3.1.0AGPLv32026-07-26168262527.5 KB
customers

Retrieve customer current usage

This endpoint enables the retrieval of the usage-based billing data for a customer within the current period.

get/customers/{external_customer_id}/current_usage

Path parameters

external_customer_idstring required
Example:5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba

The customer external unique identifier (provided by your own application).

Query parameters

external_subscription_idstring required
Example:sub_1234567890

The unique identifier of the subscription within your application.

apply_taxesboolean
Example:true

Optional flag to determine if taxes should be applied. Defaults to true if not provided or if null.

charge_idstring uuid
Example:1a901a90-1a90-1a90-1a90-1a901a901a90

Filter usage to a specific charge by its Lago ID (UUID). Replaces deprecated filter_by_charge_id.

charge_codestring
Example:storage

Filter usage to a specific charge by its code. Replaces deprecated filter_by_charge_code.

billable_metric_codestring
Example:storage

Filter usage to a specific billable metric by its code.

groupobject

Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. group[cloud]=aws. Replaces deprecated filter_by_group.

{
  "cloud": "aws"
}
filter_by_charge_idstring uuid
Example:1a901a90-1a90-1a90-1a90-1a901a901a90

Deprecated. Filter usage to a specific charge by its Lago ID (UUID).

filter_by_charge_codestring
Example:storage

Deprecated. Filter usage to a specific charge by its code.

filter_by_groupobject

Deprecated. Filter usage by pricing group. Pass key/value pairs as query parameters, e.g. filter_by_group[cloud]=aws.

{
  "cloud": "aws"
}
full_usageboolean
Example:true

When true, returns usage since subscription start instead of the current billing period. Requires one of charge_id, charge_code, group (or their deprecated filter_by_* equivalents) to be set.

filter_by_presentationstring
Example:["engineering", "operations"]

Filter presentation_breakdowns by a JSON-encoded array of presentation group key values. Only breakdowns matching the provided values will be returned. Pass an empty array to disable presentation_breakdowns entirely.

Response

Customer usage