Skip to main content
POST

Authorizations

Authorization
string
header
required

API key authentication. Send your raw API key as the Authorization header value with NO scheme prefix — Authorization: YOUR-API-KEY. Do NOT prefix it with Bearer or ApiKey, and do not use an X-API-Key header; those are not accepted.

Path Parameters

companyId
string<uuid>
required

Company identifier

Body

application/json
actionId
string<uuid>
required

Client-minted idempotency key — becomes the action's journal id. An identical retry replays the original outcome; reuse with a different payload is 409 ACTION_ID_REUSED

categoryId
string<uuid>
required

The transaction category the invoice belongs to

lineItems
object[]
required
author
string

Optional display label for the source system's author (e.g. the integrator-side user). Stamped as the journal record's display attribution; the acting principal stays the External API service user, so a label can never impersonate an in-app user. Ignored on idempotent replays

Required string length: 1 - 255
stage
enum<string>

Set to draft to create the invoice UNPOSTED (derived status draft) until it is finalized. Omit for a live, posted invoice. The only stage marker — accepted on create only

Available options:
draft
incurredDate
string<date>

The recognition date for the charges (ISO YYYY-MM-DD) — the period the amount lands in. May be in the future on a policy-linked invoice; on an event-linked or unlinked invoice a future date is 422 FUTURE_DATE

dueDate
string<date>

When payment is owed — display metadata only

memo
string

Free-text memo

fieldData
object

Values for the tenant-defined custom invoice fields, keyed by field referenceId — an opaque JSON object

The invoice's initial links — all optional; absent means unlinked. event and policy are mutually exclusive

draftPayments
object[]

Payment MARKS parsed off an already-paid source document, carried on a DRAFT so finalize can apply them as real payments. Legal only with stage: "draft". One entry = one per-line settlement mark citing this payload's own line items; no paymentId — the server assigns ids at finalize

sourceFileIds
string<uuid>[]

Ids of already-uploaded files (platform files API) to attach to the created invoice server-side. Deduplicated; an unknown id is a 404 that rolls the create back

Response

The created invoice — refreshed read state with the server-minted id and invoice number (a replay returns the original outcome)

The response of every single-invoice write — refreshed read state, not an ack: the emitted journal id(s), THE invoice row (identical shape to the reads — one invoice representation everywhere; its headJournalId is the next If-Match), and the invoice's live payments. An idempotent actionId replay returns this same shape rebuilt from the original outcome, server-minted values included.

journalIds
string<uuid>[]
required

Every journal id the write emitted — the anchor action's id (the actionId you supplied) first, then any engine-minted siblings (a multi-mark payment's additional marks) and any companion the horizon rule composed (e.g. the reserve unwind of a pre-horizon eroding payment's removal, or a delete's payment sweep)

Minimum array length: 1
invoice
object
required

THE invoice representation — the same shape everywhere an endpoint returns an invoice (listing rows, the detail read, and every write's refreshed-row response). headJournalId is the invoice's current journal head — the optimistic-concurrency token subsequent writes echo back as If-Match.

payments
object[]
required

The invoice's live payment marks after the write, newest first