Get Document Numbering Settings
GET/api/ledger/settings/document-numbering
How NEW sales invoices are numbered on the active accounting connection (Settings → Document Numbering).
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Authentication: Requires Bearer token.
Response fields:
document_numbering.sales_invoice_strategy— one ofsource_reference,system,provider_assigneddocument_numbering.prefix— optional string prepended to the number under thesource_referencestrategy (max 8 chars,A-Z a-z 0-9 - _). Empty string = no prefixdocument_numbering.collision_suffix_enabled— when a source reference is already in use by another document,truedisambiguates it (SO-1001-2);falsefalls back to SKU's own scheme (INV-{id}) for that document. A number always identifies exactly one document either waystrategies[]— the pickable options (value,label,description) for rendering the selectorconnection_id/connection_name— the accounting connection these settings belong to; bothnullwhen none is configured
No accounting connection: returns 200 with the defaults a new connection would get (source_reference, no prefix, collision suffix on) and null connection fields — it does NOT 404. Only the PUT 404s.
Scope: the strategy governs sales invoices only, and only the NEXT document. Bills, credit notes and batch invoices always use SKU's own scheme (they have no single source number to borrow without colliding), and changing the setting never renumbers a document that has already been issued — an issued number is frozen and inherited by every later correction of that document.
Request
Responses
- 200
- 401
- 403
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.