Vendor bills (Portal)

Read a vendor bill from a stored file

Runs text recognition over a file already in the company's file store and returns what it read — vendor name, dates, reference, total and lines — as a suggestion to fill a create-bill form with. Nothing is created and nothing is matched to a vendor or chart of account.

POST
https://api.portal.magicdoor.com/company-app/vendors/bills/parse-from-file/{fileId}

Authorization

Authorizationstringrequired
Bearer token — Send your API token in the Authorization header as Bearer <token>. Requests without a valid token are rejected with 401 Unauthorized.

Path parameters

fileIdstringrequired

The stored file to read. A Snowflake id sent as a decimal string.

example: 1829110447398404098

Query parameters

languagestring

The recognition language code. eng for English; chi_sim for simplified Chinese.

default: eng

Response

200 · What was read off the file. Check `success` — a failed parse still returns 200.

successboolean

Whether anything could be read from the file. false leaves suggestion absent and fills error.

suggestionobject

What was read off the document, as a starting point for a create-bill call. Nothing here is validated against the company's records — the vendor is a name, not an id. Absent when success is false.

rawOcrTextstring

The full text read off the file, unparsed. Absent when nothing could be read.

ocrConfidencenumber

How clearly the text could be read, from 0 to 100. This is about legibility, not about whether the fields are right.

processingTimeMsinteger

How long the parse took, in milliseconds.

errorstring

Why the parse failed. Absent when success is true.

400 · `fileId` is not a Snowflake id.

401 · The access token is missing, expired, or does not belong to a property manager.