HTTP API reference
Invoices
List, fetch, patch, and delete saved invoice rows and structured `parsed_data` for your account.
Endpoints in this topic
GET/api/invoices
Paginated list of stored invoices for the authenticated user.
GET — query: page (≥1, default 1), limit (1–200, default 20), kind=expense|revenue, from / to (YYYY-MM-DD on parsed document date), q (search, max 200 chars; counterparty / invoice # / raw text).
{
invoices[], page, limit, total, totalPages
}
Each invoice: id, createdAt, invoiceKind, provider,
invoiceNumber, documentDate, total, currency, fileUrl, mimeType.GET/api/invoices/[id]
Fetch one invoice by id (path param).
Path segment [id] = invoice UUID.
{
invoice: {
id, createdAt, invoiceKind, provider, invoiceNumber,
documentDate, total, currency, fileUrl, mimeType, rawText?
}
}PATCH/api/invoices/[id]
Update invoice_kind and/or parsed_data fields.
Content-Type: application/json
{
"invoice_kind": "expense" | "revenue",
"parsed_data": { partial InvoiceExtract }
}
(both fields optional; parsed_data merges into existing parsed_data then re-validates){
invoice: { …same shape as GET /api/invoices/[id] … }
}DELETE/api/invoices/[id]
Delete a stored invoice.
Path segment [id] = invoice UUID.
200 { ok: true }. 404 with error JSON if the row is missing.