BillOS v1
Console llms.txt OpenAPI
POST/businesses/{bid}/documents/{id}/issue

Issue 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

NameTypeDescription
bidstringrequiredBusiness id, from POST /businesses.
idstringrequiredDocument id.

Body (optional)

FieldTypeDescription
brandingBrandingAppearance 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, … }

FieldTypeDescription
okbooleanrequired
documentDocumentrequiredA draft is freely mutable. An issued document is immutable forever, blocked at the database engine, not merely in application code.
dedupedbooleantrue when the document was already issued and this call changed nothing.
warningsarray of stringIssued, 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).

POST /businesses/{bid}/documents/{id}/issue
curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/issue" \
  -H "X-Api-Key: $KEY"
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/issue`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/documents/{DOC_ID}/issue",
    headers={"X-Api-Key": KEY},
)
data = res.json()
Set BASE to https://api.billos.co.il/v1 and KEY to your bk_live_… key, or a bk_test_… key to run it against the sandbox.
Manage your businesses, keys and webhooks in the BillOS Console.