Skip to main content
POST
Error

Authorizations

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

Body

application/json

The supplier is picked as supplier_id; its name is copied once (never changes afterwards) and the contact fields not sent are filled from the company. Without it the supplier (company and all supplier fields) is copied from the PO of the first PO-linked item.

invoice_date
string<date>
required
invoice_number
string | null

Optional; when blank the next number of the workspace's generated INV-0001 series is used. Unique per workspace and supplier.

due_date
string<date> | null

Overrides the computed due date; null / blank goes back to computing it from the payment terms.

currency
string | null

Blank = no currency. When not sent, defaults to the first linked PO's currency (even none), else the supplier's, else the workspace's (possibly none).

Example:

"PLN"

supplier_id
integer | null

A Contacts company of the workspace; PO-linked items must belong to orders of the same company.

supplier_contact_name
string | null
supplier_contact_email
string | null
supplier_contact_phone
string | null
supplier_address
string | null
items
object[]

Response

Created

id
integer
required
project_ids
integer[]
required

The projects of the invoice's items (PO item lines and extra charges), ascending. An invoice belongs to the workspace and may bill several projects.

invoice_number
string
required

The supplier's own invoice number, unique per workspace and supplier. Generated numbers continue the workspace's INV-0001 series.

invoice_date
string<date>
required
currency
string | null
required
Example:

"PLN"

net_amount
string
required

Σ item quantity × unit price (extra charges included), 2 decimals.

paid_amount
string
required

Σ payments, 2 decimals.

outstanding_amount
string
required

net_amount − paid_amount.

payment_status
enum<string>
required
Available options:
unpaid,
partially_paid,
paid
status
enum<string>
required
Available options:
draft,
matched,
on_hold,
approved,
cancelled
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 the invoice got its supplier (copied from the PO, or picked); never changes afterwards.

due_date
string<date> | null

When the invoice should be paid. Computed as invoice_date + due_days of a payment line (see payment_terms_basis) unless typed in by hand (due_date_overridden); null without terms.

due_date_overridden
boolean

The due date was typed in by hand and is no longer computed.

payment_terms_basis
object | null

The payment line the computed due date came from; null when typed in by hand or without terms.

overdue
boolean

Not fully paid and due before today; never for a cancelled invoice.

purchase_orders
object[]

The purchase orders this invoice bills, with this invoice's amounts per PO (summed over the PO's projects).

matched_at
string<date-time> | null
exceptions_accepted_at
string<date-time> | null
exceptions_accepted_by_id
integer | null
exceptions_acceptance_note
string | null
position
integer
supplier_contact_name
string | null
supplier_contact_email
string | null
supplier_contact_phone
string | null
supplier_address
string | null
created_by_id
integer | null
created_at
string<date-time>
updated_at
string<date-time>
items
object[]

Not on the list endpoint. Ordered by position descending.

attachments
object[]

Not on the list endpoint. Newest first.

payments
object[]

Not on the list endpoint. Newest payment first.