Process a file with AI

Ask Wafeq's AI to process this file: it reads the file and books what it is, such as a draft bill or expense, then links the records to the file. The request returns 202 with the file at status queued; follow the status field to processed or failed, and read the booked records with ?expand=entities. A file can be processed again only after a run that booked nothing (failed with no linked record from that run). With an API key the AI acts as the organization's owner (or an admin); with an OAuth token it acts as the member who granted the token, with that member's permissions, and the token needs both the bills.write and expenses.write scopes. Files that arrived in the inbox are processed there and are refused here.

Path Params
string
required
Query Params
string

Comma-separated related objects to return in full instead of as IDs. Accepted values: entities. Nested relations are joined with a dot.

Headers
string

The id of the organization to act on, from GET /v1/organizations/. Required when the OAuth token or accounting partner API key grants access to several organizations; optional otherwise. With an organization API key, it must name the key's own organization.

Responses

400

The file type cannot be read: send a PDF, an image or an e-invoice XML.

402

The organization's AI allowance is spent or missing.

403

The OAuth token lacks the bills.write or expenses.write scope, the acting member or the plan cannot book any record, or no member can act for the organization.

409

The file is already queued, being processed or processed, a failed run already booked records from it, or it belongs to an inbox document.

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json