Import purchase-line and receipt exports (ADMIN or higher, or an API key with the purchase_data:write scope)
const url = 'https://api.invogi.com/v1/purchase-orders/import';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"companyId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","orders":[{"poNumber":"example","lineNumber":1,"description":"example","quantity":"example","unitPrice":"example","supplierName":"example","supplierTaxId":"example","currency":"example","issuedAt":"2026-04-15","status":"OPEN","sourceRowNumber":1}],"receipts":[{"poNumber":"example","lineNumber":1,"receiptReference":"example","receivedAt":"2026-04-15","quantityReceived":"example","sourceRowNumber":1}],"dataProfiles":{"orders":{"profileId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","revisionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","clientDiagnostics":{"inputRowCount":1,"rejectedRowCount":1,"warningRowCount":1,"unusedColumnCount":1}},"receipts":{"profileId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","revisionId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","clientDiagnostics":{"inputRowCount":1,"rejectedRowCount":1,"warningRowCount":1,"unusedColumnCount":1}}}}'};
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/import \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "companyId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "orders": [ { "poNumber": "example", "lineNumber": 1, "description": "example", "quantity": "example", "unitPrice": "example", "supplierName": "example", "supplierTaxId": "example", "currency": "example", "issuedAt": "2026-04-15", "status": "OPEN", "sourceRowNumber": 1 } ], "receipts": [ { "poNumber": "example", "lineNumber": 1, "receiptReference": "example", "receivedAt": "2026-04-15", "quantityReceived": "example", "sourceRowNumber": 1 } ], "dataProfiles": { "orders": { "profileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "revisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "clientDiagnostics": { "inputRowCount": 1, "rejectedRowCount": 1, "warningRowCount": 1, "unusedColumnCount": 1 } }, "receipts": { "profileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "revisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "clientDiagnostics": { "inputRowCount": 1, "rejectedRowCount": 1, "warningRowCount": 1, "unusedColumnCount": 1 } } } }'One row per PO line and per receipt line. All or nothing, and safe to repeat: lines update by line number, and a receipt reference already imported is skipped. Amounts exclude VAT, and an order’s total is worked out from its lines. Invoices quoting these orders are then re-checked, and an invoice analysed before its order is linked to it. A file with different contents for a receipt reference already imported is refused. A 400 can list the rows needing a fix.
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
object
Required when the order has several lines.
Optional saved Data profiles (dashboard users only). A profile never grants this import; the Admin requirement still applies.
object
The exact ACTIVE revision an import used. Refused with 409 if the profile is archived or the revision is not the active one, and with 400 if the dataset kind or scope does not match the route.
object
Counts the browser observed, stored labelled as client-reported
object
The exact ACTIVE revision an import used. Refused with 409 if the profile is archived or the revision is not the active one, and with 400 if the dataset kind or scope does not match the route.
object
Counts the browser observed, stored labelled as client-reported
object
Responses
Section titled “Responses”Imported
object
object
object
object
Example generated
{ "ordersCreated": 1, "ordersUpdated": 1, "receiptsCreated": 1, "receiptsSkipped": 1, "dataProfiles": { "additionalProperty": { "bindingId": "example", "profileId": "example", "revisionId": "example", "revisionNumber": 1, "name": "example" } }, "errors": [ { "sourceRowNumber": 1, "message": "example" } ]}The import has rows needing a fix
API key lacks required scope/role