Override a fixed charge for a subscription
Changed onThis endpoint creates or updates a fixed charge override for a subscription, without affecting the original plan fixed charge. When the body contains only units (and optionally apply_units_immediately), the change is recorded as a per-subscription unit override. When the body also sets invoice_display_name, properties, or tax_codes, it is applied as a full plan override for the subscription instead. With apply_units_immediately: true on a pay-in-advance fixed charge the change is billed mid-period; otherwise it takes effect at the next billing period. This is a premium feature.
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
Filter by subscription status. When provided, the subscription is looked up with this status instead of the default active status. Possible values are pending, active, terminated, canceled, or incomplete.
Request body
Example request
{
"fixed_charge": {
"invoice_display_name": "Setup Fee",
"units": "1.0",
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"to_value": 10,
"rate": "1",
"flat_amount": "10"
}
],
"amount": "30",
"free_units": 100,
"package_size": 1000,
"rate": "1",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500",
"per_transaction_max_amount": "3.75",
"per_transaction_min_amount": "1.75",
"volume_ranges": [
{
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"tax_codes": [
"french_standard_vat"
]
}
}Response
Fixed charge override created or updated
Example response
{
"fixed_charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_add_on_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"invoice_display_name": "Setup fee",
"add_on_code": "setup_fee",
"created_at": "2023-06-27T19:43:42Z",
"code": "setup_fee",
"charge_model": "standard",
"properties": {
"amount": "30",
"graduated_ranges": [
{
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"volume_ranges": [
{
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"units": "1.0",
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"description": "French standard VAT",
"rate": 20,
"applied_to_organization": true,
"applied_to_billing_entities_codes": [
"acme_corp",
"foo_bar"
],
"created_at": "2023-07-06T14:35:58Z"
}
]
}
}Changes
- breaking
the response property
/became nullable for the status - breaking
the
/response's property type changed fromnumbertostringfor status - info
added the new enum value
incompleteto thequeryrequest parametersubscription_status - info
added the optional property
///to the response with the status - info
the response property
///became required for the status
- breaking