Skip to main content
POST
Error

Authorizations

authorization
string
header
required
X-Workspace-ID
string
header
required

Body

application/json

Creates one draft PO with one item per selected baseline row — of one package of the workspace with package_id, or across projects without it (the cross-project Committed grid's rows; one order can then hold rows of several projects). Every item belongs to its row's project. When supplier_id is sent, the request supplier is used (its contact fields filled from the company unless sent); otherwise the company and contact fields of the first selected row in list order that has a supplier (other rows' suppliers are ignored). When no selected row has a supplier, supplier_id is required.

package_id
integer

The baselined (in progress / finished) package of the workspace whose rows are selected. Omit to select across projects — the baselined packages of the active projects you're a member of, as the cross-project Committed grid lists them.

filter
object

Same filter as baseline find_items (ids, origin, category, package_section_ids, supplier fields, search, remaining); without package_id also the cross-project project_ids and package_ids (ignored with package_id). Every matching row becomes one item (max 5000).

currency
string | null

Blank = no currency. When not sent, defaults to the supplier_id company's currency (when the request sends one), else the supplier row's supplier_currency (the first selected row with a supplier, else the first row), else its project_currency, else none — never the workspace's.

Example:

"PLN"

name
string | null
notes
string | null
label
string | null
supplier_id
integer | null

Overrides the rows' supplier (required when no selected row has one); the contact fields are then taken from the request (or the company), never from the row.

supplier_contact_name
string | null
supplier_contact_email
string | null
supplier_contact_phone
string | null
supplier_address
string | null
payment_term_ids
integer[]

Copy these workspace terms onto the order, in this order ([] = no terms). When neither this nor payment_terms is sent, the supplier company's terms are copied, else the workspace defaults — on create, and when a draft picks another company.

payment_terms
object[]

Replaces the order's payment lines (edited on the order only; terms aren't changed). Draft and open orders; a change to an issued order writes a revision. Issuing, and any change to an open order, is refused when the lines add up to more than the order total.

Maximum array length: 20
match_type
enum<string>
Available options:
two_way,
three_way,
four_way
price_variance_percent
string | null

Null / blank = this price limit is not checked.

quantity_variance_percent
string
amount_variance_absolute
string | null

Null / blank = this price limit is not checked.

Response

Created

id
integer
required
project_ids
integer[]
required

The projects of the order's items, ascending (an order belongs to the workspace and can hold items of several projects); empty while it has no items.

label
string
required

Unique per workspace. Generated from the previous PO's label of the workspace when not given (PO-Alex-01 → PO-Alex-02, default series PO-0001) — one series across all projects.

status
enum<string>
required

draft until issued (an open order can be reverted to it); open once issued (receipts and invoices allowed); closed = no more deliveries (invoices still allowed); cancelled; voided = kept as history but counted nowhere (procured quantity, budget), final.

Available options:
draft,
open,
closed,
cancelled,
voided
revision
integer
required

Number of the latest revision. Revisions are written from issue onwards, one per change.

currency
string | null
required
Example:

"PLN"

supplier_id
integer
required

The supplier, a Contacts company of the workspace (may no longer exist).

supplier_company_name
string
required

The company's name when it was picked; a later rename in Contacts doesn't change it.

items_count
integer
required
total_amount
string
required

Σ item quantity × unit price, 2 decimals.

Example:

"296000.00"

invoiced_amount
string
required

This PO's share of its non-cancelled invoices (an invoice spanning several POs is split in proportion to each PO's items on it; extra charges are spread the same way).

paid_amount
string
required

Σ of the payment allocations to this PO (split when each payment was recorded). Can exceed invoiced_amount when a payment was allocated manually.

outstanding_amount
string
required

invoiced_amount − paid_amount.

name
string | null
notes
string | null
position
integer
supplier_contact_name
string | null
supplier_contact_email
string | null
supplier_contact_phone
string | null
supplier_address
string | null
issued_at
string<date-time> | null

Cleared when the order is reverted to draft.

voided_at
string<date-time> | null
voided_by_id
integer | null
created_by_id
integer | null
created_at
string<date-time>
updated_at
string<date-time>
payment_schedule
object

How the order's payment lines cover its total, derived on read.

payment_terms
object[]

The order's own payment lines in schedule order (position descending).

items
object[]

Only on show and create-from-baseline, ordered by position descending.

attachments
object[]

Only on show and create-from-baseline (with items). Newest first.