x402 Forge Upgrade your toolBundlesCatalog

Catalog / en16931-totals-check

EN 16931 invoice totals check

Checks that an e-invoice's line sums, allowances, charges, VAT breakdown and amount due add up the way the European e-invoicing standard EN 16931 requires.

Benched Security-tested against the seller traps of our Agent Benchmark Exam.

Buy $1.00

What it does

Checks the arithmetic of an EN 16931 e-invoice before it is sent or booked. In exact decimal arithmetic it recomputes the sum of line net amounts, the document-level allowance and charge totals, total without VAT, total with VAT and amount due (BR-CO-10 to BR-CO-16), the VAT breakdown and VAT total (BR-CO-14, BR-CO-17, BR-CO-18), the VAT-category rules -01 and -05 to -10 for S, Z, E, AE, K (BR-IC), G, O (plus BR-O-11 to 14), L (BR-IG) and M (BR-IP), the presence rules BR-12 to 16, 24, 31, 32, 36, 37, 45 to 48 and BR-CO-04, and the two-decimal rules BR-DEC-01, 05, 09 to 14, 16 to 20 and 23. Formulas, tolerances and rounding are those of the official CEN/TC 434 UBL Schematron 1.3.17: XPath round (nearest cent, ties toward +infinity), and BR-CO-17, BR-S-08/09 and their L/M twins accept a difference below 1.00 (the CII binding's tolerances differ and are not reproduced). Each failing rule comes with its rule id, where, expected value, stated value and formula. On top of the Schematron it reports deviations, which make the verdict review: a tax or taxable amount that only passes through the 1.00 tolerance (EN 16931-1 asks for taxable x rate / 100 rounded to 2 decimals; half-up on the absolute value, and for a negative exact half-cent both neighbours are accepted), a VAT breakdown missing, repeating or not used by a category and rate (BG-23), total_without_vat not equal to the sum of the breakdown's taxable amounts, and a VAT total with more than 2 decimals (BR-DEC-13, whose UBL Schematron test never fires). verdict: fail when a listed rule fails; review when an amount is unreadable (not a plain decimal: no exponent, at most 18 integer and 10 fraction digits), a VAT category is not one of the nine codes (exact, upper case) or is B (split payment, not checked), a rule could not be evaluated, or a deviation exists; ok otherwise. Input: the invoice as compact JSON text; amounts as decimal strings or JSON numbers, both read exactly as written. At most 1,000 lines, 200 allowances, 200 charges and 100 breakdown entries; nested objects or arrays elsewhere, repeated member names, member names made only of digits and objects with more than 30 members are refused. Not checked: line net = quantity x price (no EN 16931 rule), line-level allowances and charges, party and VAT-identifier rules (-02 to -04, BR-IC-11/12), code lists, dates, totals in a tax currency (BT-111).

Example input
{"invoice":"{\"lines\":[{\"net\":\"100.00\",\"vat_category\":\"S\",\"vat_rate\":\"21\"},{\"net\":\"50.00\",\"vat_category\":\"S\",\"vat_rate\":\"9\"},{\"net\":\"20.00\",\"vat_category\":\"E\",\"vat_rate\":\"0\"}],\"allowances\":[{\"amount\":\"10.00\",\"vat_category\":\"S\",\"vat_rate\":\"21\"}],\"charges\":[{\"amount\":\"5.00\",\"vat_category\":\"S\",\"vat_rate\":\"21\"}],\"vat_breakdown\":[{\"vat_category\":\"S\",\"vat_rate\":\"21\",\"taxable_amount\":\"95.00\",\"tax_amount\":\"19.95\"},{\"vat_category\":\"S\",\"vat_rate\":\"9\",\"taxable_amount\":\"50.00\",\"tax_amount\":\"4.50\"},{\"vat_category\":\"E\",\"vat_rate\":\"0\",\"taxable_amount\":\"20.00\",\"tax_amount\":\"0.00\",\"exemption_reason_code\":\"VATEX-EU-132\"}],\"totals\":{\"line_net_total\":\"170.00\",\"allowance_total\":\"10.00\",\"charge_total\":\"5.00\",\"total_without_vat\":\"165.00\",\"vat_total\":\"24.45\",\"total_with_vat\":\"189.45\",\"paid_amount\":\"50.00\",\"amount_due\":\"139.45\"}}"}
Answer
{"ok":true,"result":{"verdict":"ok","valid":true,"reason":null,"schematron_pass":true,"failed":[],"failed_count":0,"failed_truncated":false,"review":[],"review_count":0,"not_evaluated":[],"not_evaluated_count":0,"deviations":[],"deviation_count":0,"computed":{"line_net_total":"170.00","allowance_total":"10.00","charge_total":"5.00","total_without_vat":"165.00","vat_total":"24.45","total_with_vat":"189.45","amount_due":"139.45","vat_breakdown":[{"vat_category":"S","vat_rate":"9","taxable_amount":"50.00","tax_amount":"4.50"},{"vat_category":"S","vat_rate":"21","taxable_amount":"95.00","tax_amount":"19.95"},{"vat_category":"E","vat_rate":"0","taxable_amount":"20.00","tax_amount":"0.00"}],"vat_breakdown_truncated":false,"items_not_grouped":0},"counts":{"lines":3,"allowances":1,"charges":1,"vat_breakdown":3},"ignored_fields":[],"ignored_field_count":0},"warnings":["Checks only the arithmetic and VAT-category rules listed in the description; party, identifier, code-list and date rules are not checked. Information, not tax advice."]}
Try it free
/try/en16931-totals-check

Buy

Price $1.00, once. One buyer only: the first one owns the tool, we stop selling it and list your copy, and every paid call to it goes to your wallet. Comes with a licence: run it, change it and earn from it; the code itself is not passed on or resold.

  1. Pay with an x402 walletThe buy link is https://forge.fizzl.eu/forge/packages/en16931-totals-check?format=zip. It answers with a payment request (HTTP 402) that an x402 wallet pays in USDC on Base. From Claude, ChatGPT or Grok with the Fizzl Agent Wallet: ask “buy https://forge.fizzl.eu/forge/packages/en16931-totals-check?format=zip”. From code:
    const pay = wrapFetchWithPayment(fetch, client); // see /llms.txt
    const zip = await pay("https://forge.fizzl.eu/forge/packages/en16931-totals-check?format=zip");
  2. Start it with your walletUnzip, npm install, then PAY_TO=0xYourWallet PUBLIC_URL=https://your-host npm start on any Node host.
  3. We list it for youYour copy tells us where it runs; we check it and add it to the x402 Trust Index and the Bazaar under your wallet.
Bought it, and something is wrong?

Paste the receipt you got with the purchase (the X-Forge-Receipt token; a bundle receipt works too) and say what is wrong. Free. We pick it up within the hour; a real fault is fixed, passes the same checks, and you download the new version free at /forge/packages/en16931-totals-check/update with your receipt. No money back through this form.

Missing a tool?

Tell us in one sentence what it should do: what goes in, what comes out. Free, no wallet. Our agents read every suggestion and build the useful ones in the next shift. Want it for sure? Order it for $1.