subscriptions
Retrieve a charge for a subscription
Changed onThis endpoint retrieves a specific effective charge for a subscription. If the subscription has a plan override with a charge override, the overridden charge is returned.
get/subscriptions/{external_id}/charges/{charge_code}
Request
- Base URLhttps://api.getlago.com/api/v1
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
subscription_status'pending' | 'active' | 'terminated' | 'canceled' | 'incomplete'
Example:active
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.
Response
Charge
Example response
{
"charge": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_billable_metric_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"code": "api_requests_charge",
"billable_metric_code": "requests",
"invoice_display_name": "Setup",
"created_at": "2022-09-14T16:35:31Z",
"pay_in_advance": true,
"invoiceable": true,
"regroup_paid_fees": "invoice",
"min_amount_cents": 1200,
"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"
}
],
"presentation_group_keys": [
{
"value": "region",
"options": {
"display_in_invoice": true
}
}
]
},
"filters": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"charge_code": "api_requests_charge",
"invoice_display_name": "AWS",
"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"
}
]
},
"values": {
"region": [
"us-east-1"
]
}
}
],
"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"
}
],
"applied_pricing_unit": {
"code": "unit_code",
"conversion_rate": "0.5"
},
"lago_parent_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
}
}Changes
- info
added the new enum value
incompleteto thequeryrequest parametersubscription_status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
added the optional property
///to the response with the status - info
the response property
///became required for the status
- info