Copy
Ask AI
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request PUT "$LAGO_URL/api/v1/plans/__plan_code__" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"plan": {
"name": "Startup Premium",
"code": "startup",
"interval": "monthly",
"description": null,
"amount_cents": 1000,
"amount_currency": "USD",
"trial_period": 10,
"pay_in_advance": true,
"bill_charges_monthly": null,
"tax_codes": ["french_standard_vat"],
"invoice_display_name": "",
"minimum_commitment": {
"amount_cents": 100000,
"invoice_display_name": "Minimum Commitment (C1)",
"taxes": []
},
"charges": [
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "graduated",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"invoice_display_name": "My new charge display name",
"properties": {
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10000,
"per_unit_amount": "0.02",
"flat_amount": "50"
},
{
"from_value": 10001,
"to_value": null,
"per_unit_amount": "0.01",
"flat_amount": "100"
}
]
},
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "package",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"invoice_display_name": "",
"properties": {
"amount": "30",
"free_units": 1000,
"package_size": 10000
},
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "percentage",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"invoice_display_name": "",
"properties": {
"rate": "0.15",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500",
"per_transaction_min_amount": "1.75",
"per_transaction_max_amount": "2"
},
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "standard",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"invoice_display_name": "",
"properties": {
"amount": "10"
},
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "volume",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"invoice_display_name": "",
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 1000,
"per_unit_amount": "0.75",
"flat_amount": "0"
},
{
"from_value": 1001,
"to_value": null,
"per_unit_amount": "0.50",
"flat_amount": "0"
}
]
},
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "graduated",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"graduated_ranges": [
{
"from_value": 0,
"to_value": null,
"per_unit_amount": "0",
"flat_amount": "0"
}
]
},
"filters": [
{
"values": {
"cloud": ["aws"],
"region": ["us-east-1"]
},
"properties": {
"graduated_ranges": [
{
"from_value": 0,
"to_value": 20000,
"per_unit_amount": "0.02",
"flat_amount": "50"
},
{
"from_value": 20001,
"to_value": null,
"per_unit_amount": "0.01",
"flat_amount": "100"
}
]
}
}
],
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "package",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"amount": "0",
"free_units": 0,
"package_size": 1
},
"filters": [
{
"values": {
"cloud": ["aws"],
"region": ["us-east-1"]
},
"properties": {
"amount": "30",
"free_units": 1000,
"package_size": 10000
}
}
],
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "percentage",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"rate": "0"
},
"filters": [
{
"values": {
"cloud": ["aws"],
"region": ["us-east-1"]
},
"properties": {
"rate": "0.15",
"fixed_amount": "0.5",
"free_units_per_events": 5,
"free_units_per_total_aggregation": "500",
"per_transaction_min_amount": "1.75",
"per_transaction_max_amount": "2"
}
}
],
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "standard",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"amount": "0"
},
"filters": [
{
"values": {
"cloud": ["aws"],
"region": ["us-east-1"]
},
"properties": {
"amount": "15"
}
}
],
"tax_codes": []
},
{
"id": "__CHARGE_ID__",
"billable_metric_id": "__BILLABLE_METRIC_ID__",
"charge_model": "volume",
"invoiceable": true,
"pay_in_advance": false,
"prorated": false,
"min_amount_cents": 0,
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": null,
"per_unit_amount": "0",
"flat_amount": "0"
}
]
},
"filters": [
{
"values": {
"cloud": ["aws"],
"region": ["us-east-1"]
},
"properties": {
"volume_ranges": [
{
"from_value": 0,
"to_value": 2000,
"per_unit_amount": "0.75",
"flat_amount": "0"
},
{
"from_value": 2001,
"to_value": null,
"per_unit_amount": "0.50",
"flat_amount": "0"
}
]
}
}
],
"tax_codes": []
}
]
}
}
'
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
Show child attributes
Show child attributes
Response
Plan updated
Show child attributes
Show child attributes