Skip to main content

Invoice object

Lago automatically generates invoices for each of your customers at the end of a billing period (monthly or yearly depending on the plan assigned to the customers).

They list and summarize the fees generated by Lago for your customers, based on the subscription and metrics notifications setuped in your Lago workspace.

Invoice object

{
"webhook_type": "invoice.created",
"object_type": "invoice",
"invoice": {
"lago_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"sequential_id": 2,
"number": "LAG-1234-001-002",
"issuing_date": "2022-04-30",
"status": "succeeded",
"amount_cents": 100,
"amount_currency": "EUR",
"vat_amount_cents": 20,
"vat_amount_currency": "EUR",
"total_amount_cents": 120,
"total_amount_currency": "EUR",
"file_url": "https://getlago.com/invoice/file",
"customer": {
"lago_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"external_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"address_line1": "5230 Penfield Ave",
"address_line2": null,
"city": "Woodland Hills",
"country": "US",
"created_at": "2022-04-29T08:59:51Z",
"email": "dinesh@piedpiper.test",
"legal_name": "Coleman-Blair",
"legal_number": "49-008-2965",
"logo_url": "http://hooli.com/logo.png",
"name": "Gavin Belson",
"phone": "1-171-883-3711 x245",
"state": "CA",
"url": "http://hooli.com",
"vat_rate": 20.0,
"zipcode": "91364"
},
"subscriptions": [
{
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
"external_id": "susbcription_external_id",
"lago_customer_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
"canceled_at": "2022-04-29T08:59:51Z",
"created_at": "2022-04-29T08:59:51Z",
"plan_code": "new_code",
"started_at": "2022-04-29T08:59:51Z",
"status": "active",
"terminated_at": null
}
],
"fees": [
{
"lago_id": "6be23c42-47d2-45a3-9770-5b3572f225c3",
"lago_group_id": null,
"item": {
"type": "subscription",
"code": "plan_code",
"name": "Plan"
},
"amount_cents": 100,
"amount_currency": "EUR",
"vat_amount_cents": 20,
"vat_amount_currency": "EUR",
"units": "0.32",
"events_count": 23
}
]
},
"credits": [
{
"item": {
"type": "coupon",
"code": "coupon_code",
"name": "Coupon",
},
"amount_cents": 100,
"amount_currency": "EUR"
}
]
}
AttributesDescription
lago_id     String     Not nullUnique identifer of the invoice in Lago application
sequential_id     Integer     Not nullInvoice sequential id scoped on the customer
number     String     Not nullInvoice unique number
charges_from_date     String    Not null
ISO 8601 date
Lower bound of the billing period for charges
issuing_date     String    Not null
ISO 8601 date
Date of creation of the invoice
status     String     Not null
Status of the invoice.
Possible values
- pending: Waiting for payment in Stripe or when invoice is emitted but users have not updated the status through the endpoint
- succeeded
- failed
amount_cents     Integer     Not nullAmount in cents, VAT (tax) excluded
amount_currency     String    Not nullCurrency of the amount
vat_amount_cents     Integer     Not nullVat amount in cents
vat_amount_currency     String    Not nullCurrency of the VAT amount
total_amount_cents     Integer     Not nullShould be the sum of the amount and the VAT amount
total_amount_currency     String    Not nullCurrency of the total amount
file_url     String  File url of the invoice PDF
customer     JSON    Not nullCustomer object. Billed customer
subscriptions     JSON    Not nullArray of Subscription objects (billed subscriptions)
fees     JSON    Not nullArray of fee objects
credits     JSON    Not nullArray of credit objects

Fee object

{
"lago_id": "6be23c42-47d2-45a3-9770-5b3572f225c3",
"lago_group_id": "5b4881e3-b451-472e-9e03-d99379550743",
"item": {
"type": "subscription",
"code": "plan_code",
"name": "Plan"
},
"amount_cents": 100,
"amount_currency": "EUR",
"vat_amount_cents": 20,
"vat_amount_currency": "EUR"
"units": "0.32",
"events_count": 23
}
AttributesDescription
lago_id     String     Not nullUnique identifer of the fee in Lago application
lago_group_id     StringUnique identifer of the group in Lago application
item     JSON     Not nullItem attached to the fee.
Always have 3 attributes:
- type: charge or subscription
- code: Code of the plan or of the billable metric attached to the fee.
- name: Name of the plan of of the billable metric attached to the fee
amount_cents     Integer     Not nullAmount in cents of the fee, VAT excluded
amount_currency     String     Not nullCurrency of the amount
vat_amount_cents     Integer     Not nullVAT amount in cents
vat_amount_currency     String     Not nullCurrency of the VAT amount
units     String (Decimal)     Not nullUnits used to charge the customer
events_count     IntegerNumber of events

Credit object

{
"item": {
"type": "coupon",
"code": "coupon_code",
"name": "Coupon",
},
"amount_cents": 100,
"amount_currency": "EUR"
}
AttributesDescription
item     JSON     Not nullItem attached to the credit.
Always have 3 attributes:
- type: coupon
- code: Code of the coupon attached to the credit.
- name: Name of the coupon attached to the credit
amount_cents     Integer     Not nullAmount in cents of the credit
amount_currency     String     Not nullCurrency of the amount