PUT
/
subscriptions
/
{external_id}
/
lifetime_usage
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"
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

external_id
string
required

External ID of the existing subscription

Body

application/json
Update the lifetime usage of a subscription
lifetime_usage
object
required

Response

200
application/json
Subscription lifetime usage updated
lifetime_usage
object
required