Plans
Update a plan
API Reference
- Getting started
- Add-ons
- Analytics
- Billable metrics
- Coupons
- Credit notes
- Customer usage
- Customers
- Events
- Fees
- Invoices
- Organizations
- Payments
- Payment receipts
- Payment requests
- Plans
- Resources
- Subscriptions
- Taxes
- Wallets
- Webhook endpoints
- Webhooks
Plans
Update a plan
This endpoint updates a specific plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
PUT
/
plans
/
{code}
curl --request PUT \
--url https://api.getlago.com/api/v1/plans/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"plan": {
"name": "Startup",
"invoice_display_name": "Startup plan",
"code": "startup",
"interval": "monthly",
"description": "Plan for early stage startups.",
"amount_cents": 10000,
"amount_currency": "USD",
"trial_period": 5,
"pay_in_advance": true,
"bill_charges_monthly": null,
"tax_codes": [
"french_standard_vat"
],
"minimum_commitment": {
"amount_cents": 100000,
"invoice_display_name": "Minimum Commitment (C1)",
"tax_codes": [
"french_standard_vat"
]
},
"charges": [
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"charge_model": "package",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 3000,
"properties": {
"amount": "30",
"free_units": 100,
"package_size": 1000
},
"tax_codes": [
"french_standard_vat"
]
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"charge_model": "graduated",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"graduated_ranges": [
{
"to_value": 10,
"from_value": 0,
"flat_amount": "10",
"per_unit_amount": "0.5"
},
{
"to_value": null,
"from_value": 11,
"flat_amount": "0",
"per_unit_amount": "0.4"
}
]
}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"charge_model": "standard",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": null,
"prorated": false,
"min_amount_cents": 0,
"properties": {}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"charge_model": "volume",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"charge_model": "percentage",
"invoiceable": false,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 0,
"properties": {
"rate": "1",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500"
}
}
],
"usage_thresholds": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"threshold_display_name": "Threshold 1",
"amount_cents": 10000,
"recurring": true
}
],
"cascade_updates": true
}
}'
{
"plan": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Startup",
"invoice_display_name": "Startup plan",
"created_at": "2023-06-27T19:43:42Z",
"code": "startup",
"interval": "monthly",
"description": "",
"amount_cents": 10000,
"amount_currency": "USD",
"trial_period": 5,
"pay_in_advance": true,
"bill_charges_monthly": null,
"minimum_commitment": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"plan_code": "premium",
"amount_cents": 100000,
"invoice_display_name": "Minimum Commitment (C1)",
"interval": "monthly",
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"description": "French standard VAT",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z"
}
]
},
"charges": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"billable_metric_code": "requests",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "package",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"regroup_paid_fees": null,
"prorated": false,
"min_amount_cents": 3000,
"properties": {
"amount": "30",
"free_units": 100,
"package_size": 1000
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"billable_metric_code": "cpu",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "graduated",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
},
{
"from_value": 11,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.4"
}
]
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"billable_metric_code": "seats",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "standard",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"prorated": false,
"min_amount_cents": 0,
"properties": {},
"filters": [
{
"invoice_display_name": "Europe",
"properties": {
"amount": "10"
},
"values": {
"region": [
"Europe"
]
}
},
{
"invoice_display_name": "USA",
"properties": {
"amount": "5"
},
"values": {
"region": [
"USA"
]
}
},
{
"invoice_display_name": "Africa",
"properties": {
"amount": "8"
},
"values": {
"region": [
"Africa"
]
}
}
]
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"billable_metric_code": "storage",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "volume",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"billable_metric_code": "payments",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "percentage",
"invoiceable": false,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 0,
"properties": {
"rate": "1",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500"
},
"filters": []
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"description": "French standard VAT",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z"
}
],
"usage_thresholds": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"threshold_display_name": "Threshold 1",
"amount_cents": 10000,
"recurring": true,
"created_at": "2023-06-27T19:43:42Z",
"updated_at": "2023-06-27T19:43:42Z"
}
]
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
Example:
"startup"
Body
application/json
Plan payload
The body is of type object
.
Response
200
application/json
Plan updated
The response is of type object
.
Was this page helpful?
curl --request PUT \
--url https://api.getlago.com/api/v1/plans/{code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"plan": {
"name": "Startup",
"invoice_display_name": "Startup plan",
"code": "startup",
"interval": "monthly",
"description": "Plan for early stage startups.",
"amount_cents": 10000,
"amount_currency": "USD",
"trial_period": 5,
"pay_in_advance": true,
"bill_charges_monthly": null,
"tax_codes": [
"french_standard_vat"
],
"minimum_commitment": {
"amount_cents": 100000,
"invoice_display_name": "Minimum Commitment (C1)",
"tax_codes": [
"french_standard_vat"
]
},
"charges": [
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"charge_model": "package",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 3000,
"properties": {
"amount": "30",
"free_units": 100,
"package_size": 1000
},
"tax_codes": [
"french_standard_vat"
]
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"charge_model": "graduated",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"graduated_ranges": [
{
"to_value": 10,
"from_value": 0,
"flat_amount": "10",
"per_unit_amount": "0.5"
},
{
"to_value": null,
"from_value": 11,
"flat_amount": "0",
"per_unit_amount": "0.4"
}
]
}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"charge_model": "standard",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": null,
"prorated": false,
"min_amount_cents": 0,
"properties": {}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"charge_model": "volume",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
}
},
{
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"charge_model": "percentage",
"invoiceable": false,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 0,
"properties": {
"rate": "1",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500"
}
}
],
"usage_thresholds": [
{
"id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"threshold_display_name": "Threshold 1",
"amount_cents": 10000,
"recurring": true
}
],
"cascade_updates": true
}
}'
{
"plan": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "Startup",
"invoice_display_name": "Startup plan",
"created_at": "2023-06-27T19:43:42Z",
"code": "startup",
"interval": "monthly",
"description": "",
"amount_cents": 10000,
"amount_currency": "USD",
"trial_period": 5,
"pay_in_advance": true,
"bill_charges_monthly": null,
"minimum_commitment": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"plan_code": "premium",
"amount_cents": 100000,
"invoice_display_name": "Minimum Commitment (C1)",
"interval": "monthly",
"created_at": "2022-04-29T08:59:51Z",
"updated_at": "2022-04-29T08:59:51Z",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"description": "French standard VAT",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z"
}
]
},
"charges": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a91",
"billable_metric_code": "requests",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "package",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"regroup_paid_fees": null,
"prorated": false,
"min_amount_cents": 3000,
"properties": {
"amount": "30",
"free_units": 100,
"package_size": 1000
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a92",
"billable_metric_code": "cpu",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "graduated",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
},
{
"from_value": 11,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.4"
}
]
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a93",
"billable_metric_code": "seats",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "standard",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"prorated": false,
"min_amount_cents": 0,
"properties": {},
"filters": [
{
"invoice_display_name": "Europe",
"properties": {
"amount": "10"
},
"values": {
"region": [
"Europe"
]
}
},
{
"invoice_display_name": "USA",
"properties": {
"amount": "5"
},
"values": {
"region": [
"USA"
]
}
},
{
"invoice_display_name": "Africa",
"properties": {
"amount": "8"
},
"values": {
"region": [
"Africa"
]
}
}
]
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a94",
"billable_metric_code": "storage",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "volume",
"invoiceable": true,
"invoice_display_name": "Setup",
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 100,
"flat_amount": "0",
"per_unit_amount": "0"
},
{
"from_value": 101,
"to_value": null,
"flat_amount": "0",
"per_unit_amount": "0.5"
}
]
},
"filters": []
},
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a95",
"billable_metric_code": "payments",
"created_at": "2023-06-27T19:43:42Z",
"charge_model": "percentage",
"invoiceable": false,
"invoice_display_name": "Setup",
"pay_in_advance": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 0,
"properties": {
"rate": "1",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500"
},
"filters": []
}
],
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"description": "French standard VAT",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z"
}
],
"usage_thresholds": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"threshold_display_name": "Threshold 1",
"amount_cents": 10000,
"recurring": true,
"created_at": "2023-06-27T19:43:42Z",
"updated_at": "2023-06-27T19:43:42Z"
}
]
}
}