/businesses/{bid}/documents/{id}/issueIssue a document
POST /businesses/{bid}/documents/{id}/issue
Requires the documents scope.
The point of no return. Assigns the next gapless number, freezes a full snapshot, renders the PDF and signs it.
Totals are recomputed server-side from the frozen lines, so what comes back is authoritative. Issuing twice is safe and returns the same document with deduped: true. If rendering hiccups the document is still legally issued and prints answers pdf_pending until a background retry finishes; numbering never rolls back.
Path parameters
| Name | Type | Description | |
|---|---|---|---|
bid | string | required | Business id, from POST /businesses. |
id | string | required | Document id. |
Body (optional)
| Field | Type | Description | |
|---|---|---|---|
branding | Branding | Appearance of the rendered PDF. Stored once per business; a logo is stored as a file and referenced by hash, never re-frozen into each document. |
Response
201: { "ok": true, … }
| Field | Type | Description | |
|---|---|---|---|
ok | boolean | required | |
document | Document | required | A draft is freely mutable. An issued document is immutable forever, blocked at the database engine, not merely in application code. |
deduped | boolean | true when the document was already issued and this call changed nothing. | |
warnings | array of string | Issued, with something to know: allocation_missing, check_details_missing, unsigned (every sandbox document), pdf_pending. |
Errors: 400, 401, 403, 404, 409, 422, 429. Every failure answers { "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }: branch on reason, and read hint for what to change (https://docs.billos.co.il/errors.md).