Skip to main content

Invoices

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,
"from_date": "2022-04-01",
"to_date": "2022-04-30",
"charges_from_date": "2022-04-01",
"issuing_date": "",
"amount_cents": 100,
"amount_currency": "EUR",
"vat_amount_cents": 20,
"vat_amount_currency": "EUR",
"total_amount_cents": 120,
"total_amount_currency": "EUR",
"customer": {
"lago_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"customer_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"
},
"subscription": {
"lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
"lago_customer_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
"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": [
{
"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"
}
]
},
"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 unique number
from_date     String    Not null
ISO 8601 date
Lower bound of the billing period
to_date     String    Not null
ISO 8601 date
Upper bound of the billing period
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
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
customer     JSON    Not nullCustomer object. Billed customer
subscription     JSON    Not nullSubscription object. Billed subscription
fees     JSON    Not nullArray of fee objects
credits     JSON    Not nullArray of credit objects

Fee object

{
"item": {
"type": "subscription",
"code": "plan_code",
"name": "Plan"
},
"amount_cents": 100,
"amount_currency": "EUR",
"vat_amount_cents": 20,
"vat_amount_currency": "EUR"
}
AttributesDescription
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     Srting (Decimal)     Not nullUnits used to charge the customer

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