POST
/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. Bodies are capped at 5MB and there is a daily quota per key.
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": … }. Branch on reason.