Concepts
This page summarizes concepts that apply across the API: company scope, document types, and the typical document flow (draft → confirm → cancel).
Company scope
The API always operates in the context of a company. All data (documents, products, business partners, inventory, etc.) belongs to a specific company.
- With web session: the company is determined by the user's session (and, if the app supports it, the company selector).
- With API key: the company is fixed by the key: every request made with that key is associated with the company for which the key was created. You must not specify another company’s context in the body or query string on each call.
This prevents accidentally accessing another company's data when using keys.
Document types
Documents (invoices, quotes, credit notes, etc.) have a type code (type). Some typical examples:
| Code | Typical use |
|---|---|
| 01 | Invoice (consumer or taxpayer) |
| 03 | Credit note |
| 04 | Debit note |
| Quote | Depends on configuration (sometimes without numeric code) |
Exact values may vary by country and your company's configuration. In list and filter APIs, the type field is used to filter by document type. Check the API response or the Documents reference for the codes available in your case.
Document flow
The typical document lifecycle is:
- Draft: created with
POST /documents(or updated withPUT /documents/:id). The document can be edited and usually does not yet have final tax validity or final number. - Confirm: when the document is ready, send
POST /documents/:id/confirm. After this, a final number is usually assigned and the document is considered issued; it may be non-editable depending on regulations. - Cancel (if applicable): to void a confirmed document, use
POST /documents/:id/cancel. Not all types support cancellation; it depends on configuration and regulations.
In short: create/edit as draft → confirm → optionally cancel. For route and parameter details, see Documents.