{"slug":"api-zfinia-com-x402-v1-invoice-arithmetic-audit-0a9ed3","title":"Recompute an invoice exactly and report where it disagrees with itself","host":"api.zfinia.com","method":"POST","resource":"https://api.zfinia.com/x402/v1/invoice-arithmetic-audit","category":"code","description":"Recompute an invoice exactly and report where it disagrees with itself. Quantity times unit price is an exact decimal product. Rounding happens only where the stated policy says: per line, or once on the whole invoice. Those give different totals, so the difference between the two policies is publis","price_listed":0.22,"price_asked":0.22,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":4844,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"invoice":{"currency":"AUD","id":"INV-7781","lines":[{"description":"Widget","line_total":"59.97","quantity":"3","tax_amount":"6.00","tax_rate":"10","unit_price":"19.99"},{"description":"Washer","line_total":"7.03","quantity":"7","tax_amount":"0.70","tax_rate":"10","unit_price":"1.005"},{"description":"Service call","discount":"120.00","line_total":"-20.00","quantity":"1","tax_amount":"-1.82","tax_rate":"10","unit_price":"100.00"}],"subtotal":"47.00","tax_total":"4.88","total":"51.88"},"policy":{"round_per_line":true,"rounding":"half_up","tax_inclusive":false}},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"additionalProperties":false,"properties":{"invoice":{"additionalProperties":false,"properties":{"currency":{"maxLength":8,"type":"string"},"id":{"maxLength":128,"type":"string"},"lines":{"items":{"additionalProperties":false,"properties":{"description":{"maxLength":512,"type":"string"},"discount":{"type":["string","number"]},"line_total":{"type":["string","number"]},"quantity":{"type":["string","number"]},"tax_amount":{"type":["string","number"]},"tax_rate":{"type":["string","number"]},"unit_price":{"type":["string","number"]}},"required":["quantity","unit_price"],"type":"object"},"maxItems":500,"minItems":1,"type":"array"},"subtotal":{"type":["string","number"]},"tax_total":{"type":["string","number"]},"total":{"type":["string","number"]}},"required":["currency","lines"],"type":"object"},"policy":{"additionalProperties":false,"properties":{"minor_units":{"type":"object"},"round_per_line":{"type":"boolean"},"rounding":{"enum":["half_up","half_even","down","up"],"type":"string"},"tax_inclusive":{"type":"boolean"}},"type":"object"}},"required":["invoice"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-10-04","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.22,"price_match":true,"latency_ms":4844,"error":null}],"description_full":"Recompute an invoice exactly and report where it disagrees with itself. Quantity times unit price is an exact decimal product. Rounding happens only where the stated policy says: per line, or once on the whole invoice. Those give different totals, so the difference between the two policies is published rather than one being assumed correct. Also reports a figure with more decimal places than its currency has, and a discount larger than its line.","last_updated":"2026-10-04T08:37:05.271Z","schemes":["exact"]}