Skip to main content
Create a purchase order from documents

Authorizations

Authorization
string
header
required

Personal API key sent as a bearer token, together with X-Organization-Id. The key must have at least the access level the endpoint requires (read, write or admin).

Headers

X-Organization-Id
string

The organization to act in. Required for personal API keys; list the organizations you can access with GET /v1/organizations.

Idempotency-Key
string

Optional protection for safely retrying a request after a timeout or lost response. Choose a unique value (for example, a UUID) for each action and reuse it with the same input when retrying. Omit it for a normal request.

Required string length: 1 - 200
Pattern: ^[\x21-\x7e]+$

Body

application/json
document_ids
string<uuid>[]

Up to 20 uploaded documents read together as one order: PDF, PNG, JPEG, WEBP, an email (.eml or .msg) or plain text. An email's attachments are read with it.

Maximum array length: 20
text
string

Pasted text, such as an email thread, read together with the documents.

Required string length: 1 - 100000

Response

Idempotent replay: the same import in its current state.

id
string<uuid>
required
status
enum<string>
required

completed, failed and cancelled are final.

Available options:
queued,
running,
completed,
failed,
cancelled
origin
enum<string>
required

email: forwarded to the organization's order address by the member who owns it. supplier_reply: a supplier's reply to an order's reply address, read against that order; nobody owns it.

Available options:
upload,
api,
email,
supplier_reply
outcome
enum<string> | null
required

created: a new order, a draft unless submitted. duplicate: the order already exists (same file, or the same supplier and sales order reference); the sources were attached to it. not_order: the sources hold no order. Null until completed.

Available options:
created,
duplicate,
not_order,
null
purchase_order_id
string<uuid> | null
required

The order created, or the existing order for a duplicate. Null when not visible.

intent
enum<string> | null
required

new: terms agreed but not ordered yet. placed: already ordered or confirmed; with nothing missing, the new order is submitted unless the submit is refused, which leaves it a draft.

Available options:
new,
placed,
null
missing
object[]
required

What the created order still needs, as it stands now; empty for a duplicate or not_order.

not_order_reason
string | null
required
text
boolean
required

Whether pasted text was submitted.

sources
object[]
required
workflow_run_id
string<uuid>
required
workflow_run_item_id
string<uuid>
required
failure
object | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required