Ledgerly API reference
Version 1. Read-only JSON API for invoices and customers.
Overview
Base URL: https://browser-use-test-website.preciousta.dev/api/v1
Authentication
Create an API key under Settings, Developer and send it as a bearer token on every request:
Authorization: Bearer ldg_live_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Keys carry scopes: invoices:read, customers:read and invoices:write (reserved, no write endpoints yet). A key can only call endpoints its scopes allow. Revoked keys stop working immediately.
In n8n, use an HTTP Request node with a Header Auth credential: name Authorization, value Bearer <key>.
Errors
Errors use the same JSON shape and a matching HTTP status.
| Status | Code | Meaning |
|---|---|---|
| 401 | invalid_api_key | The key is missing, wrong or revoked. The response has a WWW-Authenticate: Bearer header. |
| 403 | insufficient_scope | The key lacks the required scope. The body includes required_scope. |
| 404 | not_found | The invoice or customer does not exist. |
{
"error": {
"code": "insufficient_scope",
"message": "This key needs the invoices:read scope.",
"required_scope": "invoices:read"
}
}Pagination
List endpoints for invoices take page and per_page and return page, per_page and total beside data. Keep requesting pages until page * per_page reaches total. Customers are returned in one response.
Endpoints
GET /api/v1/me
Returns the owner and scopes of the key. Use it to test a credential.
Required scope: any valid key
Example request
curl https://browser-use-test-website.preciousta.dev/api/v1/me \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"email": "alice@ledgerly.test",
"key_name": "n8n integration",
"scopes": [
"invoices:read",
"customers:read"
],
"workspace": "Ledgerly Demo Workspace"
}GET /api/v1/invoices
Lists invoices, newest first, with pagination.
Required scope: invoices:read
| Query parameter | Description |
|---|---|
status | Comma separated: draft, sent, paid, overdue. |
from | Issue date on or after (YYYY-MM-DD). |
to | Issue date on or before (YYYY-MM-DD). |
customer_id | Only invoices of this customer, for example c1. |
sort | number, customer, date, amount, status or currency. Default date. |
dir | asc or desc. Default desc. |
page | Page number, starting at 1. |
per_page | Page size, 1 to 100. Default 20. |
Example request
curl https://browser-use-test-website.preciousta.dev/api/v1/invoices \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"data": [
{
"id": "INV-1080",
"number": "INV-1080",
"customer": {
"id": "c4",
"name": "Blue Heron Clinics"
},
"issue_date": "2026-10-03",
"due_date": "2026-10-17",
"paid_date": null,
"currency": "EUR",
"status": "sent",
"subtotal": 480,
"tax": 96,
"total": 576
}
],
"page": 1,
"per_page": 20,
"total": 80
}GET /api/v1/invoices/{id}
Returns one invoice with line items. The id is the invoice number, for example INV-1001.
Required scope: invoices:read
Example request
curl https://browser-use-test-website.preciousta.dev/api/v1/invoices/INV-1001 \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "INV-1001",
"number": "INV-1001",
"customer": {
"id": "c1",
"name": "Northwind Bakery"
},
"issue_date": "2026-01-05",
"due_date": "2026-01-19",
"paid_date": "2026-01-12",
"currency": "USD",
"status": "paid",
"subtotal": 300,
"tax": 24,
"total": 324,
"tax_rate": 0.08,
"note": "",
"line_items": [
{
"description": "Consulting hours",
"quantity": 2,
"unit_price": 150,
"amount": 300
}
]
}GET /api/v1/customers
Lists customers.
Required scope: customers:read
| Query parameter | Description |
|---|---|
q | Case-insensitive match on name or email. |
Example request
curl https://browser-use-test-website.preciousta.dev/api/v1/customers \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"data": [
{
"id": "c1",
"name": "Northwind Bakery",
"contact": "Maria Lopez",
"email": "maria@northwind-bakery.example",
"phone": "+1 555 0110",
"address": "12 Market St, Berlin",
"currency": "USD"
}
],
"total": 14
}GET /api/v1/customers/{id}
Returns one customer, for example c1.
Required scope: customers:read
Example request
curl https://browser-use-test-website.preciousta.dev/api/v1/customers/c1 \
-H "Authorization: Bearer YOUR_API_KEY"Example response
{
"id": "c1",
"name": "Northwind Bakery",
"contact": "Maria Lopez",
"email": "maria@northwind-bakery.example",
"phone": "+1 555 0110",
"address": "12 Market St, Berlin",
"currency": "USD"
}