Run the arithmetic and tax-split checks over an INV-01 payload
validate_payloadRun the parser's consistency checks on an INV-01 payload: item totals, invoice total, value-block sums, and tax split. Returns valid, warning paths, and schema errors without re-reading document.
Instructions
Take an INV-01 payload you already have and run the same consistency checks the parser runs, without re-reading any document. Useful for a payload you assembled yourself, or one you edited after parsing.
Four checks run: each item's total against its own components; the invoice total against the value block; each value-block total against the sum of the item fields; and the CGST/SGST-versus-IGST split against the two parties' state codes.
Comparisons use a rupee tolerance (0.05 by default), never exact equality, because real invoices round to the nearest rupee and exact comparison would flag almost every genuine document.
Returns valid (true when nothing was flagged), the warning list with the exact field path for each, and schema_error when the payload does not fit INV-01 at all. The tax-split check reports itself as skipped, as an informational note rather than a warning, under reverse charge and when the place of supply differs from the buyer's registered state, because it cannot evaluate those cases.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| invoice | Yes | ||
| tolerance | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||