Skip to main content

Customer usage object

This object represents the usage-based charges associated with one of your customers for the current billing period.
It allows you to monitor customer usage throughout the period.

Schema

{
"customer_usage": {
"from_date": "2022-07-01",
"to_date": "2022-07-31",
"issuing_date": "2022-08-01",
"amount_cents": 123,
"amount_currency": "EUR",
"total_amount_cents": 123,
"total_amount_currency": "EUR",
"vat_amount_cents": 0,
"vat_amount_currency": "EUR",
"charges_usage": [
{
"units": "1.0",
"amount_cents": 123,
"amount_currency": "EUR",
"charge": {
"lago_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"charge_model": "graduated"
},
"billable_metric": {
"lago_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"name": "Usage metric",
"code": "usage_metric",
"aggregation_type": "sum"
},
"groups": [
{
"lago_id": "a78f2185-1474-4a64-95bf-bcd96623fec5",
"key": null,
"value": "europe",
"units": "0.9",
"amount_cents": 1000
}
]
}
]
}
}
AttributesDescription
from_date     String    Not null
ISO 8601 date
Lower bound of the billing period
to_date     String    Not null
ISO 8601 date
Upper bound of the billing period
issuing_date     String    Not null
ISO 8601 date
Date of creation of the invoice
amount_cents     Integer     Not nullAmount in cents, VAT (tax) excluded
amount_currency     String    Not nullCurrency of the amount
total_amount_cents     Integer     Not nullShould be the sum of the amount and the VAT amount
total_amount_currency     String    Not nullCurrency of the total amount
vat_amount_cents     Integer     Not nullVAT amount in cents
vat_amount_currency     String    Not nullCurrency of the VAT amount
charges_usage     Array    Not nullArray of charge usage objects

Charge Usage object

AttributesDescription
units     String     Not nullNumber of units consumed by the customer
amount_cents     Integer     Not nullAmount in cents, VAT (tax) excluded
amount_currency     String    Not nullCurrency of the amount
charge     JSON     Not nullRelated charge object
billable_metric     JSON     Not nullRelated billable metric object
groups     Array     Not nullArray of group objects

Charge object

AttributesDescription
lago_id     String     Not nullID of the charge in the Lago application
charge_model     String     Not nullModel of pricing applied by the charge.
See charge documentation for possible values

Billable Metric object

AttributesDescription
lago_id     String     Not nullID of the billable metric in the Lago application
name     String     Not nullName of the billable metric
code     String     Not nullCode of the billable metric
aggregation_type     String     Not nullAggregation type of the billable metric
See billable metric documentation for possible values

Group object

AttributesDescription
lago_id     String     Not nullID of the group in the Lago application
key     StringGroup key, only defined if two dimensions
value     String     Not nullGroup value
units     String     Not nullNumber of units consumed by the customer for the group
amount_cents     Integer     Not nullAmount in cents for the group, VAT (tax) excluded