Create or update a purchase order and its lines
const url = 'https://api.invogi.com/v1/purchase-orders';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"poNumber":"example","lines":[{"description":"example","lineNumber":1,"quantity":"10.00","unitPrice":"10.00"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.invogi.com/v1/purchase-orders \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "poNumber": "example", "lines": [ { "description": "example", "lineNumber": 1, "quantity": "10.00", "unitPrice": "10.00" } ] }'Reads require workspace authentication. Writes require an ADMIN/OWNER session or an API key with purchase_data:write. Amounts and unit prices exclude VAT. PO numbers are unique within a company. Imports trigger invoice rechecks; unsafe release of another invoice’s hold remains subject to administrative approval.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”For a Clerk session, selects a workspace in which the user has an active membership. If omitted, the remembered accessible workspace is used. API keys remain bound to their own workspace and cannot select another tenant.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
ISO 4217 alphabetic currency code, case-insensitive and stored upper-case. A code that is not a currency suppliers invoice in (including XXX, funds and precious-metal codes) is rejected with INVALID_REQUEST. Invoices whose currency cannot be read from an uploaded document are stored with the ISO placeholder XXX and raise a CURRENCY_UNKNOWN finding.
Example
{ "poNumber": "example", "lines": [ { "description": "example", "lineNumber": 1, "quantity": "10.00", "unitPrice": "10.00" } ]}Responses
Section titled “Responses”Successful response
object
Example generated
{ "id": "example", "po_number": "example", "status": "example"}Invalid request
Missing or invalid API key
API key lacks required scope/role
Conflicting idempotency key or resource processing state