{"uid":"cap_29NPWPyutnkA7f2UFdNWm","slug":"tradepilot-invoice-totals-calculator-39a2ed91","name":"TradePilot Invoice Totals Calculator","description":"Calculate subtotal, per-line tax, discount and deposit from supplied invoice line items. Per-line tax percent (not a single flat rate), discount applied to the pre-tax subtotal, deposit as a percent-of-total or fixed amount clamped to the total. Pure arithmetic; does not create, store or send an invoice.","url":"https://www.tradepilotusa.com/api/agent-commerce/v1/services/invoice_totals_calculate/execute?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"line_items":{"type":"array","items":{"type":"object","required":["quantity","rate"],"properties":{"rate":{"type":"number","minimum":0},"quantity":{"type":"number","minimum":0},"tax_percent":{"type":"number","minimum":0}},"additionalProperties":false},"maxItems":200,"minItems":1},"deposit_type":{"enum":["percent","fixed"]},"deposit_value":{"type":"number","minimum":0},"deposit_enabled":{"type":"boolean"},"discount_percent":{"type":"number","maximum":100,"minimum":0}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_DZJ2IAsraonnUt8RBVJa9","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates subtotal, per-line tax, discount, and deposit amounts from invoice line items using pure arithmetic — no storage or sending involved.","exampleAgentPrompt":"Calculate the totals for my invoice with 3 line items: 5 units at $120 with 8% tax, 2 units at $75 with 0% tax, and 1 unit at $200 with 10% tax — apply a 5% discount and require a 25% deposit.","exampleUseCases":[{"title":"Contractor quote with mixed tax rates","prompt":"I need to calculate the total for a plumbing job invoice — I have 3 labor hours at $95/hr with 0% tax, 4 parts at $40 each with 8.5% tax, and a $150 travel fee with 0% tax. Apply a 10% discount and set a fixed deposit of $100."},{"title":"Retail order summary with percent deposit","prompt":"Can you work out the invoice totals for an order with 12 units at $30 each taxed at 7%, and 3 units at $85 each taxed at 7%? I want to give a 5% discount on the subtotal and collect a 20% deposit upfront."},{"title":"Service business pre-payment breakdown","prompt":"I need to figure out what my customer owes upfront — the invoice has 1 design consultation at $500 with no tax, and 8 hours of implementation at $75/hr with 6% tax. No discount, but I need a 50% deposit."}],"resultDescription":"Returns a computed breakdown including subtotal, per-line tax amounts, total tax, post-discount subtotal, deposit amount, and final invoice total — all as numeric values derived from the supplied line items and parameters. No data is stored or transmitted.","failureModes":["Missing required fields (quantity or rate on any line item) returns a validation error","line_items array empty or exceeding 200 items is rejected","discount_percent outside 0–100 range causes a validation failure","deposit_value negative is rejected","deposit_type provided without deposit_value or vice versa may cause incomplete calculation","Non-numeric values in rate, quantity, or tax_percent fields will be rejected"],"whenToPreferThis":"Choose this endpoint when you need deterministic, server-side invoice arithmetic with per-line tax rates (not a flat blanket rate), an optional pre-tax discount, and flexible deposit handling (percent-of-total or fixed amount). Ideal for trade, field service, or contractor workflows where line items carry different tax rates. Prefer this over client-side math when you need an authoritative computed result to display or pass downstream without storing the invoice.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T12:30:10.299Z","isFirstParty":false,"canonicalSlug":"tradepilot-invoice-totals-calculator-39a2ed91"}