Skip to content

Import invoice lines (ANALYST+, dashboard user)

POST
/overcharge-audits/invoice-lines
curl --request POST \
--url https://api.invogi.com/v1/overcharge-audits/invoice-lines \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "companyId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "rows": [ { "sourceRowNumber": 1, "invoiceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "invoiceExternalId": "example", "invoiceNumber": "example", "supplierName": "example", "supplierTaxId": "example", "sourceLineId": "example", "itemCode": "example", "variant": "example", "description": "example", "quantity": "example", "unit": "example", "unitPrice": "example", "priceBaseQuantity": "example", "discountPercent": "example", "discountAmount": "example", "lineNetAmount": "example", "currency": "example", "orderDate": "2026-04-15" } ], "dataProfile": { "profileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "revisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "clientDiagnostics": { "inputRowCount": 1, "rejectedRowCount": 1, "warningRowCount": 1, "unusedColumnCount": 1 } } }'

Appends new lines and a new revision of any line whose content changed; identical lines are unchanged. Never rewrites the invoice or its canonical lines.

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.

Idempotency-Key
string
Media typeapplication/json
object
companyId
string format: uuid
rows
required
Array<object>
>= 1 items <= 5000 items
object
sourceRowNumber
required

Unique within this request

integer
invoiceId
string format: uuid
invoiceExternalId
string
invoiceNumber

Needs supplierName or supplierTaxId

string
supplierName
string
supplierTaxId
string
sourceLineId
required

Unique within the invoice; kept as text

string
itemCode
string
variant
string
description
string
quantity

Non-negative decimal with at most 12 whole digits and six decimal places

string
unit
string
unitPrice

Before line discounts, for priceBaseQuantity units; non-negative with at most 18 whole digits and six decimal places

string
priceBaseQuantity

Positive quantity with at most 12 whole digits and six decimal places

string
discountPercent

Non-negative decimal with at most 3 whole digits and six decimal places

string
discountAmount

The line’s total discount; non-negative with at most 18 whole digits and six decimal places

string
lineNetAmount
required

Billed net amount after line discounts, before tax; non-negative with at most 18 whole digits and six decimal places

string
currency

Must equal the invoice’s currency

string
orderDate
string format: date
dataProfile

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

Example generated

{
"companyId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"rows": [
{
"sourceRowNumber": 1,
"invoiceId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"invoiceExternalId": "example",
"invoiceNumber": "example",
"supplierName": "example",
"supplierTaxId": "example",
"sourceLineId": "example",
"itemCode": "example",
"variant": "example",
"description": "example",
"quantity": "example",
"unit": "example",
"unitPrice": "example",
"priceBaseQuantity": "example",
"discountPercent": "example",
"discountAmount": "example",
"lineNetAmount": "example",
"currency": "example",
"orderDate": "2026-04-15"
}
],
"dataProfile": {
"profileId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"revisionId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"clientDiagnostics": {
"inputRowCount": 1,
"rejectedRowCount": 1,
"warningRowCount": 1,
"unusedColumnCount": 1
}
}
}

Imported

Media typeapplication/json
object
importId
string format: uuid
preview
boolean
counts
object
created
integer
revised
integer
unchanged
integer
rejectedRowCount
integer
rejectedRows
Array<object>
object
sourceRowNumber
integer
reason
string
Allowed values: INVOICE_NOT_FOUND INVOICE_AMBIGUOUS SUPPLIER_REQUIRED INVOICE_REQUIRED CURRENCY_MISMATCH CURRENCY_UNKNOWN DUPLICATE_LINE_ID INCOMPLETE_INVOICE
message
string
invoices
Array<object>
object
invoiceId
string format: uuid
invoiceNumber
string | null
lines
integer
reconciliation
object
status
string
Allowed values: RECONCILED NET_MISMATCH NET_UNKNOWN
lineTotal
string
invoiceNet
string | null
difference
string | null

Example

{
"rejectedRows": [
{
"reason": "INVOICE_NOT_FOUND"
}
],
"invoices": [
{
"reconciliation": {
"status": "RECONCILED"
}
}
]
}

Invalid request

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"
}
}