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",
"total_aggregated_units": "1.0",
"events_count": 10,
"amount_cents": 123,
"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",
"total_aggregated_units": "1.0",
"amount_cents": 1000,
"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"
]
}
}
],
"grouped_usage": [
{
"amount_cents": 1000,
"events_count": 10,
"units": "0.9",
"total_aggregated_units": "1.0",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"grouped_by": {},
"filters": [
{
"units": "0.9",
"total_aggregated_units": "1.0",
"amount_cents": 1000,
"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"
]
}
}
]
}
]
}
],
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"currency": "EUR"
}
}Retrieve real-time projected usage data for the current open billing period.
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",
"total_aggregated_units": "1.0",
"events_count": 10,
"amount_cents": 123,
"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",
"total_aggregated_units": "1.0",
"amount_cents": 1000,
"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"
]
}
}
],
"grouped_usage": [
{
"amount_cents": 1000,
"events_count": 10,
"units": "0.9",
"total_aggregated_units": "1.0",
"pricing_unit_details": {
"amount_cents": 200,
"short_name": "CR",
"conversion_rate": "0.5"
},
"grouped_by": {},
"filters": [
{
"units": "0.9",
"total_aggregated_units": "1.0",
"amount_cents": 1000,
"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"
]
}
}
]
}
]
}
],
"lago_invoice_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"currency": "EUR"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The customer external unique identifier (provided by your own application).
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
The unique identifier of the subscription within your application.
"sub_1234567890"
Optional flag to determine if taxes should be applied. Defaults to true if not provided or if null.
true
Customer usage
Show child attributes
The lower bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
"2022-07-01T00:00:00Z"
The upper bound of the billing period, expressed in the ISO 8601 datetime format in Coordinated Universal Time (UTC).
"2022-07-31T23:59:59Z"
The date of creation of the invoice.
"2022-08-01"
The amount in cents, tax excluded.
123
The projected amount in cents, tax excluded.
256
The tax amount in cents.
200
The total amount in cents, tax included.
123
Array of charges that comprise the current usage. It contains detailed information about individual charge items associated with the usage.
Show child attributes
The number of units consumed by the customer for a specific charge item.
"1.0"
The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
"1.0"
The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
10
The amount in cents, tax excluded, consumed by the customer for a specific charge item.
123
The currency of a usage item consumed by the customer.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JPY, KES, KGS, KHR, KMF, KRW, KYD, KZT, LAK, LBP, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SOS, SRD, STD, SZL, THB, TJS, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW "EUR"
Object listing all the properties for a specific charge item.
Show child attributes
Unique identifier assigned to the charge within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the charge's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The pricing model applied to this charge. Possible values are standard, graduated, percentage, package or volume.
standard, graduated, package, percentage, volume "graduated"
Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
"Setup"
The related billable metric object.
Show child attributes
Unique identifier assigned to the billable metric within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the billable metric's record within the Lago system.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The name of the billable metric used for this charge.
"Storage"
The code of the billable metric used for this charge.
"storage"
The aggregation type of the billable metric used for this charge. Possible values are count_agg, sum_agg, max_agg or unique_count_agg.
count_agg, sum_agg, max_agg, unique_count_agg, weighted_sum_agg, latest_agg "sum_agg"
Details about the pricing unit used for charge usage.
Show child attributes
The amount in cents in the pricing unit.
200
The short name of the pricing unit.
"CR"
The conversion rate from pricing units to the plan's currency.
"0.5"
Array of filter object, representing multiple dimensions for a charge item.
Show child attributes
The number of units consumed for a specific charge filter related to a charge item.
"0.9"
The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
"1.0"
The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
1000
The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
10
Specifies the name that will be displayed on an invoice.
"AWS eu-east-1"
Details about the pricing unit used for charge usage.
Show child attributes
The amount in cents in the pricing unit.
200
The short name of the pricing unit.
"CR"
The conversion rate from pricing units to the plan's currency.
"0.5"
Array of aggregated fees, grouped by the event properties defined in a standard charge model.
Show child attributes
The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1000
The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
10
The number of units consumed for a specific group related to a charge item.
"0.9"
The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
"1.0"
Details about the pricing unit used for charge usage.
Show child attributes
The amount in cents in the pricing unit.
200
The short name of the pricing unit.
"CR"
The conversion rate from pricing units to the plan's currency.
"0.5"
Array of filter object, representing multiple dimensions for a charge item.
Show child attributes
The number of units consumed for a specific charge filter related to a charge item.
"0.9"
The total number of units consumed by the customer for a specific charge item, aggregated across all usage events.
"1.0"
The amount in cents, tax excluded, consumed for a specific charge filter related to a charge item.
1000
The quantity of usage events that have been recorded for a particular charge filter during the specified time period. These events may also be referred to as the number of transactions in some contexts.
10
Specifies the name that will be displayed on an invoice.
"AWS eu-east-1"
Details about the pricing unit used for charge usage.
Show child attributes
The amount in cents in the pricing unit.
200
The short name of the pricing unit.
"CR"
The conversion rate from pricing units to the plan's currency.
"0.5"
A unique identifier associated with the invoice related to this particular usage record.
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The currency of the customer's current usage.
AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BIF, BMD, BND, BOB, BRL, BSD, BWP, BYN, BZD, CAD, CDF, CHF, CLF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, ISK, JMD, JPY, KES, KGS, KHR, KMF, KRW, KYD, KZT, LAK, LBP, LKR, LRD, LSL, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SEK, SGD, SHP, SLL, SOS, SRD, STD, SZL, THB, TJS, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW "EUR"
Was this page helpful?