curl --request PUT \
--url https://api.getlago.com/api/v1/plans/{code}/charges/{charge_code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"charge": {
"invoice_display_name": "Setup",
"min_amount_cents": 0,
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"filters": [
{
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"values": {
"region": [
"us-east-1"
]
},
"invoice_display_name": "AWS"
}
],
"tax_codes": [
"french_standard_vat"
],
"applied_pricing_unit": {
"code": "credits",
"conversion_rate": "0.5"
},
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "api_requests_charge",
"charge_model": "dynamic",
"pay_in_advance": false,
"invoiceable": true,
"regroup_paid_fees": null,
"prorated": false,
"cascade_updates": true
}
}
'{
"charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"billable_metric_code": "requests",
"created_at": "2022-09-14T16:35:31Z",
"charge_model": "dynamic",
"pay_in_advance": true,
"invoiceable": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 1200,
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"filters": [
{
"invoice_display_name": "AWS",
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"values": {
"region": [
"us-east-1"
]
}
}
],
"code": "api_requests_charge",
"invoice_display_name": "Setup",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
],
"applied_pricing_unit": {
"code": "unit_code",
"conversion_rate": "0.5"
},
"accepts_target_wallet": false,
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
}This endpoint updates a specific charge for a plan.
curl --request PUT \
--url https://api.getlago.com/api/v1/plans/{code}/charges/{charge_code} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"charge": {
"invoice_display_name": "Setup",
"min_amount_cents": 0,
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"filters": [
{
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"values": {
"region": [
"us-east-1"
]
},
"invoice_display_name": "AWS"
}
],
"tax_codes": [
"french_standard_vat"
],
"applied_pricing_unit": {
"code": "credits",
"conversion_rate": "0.5"
},
"billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "api_requests_charge",
"charge_model": "dynamic",
"pay_in_advance": false,
"invoiceable": true,
"regroup_paid_fees": null,
"prorated": false,
"cascade_updates": true
}
}
'{
"charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"billable_metric_code": "requests",
"created_at": "2022-09-14T16:35:31Z",
"charge_model": "dynamic",
"pay_in_advance": true,
"invoiceable": true,
"regroup_paid_fees": "invoice",
"prorated": false,
"min_amount_cents": 1200,
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"filters": [
{
"invoice_display_name": "AWS",
"properties": {
"grouped_by": [
"agent_name"
],
"pricing_group_keys": [
"agent_name"
],
"graduated_ranges": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
],
"graduated_percentage_ranges": [
{
"from_value": 0,
"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": [
{
"from_value": 0,
"to_value": 10,
"flat_amount": "10",
"per_unit_amount": "0.5"
}
]
},
"values": {
"region": [
"us-east-1"
]
}
}
],
"code": "api_requests_charge",
"invoice_display_name": "Setup",
"taxes": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "TVA",
"code": "french_standard_vat",
"rate": 20,
"applied_to_organization": true,
"created_at": "2023-07-06T14:35:58Z",
"description": "French standard VAT"
}
],
"applied_pricing_unit": {
"code": "unit_code",
"conversion_rate": "0.5"
},
"accepts_target_wallet": false,
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Code of the existing plan.
"startup"
Code of the existing charge.
"api_requests_charge"
Charge payload
Properties of a charge that can be overridden at the subscription level.
Show child attributes
Charge updated
Show child attributes