curl --request PUT \
--url https://api.getlago.com/api/v1/subscriptions/{external_id}/lifetime_usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lifetime_usage": {
"external_historical_usage_amount_cents": 100
}
}
'{
"lifetime_usage": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_subscription_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_subscription_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"external_historical_usage_amount_cents": 100,
"invoiced_usage_amount_cents": 100,
"current_usage_amount_cents": 100,
"from_datetime": "2024-01-01T00:00:00Z",
"to_datetime": "2024-12-31T23:59:59Z",
"usage_thresholds": [
{
"amount_cents": 100,
"completion_ratio": 0.5,
"reached_at": "2024-01-01T00:00:00Z"
}
]
}
}This endpoint allows you to update the total lifetime usage of a subscription for migration purposes.
curl --request PUT \
--url https://api.getlago.com/api/v1/subscriptions/{external_id}/lifetime_usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"lifetime_usage": {
"external_historical_usage_amount_cents": 100
}
}
'{
"lifetime_usage": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_subscription_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_subscription_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"external_historical_usage_amount_cents": 100,
"invoiced_usage_amount_cents": 100,
"current_usage_amount_cents": 100,
"from_datetime": "2024-01-01T00:00:00Z",
"to_datetime": "2024-12-31T23:59:59Z",
"usage_thresholds": [
{
"amount_cents": 100,
"completion_ratio": 0.5,
"reached_at": "2024-01-01T00:00:00Z"
}
]
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
External ID of the existing subscription
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
Update the lifetime usage of a subscription
Subscription lifetime usage updated
Show child attributes
Unique identifier assigned to the lifetime usage record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the lifetime usage record within the Lago system
"1a901a90-1a90-1a90-1a90-1a901a901a90"
Unique identifier assigned to the subscription record within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the subscription record within the Lago system
"1a901a90-1a90-1a90-1a90-1a901a901a90"
The subscription external unique identifier (provided by your own application).
"5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
The historical usage amount in cents for the subscription (provided by your own application).
100
The total invoiced usage amount in cents for the subscription.
100
The current usage amount in cents for the subscription on the current billing period.
100
The recording start date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
"2024-01-01T00:00:00Z"
The recording end date and time of the subscription lifetime usage. The date and time must be in ISO 8601 format.
"2024-12-31T23:59:59Z"
Array of usage thresholds attached to the subscription's plan.
Show child attributes
The usage threshold amount in cents.
100
The completion ratio of the usage threshold.
0.5
The date and time when the usage threshold was reached. The date and time must be in ISO 8601 format.
"2024-01-01T00:00:00Z"