{"uid":"cap_q9x2Uh7MGc10mSWlTm6WC","slug":"writerslogic-invoice-arithmetic-auditor-b633e090","name":"WritersLogic Invoice Arithmetic Auditor","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/invoice-audit?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","required":["quantity","unitPrice","amount"],"properties":{"id":{"type":"string","maxLength":80},"amount":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Stated net line amount after the line discount."},"taxRate":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Tax rate in percent, e.g. \"7.5\". With taxAmount it is checked. A non-zero rate without taxAmount cannot be checked: the result is unknown, and no tax is inferred."},"discount":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Line discount as a positive amount in major units."},"quantity":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"taxAmount":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Tax on this line as supplied."},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Price per unit in major units; sub-cent precision allowed."}},"additionalProperties":false},"maxItems":500,"minItems":1},"stated":{"type":"object","properties":{"total":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Grand total; checked against subtotal + taxTotal."},"subtotal":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"taxTotal":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"discountTotal":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Sum of line discounts."}},"additionalProperties":false},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO 4217 alphabetic code, upper case."},"exponent":{"type":"integer","maximum":8,"minimum":0},"rounding":{"enum":["half-up","half-down","half-even","up","down","ceiling","floor"],"type":"string","description":"Default half-up. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity."},"taxRounding":{"enum":["line","invoice"],"type":"string","description":"line (default): each line's tax is rounded on its own. invoice: tax is rounded once per distinct rate on the sum of the line amounts, and compared with the supplied tax sum for that rate."},"toleranceMinor":{"type":"integer","maximum":1000,"minimum":0,"description":"Largest absolute drift in minor units still treated as a match. Default 0."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_9C1980VYhgUi_X8QzE7v1","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Recomputes up to 500 invoice lines in exact decimal arithmetic and flags any mismatches between calculated and stated amounts, including line totals, subtotals, tax totals, discount totals, and grand totals.","exampleAgentPrompt":"Before I approve this invoice for payment, check the math on all the line items — make sure quantity times unit price minus discount equals each line amount, that the tax amounts match the stated 8.5% rate using per-line rounding, and that the subtotal, tax total, and grand total all add up correctly.","exampleUseCases":[{"title":"AP approval before payment","prompt":"I need to pay this vendor invoice but want to make sure the numbers are right first — can you audit all 24 line items to confirm that quantity times unit price minus any discounts equals each stated line amount, and that the subtotal, tax total, and grand total of $14,382.50 all check out?"},{"title":"Month-end reconciliation audit","prompt":"We're closing the books for June and I have 150 invoice lines to reconcile — please verify that every line's arithmetic is correct, the tax amounts are consistent with the 10% rate using per-invoice rounding, and that the stated totals match the sums."},{"title":"Flagging billing errors from a supplier","prompt":"This supplier invoice looks off — can you recompute all the line totals and check whether the discount of $200 and the grand total of $5,643.00 actually add up? I want to know exactly which lines are wrong and by how much before I dispute it."}],"resultDescription":"A structured report listing every arithmetic mismatch found: each entry identifies the JSON path of the erroneous field, the rule that was violated (e.g. quantity × unit price − discount = line amount), the expected value and actual value both expressed in minor units, and the signed drift. Lines and totals with no mismatch are implicitly correct. Totals not provided in the input are not checked.","failureModes":["Input contains JSON numbers instead of decimal strings — rejected because binary floats introduce imprecision","More than 500 line items submitted — request rejected with a validation error","Tax rate supplied without a corresponding tax amount — result marked as unknown, no tax is inferred","Missing required fields (quantity, unitPrice, or amount) on any line — validation error returned","Malformed decimal strings not matching the allowed pattern — schema validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to arithmetically verify an invoice before approving, paying, or reconciling it, and when exact decimal correctness matters. It is the right choice when you have structured invoice data with quantities, unit prices, discounts, and tax amounts and need to confirm all calculations are consistent. It does not look up tax rates, validate vendor identity, or check purchase-order terms — use other services for those concerns.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:38:35.719Z","isFirstParty":false,"canonicalSlug":"writerslogic-invoice-arithmetic-auditor-b633e090"}