subscriptions
List all subscriptions
This endpoint retrieves all active subscriptions.
get/subscriptions
Query parameters
pageinteger
Example:1
Page number.
per_pageinteger
Example:20
Number of records per page.
currencystring
Example:EUR
Filter the results by currency, expressed as an ISO 4217 code.
external_customer_idstring
Example:5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba
The customer external unique identifier (provided by your own application)
plan_codestring
Example:premium
The unique code representing the plan to be attached to the customer. This code must correspond to the code property of one of the active plans.
status[]string[]
If the field is not defined, Lago will return only active subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: pending, canceled, terminated, active.
[ "active", "pending" ]
billing_entity_codes[]string[]
Filter subscriptions by billing entity codes.
[ "billing_entity_code_1", "billing_entity_code_2" ]
Response
List of subscriptions
Example response
{
"subscriptions": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"lago_customer_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"billing_entity_code": "default",
"billing_time": "anniversary",
"name": "Repository A",
"plan_code": "premium",
"plan_amount_cents": 10000,
"plan_amount_currency": "USD",
"status": "active",
"created_at": "2022-08-08T00:00:00Z",
"canceled_at": "2022-09-14T16:35:31Z",
"started_at": "2022-08-08T00:00:00Z",
"ending_at": "2022-10-08T00:00:00Z",
"subscription_at": "2022-08-08T00:00:00Z",
"terminated_at": "2022-09-14T16:35:31Z",
"downgrade_plan_date": "2022-04-30",
"trial_ended_at": "2022-08-08T00:00:00Z",
"current_billing_period_started_at": "2022-08-08T00:00:00Z",
"current_billing_period_ending_at": "2022-09-08T00:00:00Z",
"on_termination_credit_note": "credit",
"on_termination_invoice": "generate",
"applied_invoice_custom_sections": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z",
"invoice_custom_section_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"invoice_custom_section": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"name": "EU Bank Details",
"code": "eu_bank_details",
"description": "This section contains the bank details for EU customers.",
"details": "Bank Name: Lago Bank, IBAN: FR7630004000031234567890143",
"display_name": "Bank Details:",
"applied_to_organization": true,
"organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"created_at": "2023-07-06T14:35:58Z"
}
}
],
"payment_method": {
"payment_method_type": "provider",
"payment_method_id": "1a901a90-1a90-1a90-1a90-1a901a901a90"
},
"consolidate_invoice": true,
"cancellation_reason": "payment_failed",
"activated_at": "2022-08-08T00:00:00Z",
"activation_rules": [
{
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"type": "payment",
"timeout_hours": 48,
"status": "pending",
"expires_at": "2022-08-10T00:00:00Z",
"created_at": "2022-08-08T00:00:00Z",
"updated_at": "2022-08-08T00:00:00Z"
}
]
}
],
"meta": {
"current_page": 2,
"next_page": 3,
"prev_page": 1,
"total_pages": 4,
"total_count": 70
}
}