Upload Statement Screenshot
POST/api/ledger/reconciliation/bank-statements
Upload a screenshot of bank statement lines and queue its OCR extraction (Azure Document Intelligence prebuilt-layout). Returns immediately with the import in the extracting state plus a top-level tracked_job_log_id; the parsed lines arrive once the background a background job completes (watch it via the tracked job log endpoints, then re-fetch the import via GET .../bank-statements/{id}). Deferring the OCR keeps an unreachable provider from hanging the upload request.
Any valid API token can call this endpoint — no specific scope required. Manage tokens.
Xero exposes no API for raw statement lines, hence the screenshot path. Handles both Xero layouts: the cash-coding grid (one line per row) and the two-column reconcile card view (date / description / type stacked in one column).
Content-Type: multipart/form-data. Authentication: Requires Bearer token.
If the OCR provider cannot read the image, the job flips the import to failed with an error_message (surfaced via the tracked job log endpoints and on re-fetch) — the upload request itself still succeeds.
Request
Responses
- 200
- 401
- 403
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.