/businesses/{bid}/expenses/ocrOpen 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. Images are capped at 5MB (PDFs 8MB) and there is a daily quota per account: a developer's sandbox and live clients share one count.
Path parameters
| Name | Type | Description | |
|---|---|---|---|
bid | string | required | Business id, from POST /businesses. |
Body
Raw bytes. Accepted content types: image/jpeg, image/png, application/pdf.
Response
201: { "ok": true, … }
| Field | Type | Description | |
|---|---|---|---|
ok | boolean | required | |
expense | Expense | required | The purchase side of the ledger. A recorded expense is immutable; correct it with a storno. |
extracted | OcrExtraction | What the vision model read off the receipt. Advisory: the operator confirms before recording. | |
fileId | string | The stored receipt. |
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).