Skip to content

Create and analyze a canonical invoice

POST
/invoices
curl --request POST \
--url https://api.invogi.com/v1/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "supplier": { "name": "example", "tax_id": "example", "company_number": "example", "bank_account": { "iban": "example", "sort_code": "60-16-13", "account_number": "31926819" } }, "invoice_number": "example", "issue_date": "2026-04-15", "due_date": "2026-04-15", "currency": "GBP", "net_amount": "example", "tax_amount": "example", "gross_amount": "example", "purchase_order_ref": "example", "site_reference": "example", "buyer": { "name": "example", "tax_id": "example" }, "company_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "external_id": "example", "lines": [ { "description": "example", "quantity": "example", "unit_price": "example", "tax_rate": "example", "line_net_amount": "example" } ], "buyer_reference": "example", "compliance_profile": "EN16931" }'
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
supplier
required
object
name
required
string
tax_id
string
company_number

UK Companies House number (8 characters, or fewer digits that are zero-padded). Anything that is not a company number is refused with 400; a well-formed number beside a VAT number from another country is ignored. When the organization has a Companies House key it is checked against the register: unknown numbers and dissolved or insolvent companies raise findings. Never inferred from the supplier name.

string
bank_account

IBAN, or a UK domestic account as sort_code plus account_number (both required together). A GB IBAN and its sort code + account number are treated as the same account.

object
iban
string
sort_code

Six-digit UK sort code; “-” and spaces are ignored

string

Example

60-16-13
account_number

Six- to eight-digit UK account number

string

Example

31926819
invoice_number
required
string
issue_date
required
string format: date
due_date
string format: date
currency
required

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.

string
/^[A-Za-z]{3}$/

Example

GBP
net_amount
string
/^-?[0-9]+(\.[0-9]{1,6})?$/
tax_amount
string
/^-?[0-9]+(\.[0-9]{1,6})?$/
gross_amount
required
string
/^-?[0-9]+(\.[0-9]{1,6})?$/
purchase_order_ref
string
site_reference

The site, store, property, or location the invoice is for, as the customer names it.

string
buyer

Invoice recipient (EN 16931 BG-7). tax_id routes the invoice to the company with that VAT ID when company_id is omitted.

object
name
string
tax_id
string
company_id

One of the organization’s companies (GET /companies); defaults to the default company

string format: uuid
external_id

Caller-owned external reference; does not replace the Idempotency-Key header.

string
lines
Array<object>
object
description
string
quantity
string
/^-?\d+(\.\d{1,6})?$/
unit_price
string
/^-?\d+(\.\d{1,6})?$/
tax_rate
string
/^-?\d+(\.\d{1,6})?$/
line_net_amount
string
/^-?\d+(\.\d{1,6})?$/
buyer_reference
string
compliance_profile

Optional Invogi compliance profile used for this analysis.

string
Allowed values: EN16931 XRECHNUNG

Accepted

Media typeapplication/json
object
id
required
string
status
required
string
Allowed value: ANALYZING
decision
required
string
Allowed values: PASS REVIEW BLOCK
risk_score
required
integer
<= 100
findings
required
Array<object>
object
type
required
string
severity
required
string
Allowed values: INFO LOW MEDIUM HIGH CRITICAL
summary
required
string
recommendedAction
string | null
confidence
number
<= 1
evidence
required
object
key
additional properties
any
policyAction
string
Allowed values: REVIEW BLOCK
relatedInvoiceIds
Array<string>
ruleVersion
string
versions
required
object
riskEngine
required
string
policy
required
string
compliance
string

Example

{
"status": "ANALYZING",
"decision": "PASS",
"findings": [
{
"severity": "INFO",
"policyAction": "REVIEW"
}
]
}

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

Missing or invalid API key

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

Conflicting idempotency key or resource processing state

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