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

Download the PDF

POST /businesses/{bid}/documents/{id}/prints

Requires the documents scope.

Israeli law delivers the origin (מקור) exactly once, per הוראה 18(ב)2. auto is what a download button should send: it serves the origin on the first ever print and a copy forever after, so a repeat click never errors, and the X-Print-Variant header tells you which one you got.

A pdf_pending response never consumes the origin.

Path parameters

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

Body (optional)

FieldTypeDescription
kindstringauto recommended. origin succeeds exactly once per document. copy is watermarked העתק and unlimited. view returns the same העתק for showing on screen and is not counted as a copy handed out. One of: auto, origin, copy, view. Default copy.

Response

200: raw application/pdf bytes.

Response header X-Print-Variant: Which variant these bytes are.

Errors: 400, 401, 403, 404, 409, 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}/prints
curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/prints" \
  -H "X-Api-Key: $KEY"
  -o document.pdf
const res = await fetch(`${BASE}/businesses/${BID}/documents/${DOC_ID}/prints`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
  },
})
const pdf = Buffer.from(await res.arrayBuffer())
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/documents/{DOC_ID}/prints",
    headers={"X-Api-Key": KEY},
)
open("document.pdf", "wb").write(res.content)
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.