Invoice Total
invoice_totalTotal an invoice: per-line totals, subtotal, discount, tax, grand total. FREE.
Typical input {"line_items": [{"desc": "Design", "qty": 2, "unit_price": 50}], "tax_pct": 8.5, "discount_pct": 10} returns {"lines": [{"desc": "Design", "qty": 2, "unit_price": 50, "line_total": 100.0}], "subtotal": 100.0, "discount": 10.0, "tax": 7.65, "total": 97.65}.
Use when several line items roll up with discount and tax. Not for one transaction's fees (processor_fees) and not for spreading a total over time (installment_plan). Errors: on invalid, missing, or malformed input this tool never raises a protocol error — it returns {"error": ""} (for example {"error": "line_items must contain at least one item,"}). Every call is read-only and idempotent, so after correcting the input it is always safe to retry.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tax_pct | No | Tax percentage applied after the discount, e.g. 8.5. Default 0. | |
| line_items | Yes | At least one line item object {"desc": str, "qty": number, "unit_price": number}; the first 100 items are used. | |
| discount_pct | No | Discount percentage applied to the subtotal. Default 0. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||