Invoice Checks
Check an invoice against a contract price model, list earlier checks, and read the audit-proof restatement of a checked invoice as data, HTML or PDF file.
An invoice check reads an invoice document with the extraction model, recomputes each billed price from the contract (each invoice month priced by the version in force then) and stores the comparison. Every invoice line gets a verdict. match means the billed price equals the contract price, underbilled and overbilled carry an effect in the comparison's currency (contract price minus billed price, times quantity; positive means the biller billed less than the contract allows), and not_comparable means the line could not be compared, with a reason.
A gap carries a tier that says how firmly it stands. owed is a gap built only on independent sources. estimated rests on an invoice-printed index. potential covers a suspected amendment or a charge the contract prices that the invoice leaves off. assumed rests on an assumption. Index values the invoice prints are kept as invoice-sourced values and flagged as not independent, so a check never presents the biller's own numbers as independent evidence.
/v1/price-baseline/models/{id}/compareBody fields
Key response fields (201)
cURL: Check an invoice
curl -X POST "https://api.talonic.com/v1/price-baseline/models/7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9/compare" \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"invoice_document_id": "c91d47e0-52ab-4f63-8e1b-0a7d3c6f2b48"}'Response: 201 Stored comparison (excerpt)
{
"id": "e04a9b17-6d28-47c5-b3f1-9c5e2a8d7016",
"model_id": "7b1f0a52-3c9d-4e08-a6d4-51c2e8f7b3a9",
"invoice_document_id": "c91d47e0-52ab-4f63-8e1b-0a7d3c6f2b48",
"currency": "EUR",
"underbilled": 0,
"overbilled": 2092.8,
"comparison": {
"currency": "EUR",
"lines": [
{
"line": { "label": "Arbeitspreis Q1", "component": "AP", "quantity": 480000, "unit_price": 7.62 },
"baseline_price": 7.184,
"billed_price": 7.62,
"unit": "ct/kWh",
"effect": -2092.8,
"verdict": "overbilled",
"independent": true,
"tier": "owed"
}
],
"totals": { "underbilled": 0, "overbilled": 2092.8, "compared_lines": 1, "not_comparable_lines": 0 }
},
"engine_version": 12,
"created_at": "2025-04-02T08:31:07.000Z"
}/v1/price-baseline/models/{id}/comparisonsPath parameters
Audit-Proof Restatement
The audit-proof restatement answers "what is the invoice the contract supports for this period". It restates a checked invoice line by line from the stored comparison: every line at the contract's price, and each input with its source, which is a contract passage, a publisher line with its URL, or the biller's invoice. It lists the checks that say what still keeps it from being audit-proof and carries a sha256 hash over the amounts. No model call is made, so the restatement is free and repeatable. The {id} of these routes is a comparison id, not a model id.
/v1/price-baseline/comparisons/{id}/proof-invoicePath parameters
Response fields
/v1/price-baseline/comparisons/{id}/proof-invoice.pdfPath parameters
cURL: Download the audit-proof PDF
curl -OJ "https://api.talonic.com/v1/price-baseline/comparisons/e04a9b17-6d28-47c5-b3f1-9c5e2a8d7016/proof-invoice.pdf" \
-H "Authorization: Bearer $TALONIC_API_KEY"text/html and the same attachment name. Check the Content-Type header of the response before treating the file as a PDF.