Retrieve customer current and projected usage
curl --request GET \
--url https://api.getlago.com/api/v1/customers/{external_customer_id}/projected_usage \
--header 'Authorization: Bearer <token>'{
"customer_projected_usage": {
"from_datetime": "2022-07-01T00:00:00Z",
"to_datetime": "2022-07-31T23:59:59Z",
"issuing_date": "2022-08-01",
"amount_cents": 123,
"projected_amount_cents": 256,
"taxes_amount_cents": 200,
"total_amount_cents": 123,
"charges_usage": [
{
"units": "1.0",
"projected_units": "2.0",
"events_count": 10,
"amount_cents": 123,
"projected_amount_cents": 256,
"amount_currency": "EUR",
"charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"charge_model": "graduated",
"invoice_display_name": "Setup"
},
"billable_metric": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Storage",
"code": "storage",
"aggregation_type": "sum_agg"
},
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"filters": [
{
"units": "0.9",
"projected_units": "1.8",
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"invoice_display_name": "AWS eu-east-1",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"values": {
"region": [
"us-east-1"
]
},
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"grouped_usage": [
{
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"units": "0.9",
"projected_units": "1.8",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"grouped_by": {},
"filters": [
{
"units": "0.9",
"projected_units": "1.8",
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"invoice_display_name": "AWS eu-east-1",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"values": {
"region": [
"us-east-1"
]
},
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"currency": "EUR"
}
}Customer usage
Retrieve projected usage
Retrieve real-time projected usage data for the current open billing period.
GET
/
customers
/
{external_customer_id}
/
projected_usage
Retrieve customer current and projected usage
curl --request GET \
--url https://api.getlago.com/api/v1/customers/{external_customer_id}/projected_usage \
--header 'Authorization: Bearer <token>'{
"customer_projected_usage": {
"from_datetime": "2022-07-01T00:00:00Z",
"to_datetime": "2022-07-31T23:59:59Z",
"issuing_date": "2022-08-01",
"amount_cents": 123,
"projected_amount_cents": 256,
"taxes_amount_cents": 200,
"total_amount_cents": 123,
"charges_usage": [
{
"units": "1.0",
"projected_units": "2.0",
"events_count": 10,
"amount_cents": 123,
"projected_amount_cents": 256,
"amount_currency": "EUR",
"charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"charge_model": "graduated",
"invoice_display_name": "Setup"
},
"billable_metric": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Storage",
"code": "storage",
"aggregation_type": "sum_agg"
},
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"filters": [
{
"units": "0.9",
"projected_units": "1.8",
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"invoice_display_name": "AWS eu-east-1",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"values": {
"region": [
"us-east-1"
]
},
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"grouped_usage": [
{
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"units": "0.9",
"projected_units": "1.8",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"grouped_by": {},
"filters": [
{
"units": "0.9",
"projected_units": "1.8",
"amount_cents": 1000,
"projected_amount_cents": 2000,
"events_count": 10,
"invoice_display_name": "AWS eu-east-1",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"values": {
"region": [
"us-east-1"
]
},
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
],
"projected_presentation_breakdowns": [
{
"presentation_by": {},
"units": "9.0"
}
]
}
],
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"currency": "EUR"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The customer external unique identifier (provided by your own application).
Example:
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
Query Parameters
The unique identifier of the subscription within your application.
Example:
"sub_1234567890"
Optional flag to determine if taxes should be applied. Defaults to true if not provided or if null.
Example:
true
Response
Customer usage
Show child attributes
Show child attributes
Was this page helpful?
⌘I