Incoming invoices (accounts payable)
Check a supplier's e-invoice before you book or pay it. One call runs the official validation and, separately, your own business checks against data only you have: invoices you received before, and the purchase order the invoice names.
The two results are kept apart. validation.status comes only from the official rule sets and is never changed by a business check. checks.status tells you whether your own data agrees with the invoice. Neither is a payment approval, a statement of legal validity or of tax correctness.
Checking an invoice
curl -X POST https://einvoiceengine.com/v1/invoices/inbound -H "Authorization: Bearer $EINV_KEY" \
-H "Content-Type: application/xml" -H "Idempotency-Key: inv-2026-0042" --data-binary @invoice.xml
The document is sent like a validation: raw XML or PDF body with options in the query string, or JSON { document, encoding, ...options }. Options:
| Option | Default | Meaning |
|---|---|---|
store |
your setting | keep the document in your history (encrypted, deleted after the retention period) |
remember |
true |
keep keyed hashes of this invoice so a later copy is reported as a duplicate; false for a trial check |
tolerance |
your setting | { "percent": 2, "amount": "10.00" }: how far the invoiced amount may go above the order |
supplierReport |
— | true, a language code ("de") or { "lang": "fr", "share": true } (see below) |
The answer (object: "inbound_check") contains invoice (number, date, seller, totals, order reference), validation (the complete official result, as from /v1/invoices/validate), checks and, if asked for, supplierReport.
"checks": {
"status": "failed",
"summary": { "errors": 1, "warnings": 0, "infos": 0 },
"findings": [
{ "code": "order_amount_exceeded", "severity": "error",
"message": "Invoiced net amount 314.86 EUR (with earlier invoices 0.00) exceeds order PO-4711 (300.00 EUR, allowed up to 300.00).",
"details": { "order": "PO-4711", "basis": "net", "ordered": "300.00", "earlier": "0.00", "thisInvoice": "314.86", "invoiced": "314.86", "allowed": "300.00", "currency": "EUR" } }
],
"duplicates": [],
"order": { "id": "…", "orderNumber": "PO-4711", "…": "…" },
"tolerance": { "percent": "0", "amount": "0.00" },
"remembered": true
}
checks.status is failed when a finding has severity error (do not pay as it is), review when there are only warnings (look at it), passed otherwise, and not_checked when the document could not be read as an invoice. The code is the stable value to automate on; message is English.
An inbound check counts and is billed as one validated document, exactly like /v1/invoices/validate (free in the dashboard, like other checks there). Send an Idempotency-Key: a retried request is then neither billed twice nor reported as a duplicate of itself. Scope: validate.
Duplicates
| Code | Severity | When |
|---|---|---|
duplicate |
error | an earlier invoice of the same seller has the same invoice number (BT-1) and passed the official validation |
resubmission |
info | the earlier invoice with that number failed the official validation — this looks like the corrected copy |
possible_duplicate |
warning | an earlier invoice of the same seller has the same gross total (BT-112), currency and issue date (BT-2), but another number |
The seller is identified by the seller VAT ID (BT-31), else the first seller identifier (BT-29) or legal registration (BT-30), else the seller name. Invoice numbers are compared without spaces, dashes and case (2026-0042 and 2026 0042 are the same number). Invoices and credit notes are compared separately. checks.duplicates lists the earlier checks (checkId, invoiceId if still stored, checkedAt, match: number|amount).
Duplicate detection also works when documents are not stored: each check keeps only keyed hashes (HMAC with a server secret and your organization id) of seller + number and of seller + total + date. They contain no readable invoice data. They are kept for the duplicate window (default 400 days, setting duplicateWindowDays), then deleted. Test and live keys keep separate histories.
When an invoice goes back to the supplier and will come again with the same number, forget the first check: DELETE /v1/inbound-checks/{id} (scope invoices:delete) removes its hashes, its amounts counted against the order and its shared reports.
Purchase orders
Invoices are matched to your purchase orders by the order reference (BT-13). Your ERP sends the orders, or you import a CSV.
curl -X POST https://einvoiceengine.com/v1/purchase-orders -H "Authorization: Bearer $EINV_KEY" -H "Content-Type: application/json" -d '{
"orderNumber": "PO-4711", "currency": "EUR", "netAmount": "300.00",
"supplierVatId": "DE123456789", "supplierName": "Seller GmbH", "buyerReference": "04011000-12345-03",
"lines": [ { "itemId": "246", "name": "Journal", "quantity": "1", "unitPrice": "288.79" } ] }'
orderNumber and currency are required; netAmount, grossAmount, supplierVatId, supplierName, buyerReference, status (open or closed) and up to 500 lines (lineId, itemId, name, quantity, unitPrice, unitCode) are optional. Amounts may be written 1234.56 or 1.234,56. A second order with the same number is refused with 409 unless you send replace: true. GET /v1/purchase-orders (q, status, limit), GET /v1/purchase-orders/{id} (with the amounts invoiced so far), DELETE /v1/purchase-orders/{id}. Reading needs invoices:read, writing validate. Orders belong to the mode of the key.
CSV import: POST /v1/purchase-orders/import with { "csv": "…" } (max 5 MB, 20,000 rows, 5,000 orders) adds or replaces orders by number. Use one row per order, or one row per order line with the order number repeated. Columns (case and separators ignored): orderNumber, currency, netAmount, grossAmount, supplierVatId, supplierName, buyerReference, status, and per line lineId, itemId, itemName, quantity, unitPrice, unitCode. Comma, semicolon and tab are detected. The answer lists created, updated and skipped orders with the reason.
orderNumber;currency;netAmount;supplierVatId;itemId;itemName;quantity;unitPrice
PO-100;EUR;1.000,00;DE123456789;A1;Bolts;10;50,00
PO-100;;;;A2;Nuts;20;25,00
Order findings
| Code | Severity | When |
|---|---|---|
order_reference_missing |
info, or error with requireOrderReference |
the invoice has no BT-13 |
order_not_found |
error | no order with that number |
order_closed |
warning | the order has status closed |
order_supplier_mismatch |
error | the seller VAT ID differs from the order's supplierVatId |
order_supplier_unverified |
warning | the order has a supplier VAT ID, the invoice none |
order_currency_mismatch |
error | invoice currency (BT-5) differs from the order |
order_amount_exceeded |
error | this invoice plus earlier invoices on the same order exceed the order amount plus tolerance |
order_buyer_reference_mismatch |
warning | buyer reference (BT-10) differs from the order |
order_line_not_found |
warning | an invoice line matches no order line |
order_line_quantity_exceeded |
error | an invoice line bills more than the order line's quantity |
order_line_price_exceeded |
warning | an invoice line's net price (BT-146) is above the order's unit price (plus the percent tolerance) |
The amount is compared on the net total (BT-109) when the order has netAmount, else on the gross total (BT-112). Earlier invoices on the same order count too, so partial deliveries add up; credit notes count negative; duplicates and trial checks (remember: false) are not counted. The tolerance is the larger of percent of the order amount and the fixed amount. Invoice lines are matched to order lines by the order line reference (BT-132 = lineId), else the item id (seller, buyer or standard id = itemId), else the item name. Line quantities are compared per invoice.
Settings
GET /v1/inbound/settings, PATCH /v1/inbound/settings (scope keys:write): amountTolerancePercent (0–100), amountToleranceAmount, requireOrderReference, duplicateWindowDays (1–3650). The same in Dashboard → Incoming invoices.
Supplier report
What the supplier must change, in plain language and in the supplier's language (en, de, fr, es, it, pl, nl, pt): the errors and warnings of the official validation, with the explanation, how to fix it, the official rule text (verbatim) and the location, followed by the business findings that are the supplier's to fix (duplicate, order number, supplier, currency, amounts, lines). Internal findings such as possible_duplicate stay out of it.
Ask for it in the check (supplierReport: { "lang": "de", "share": true }), or later with POST /v1/inbound-checks/{id}/supplier-report { "lang": "de", "share": true } (scope invoices:read; add ?format=text for plain text). A later report needs the stored result, which exists only when the document was stored; otherwise the call answers 409 result_not_stored.
The report has items, summary (mustFix, shouldCheck), labels and text, ready to paste into an e-mail. With share: true it also has a link to a page the supplier opens without signing in, valid for 30 days. Only a hash of the link's token is stored; the report itself is stored encrypted. Explanations are machine translations; the official rule text is never changed. Check the text before you send it — the report states what the rules and your data say, not what the supplier is legally obliged to do.
Webhook
The event invoice.inbound_checked carries { id, invoiceId, validationStatus, checksStatus, codes } — see webhooks.
MCP
The tool check_inbound_invoice runs the same check from an AI assistant (document, encoding, store, remember, supplierLang); see MCP setup.
Data and deletion
- With storage off (
store=false) only the keyed hashes, the check's status and codes, and — when an order matched — the amounts counted against that order are kept, until the duplicate window ends. - Deleting an invoice deletes its inbound check, hashes and shared reports. When an invoice reaches the end of its retention period, its document and full result are deleted; the hashes stay until the duplicate window ends.
- Delete all documents (Settings) deletes every inbound check and shared report. Purchase orders are your own records and stay until you delete them.
Related: validation, delivery routing, data retention.
E-Invoicing API