askledgerDocs
REST-APIInvoices
Documentatie

List or search invoices

GET
/ledgers/{ledgerId}/invoices

Find sales and/or purchase invoices by description, contact, number or reference, and/or filter by type, date range, amount, contact, status and journal. Without query, results are sorted by invoice date (newest first) with a total count. Each invoice includes its lines (item, quantity, unit price, amount excl. VAT, VAT, ledger account).

Requires the ledger:read scope (Lezen). Same operation as the MCP tool search-invoices.

Authorization

bearer
headerAuthorizationBearer <token>

A company group API key (al_live_…, created at /dashboard/api), an OAuth access token from the same authorization flow MCP clients use, or (other LedgerSuite products, /administrations routes only) a LedgerSuite client_credentials token.

Path Parameters

ledgerId*string

Ledger (administration) id, from list-ledgers

Length1 <= length

Query Parameters

query?string

Free-text search (fuzzy + full-text), ranked best first without total or cursor. Omit to page through all records

Length1 <= length
type?string

sales or purchase; omit for both

Value in"sales""purchase"
status?string

Processing status in the package

Value in"draft""pending""posted""rejected""unknown"
contact?string

Contact id (con_…) or part of the contact name

journalCode?string

Journal code

issuedFrom?string

Invoice date from (YYYY-MM-DD, inclusive)

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
issuedTo?string

Invoice date to (YYYY-MM-DD, inclusive)

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
Formatdate
minAmount?number

Minimum total in the ledger's base currency

maxAmount?number

Maximum total in the ledger's base currency

includeLines?boolean

Include invoice lines (default true)

limit?integer

Max results (default 20; max 50 with query, 100 without)

Range1 <= value <= 100
cursor?string

nextCursor of the previous page

Length1 <= length
modifiedSince?string

Only records that changed in AskLedger at or after this moment (ISO 8601), oldest change first. Use the previous call's time to sync incrementally

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
Formatdate-time
includeDeleted?boolean

Include records deleted in the accounting package (default false)

Response Body

OK

application/json
  1. response
items*array<>
total*|

Total matching records; null for a free-text search, which ranks instead of counting

nextCursor*|

Pass as cursor to get the next page; null on the last page

curl -X GET "https://example.com/ledgers/string/invoices"
{  "items": [    {      "id": "string",      "remoteId": "string",      "type": "sales",      "documentType": "invoice",      "status": "draft",      "number": "string",      "contactId": "string",      "contactName": "string",      "issueDate": "string",      "dueDate": "string",      "currency": "string",      "totalAmount": 0,      "totalAmountBase": 0,      "reference": "string",      "description": "string",      "journalCode": "string",      "paymentTermCode": "string",      "remoteStatus": "string",      "remoteType": "string",      "remoteUpdatedAt": "string",      "updatedAt": "string",      "deletedAt": "string",      "lines": [        {          "id": "string",          "invoiceId": "string",          "lineNumber": -9007199254740991,          "description": "string",          "itemId": "string",          "itemCode": "string",          "quantity": 0,          "unitCode": "string",          "unitPrice": 0,          "discount": 0,          "netAmount": 0,          "netAmountBase": 0,          "taxRateCode": "string",          "taxCategory": "nl_high",          "taxRate": 0,          "taxAmount": 0,          "taxAmountBase": 0,          "ledgerAccountId": "string",          "ledgerAccountCode": "string",          "costCenter": "string",          "costUnit": "string",          "projectCode": "string"        }      ]    }  ],  "total": 0,  "nextCursor": "string"}