BillOS v1
Console llms.txt OpenAPI
POST/businesses/{bid}/expenses/ocr

Open a draft from a receipt photo

POST /businesses/{bid}/expenses/ocr

Requires the ocr scope.

POST the raw image or PDF bytes with the matching Content-Type. A vision model reads the receipt and opens a draft expense from what it found; your user confirms and records.

Requires the ocr scope, which is granted separately, because every scan runs a billed AI call. Bodies are capped at 5MB and there is a daily quota per key.

Path parameters

NameTypeDescription
bidstringrequiredBusiness id, from POST /businesses.

Body

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

Response

201: { "ok": true, … }

FieldTypeDescription
okbooleanrequired
expenseExpenserequiredThe purchase side of the ledger. A recorded expense is immutable; correct it with a storno.
extractedOcrExtractionWhat the vision model read off the receipt. Advisory: the operator confirms before recording.
fileIdstringThe stored receipt.

Errors: 400, 401, 403, 404, 413, 429. Every failure answers { "error": …, "reason": … }. Branch on reason.

POST /businesses/{bid}/expenses/ocr
curl -X POST "$BASE/businesses/$BID/expenses/ocr" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: image/jpeg" \
  --data-binary @receipt.jpg
const res = await fetch(`${BASE}/businesses/${BID}/expenses/ocr`, {
  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}/expenses/ocr",
    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.