Skip to content

Import purchase-line and receipt exports (ADMIN or higher, or an API key with the purchase_data:write scope)

POST
/purchase-orders/import
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.

X-Invogi-Organization
string format: uuid

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.

Media typeapplication/json
object
companyId
string format: uuid
orders
Array<object>
<= 5000 items
object
poNumber
required
string
lineNumber
integer
description
required
string
quantity
required
string
unitPrice
required
string
supplierName
string
supplierTaxId
string
currency
string
issuedAt
string format: date
status
string
Allowed values: OPEN CLOSED
sourceRowNumber
required
integer
receipts
Array<object>
<= 5000 items
object
poNumber
required
string
lineNumber

Required when the order has several lines.

integer
receiptReference
required
string
receivedAt
required
string format: date
quantityReceived
required
string
sourceRowNumber
required
integer
dataProfiles

Optional saved Data profiles (dashboard users only). A profile never grants this import; the Admin requirement still applies.

object
orders

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
profileId
required
string format: uuid
revisionId
required
string format: uuid
clientDiagnostics

Counts the browser observed, stored labelled as client-reported

object
inputRowCount
integer
rejectedRowCount
integer
warningRowCount
integer
unusedColumnCount
integer
receipts

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
profileId
required
string format: uuid
revisionId
required
string format: uuid
clientDiagnostics

Counts the browser observed, stored labelled as client-reported

object
inputRowCount
integer
rejectedRowCount
integer
warningRowCount
integer
unusedColumnCount
integer

Imported

Media typeapplication/json
object
ordersCreated
integer
ordersUpdated
integer
receiptsCreated
integer
receiptsSkipped
integer
dataProfiles
object
key
additional properties
object
bindingId
required
string
profileId
required
string
revisionId
required
string
revisionNumber
required
number
name
required
string
errors
Array<object>
object
sourceRowNumber
required
number
message
required
string

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

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: NOT_FOUND UNAUTHORIZED FORBIDDEN INVALID_REQUEST CONFLICT RATE_LIMITED USAGE_LIMIT_EXCEEDED PROCESSING_FAILED
message
required
string
request_id
required
string
details

Optional stable, content-free context, e.g. {reason, resets_at, preparation_id}.

object
key
additional properties
One of:
string

Example

{
"error": {
"code": "NOT_FOUND"
}
}