Customer usage
Retrieve current usage
Retrieve real-time customer usage data for the current open billing period.
GET
/
customers
/
{external_customer_id}
/
current_usage
Authorization
Path
Query
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
EXTERNAL_CUSTOMER_ID="__EXTERNAL_CUSTOMER_ID__"
EXTERNAL_SUBSCRIPTION_ID="__EXTERNAL_SUBSCRIPTION_ID__"
curl --location --request GET "$LAGO_URL/api/v1/customers/$EXTERNAL_CUSTOMER_ID/current_usage?external_subscription_id=$EXTERNAL_SUBSCRIPTION_ID" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json'
{
"customer_usage": {
"amount_cents": 123,
"charges_usage": [],
"currency": "EUR",
"from_datetime": "2022-07-01T00:00:00Z",
"issuing_date": "2022-08-01T23:59:59Z",
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"taxes_amount_cents": 200,
"to_datetime": "2022-07-31T23:59:59Z",
"total_amount_cents": 123
}
}
Authorizations
Authorization
string
headerrequiredBearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
external_customer_id
string
requiredThe customer external unique identifier (provided by your own application).
Query Parameters
external_subscription_id
string
requiredThe unique identifier of the subscription within your application.
Response
200 - application/json
customer_usage
object
requiredWas this page helpful?
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
EXTERNAL_CUSTOMER_ID="__EXTERNAL_CUSTOMER_ID__"
EXTERNAL_SUBSCRIPTION_ID="__EXTERNAL_SUBSCRIPTION_ID__"
curl --location --request GET "$LAGO_URL/api/v1/customers/$EXTERNAL_CUSTOMER_ID/current_usage?external_subscription_id=$EXTERNAL_SUBSCRIPTION_ID" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json'
{
"customer_usage": {
"amount_cents": 123,
"charges_usage": [],
"currency": "EUR",
"from_datetime": "2022-07-01T00:00:00Z",
"issuing_date": "2022-08-01T23:59:59Z",
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"taxes_amount_cents": 200,
"to_datetime": "2022-07-31T23:59:59Z",
"total_amount_cents": 123
}
}