BillOS v1
Console llms.txt OpenAPI
PUT/businesses/{bid}/legacy-documents/{id}/file

Attach the original file

PUT /businesses/{bid}/legacy-documents/{id}/file

Requires the documents scope.

The file bytes are the request body with their own Content-Type: application/pdf, image/jpeg or image/png, up to 8MB. Replaces a file attached earlier. Stored like every ledger file (bucket or inline) and carried into backups.

Path parameters

NameTypeDescription
bidstringrequiredBusiness id, from POST /businesses.
idstringrequiredLegacy document id.

Body

Raw bytes. Accepted content types: application/pdf, image/jpeg, image/png.

Response

200: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
documentLegacyDocumentrequiredA document issued by the software the business used before BillOS: its metadata as that system printed it, and the original file. Not a BillOS document: no number from any series, no signature, absent from every export and report.

Errors: 400, 401, 403, 404, 413, 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).

PUT /businesses/{bid}/legacy-documents/{id}/file
curl -X PUT "$BASE/businesses/$BID/legacy-documents/$DOC_ID/file" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @receipt.jpg
const res = await fetch(`${BASE}/businesses/${BID}/legacy-documents/${DOC_ID}/file`, {
  method: 'PUT',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
import requests
res = requests.put(
    f"{BASE}/businesses/{BID}/legacy-documents/{DOC_ID}/file",
    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.