{"uid":"cap_NfYL923SfwtYVYly2oGp1","slug":"invoice-three-way-match-audit-191b567e","name":"Invoice Three-Way Match Audit","description":"Public static preview plus paid token controls, risk consensus, AI security, webhook reliability, developer security, schedule risk, decision analysis, API release compatibility, accounts-payable reconciliation, e-commerce return eligibility, SaaS subscription-proration, sales-commission reconciliation, parcel-charge reconciliation, SLA service-credit reconciliation, advertising spend-and-fee audit, contract-renewal audit, workforce timecard reconciliation, hotel booking-commission reconciliation, and warehouse cycle-count adjustment reconciliation products for autonomous agents.","url":"https://rooke-token-risk-pilot.rookepoole.workers.dev/v1/x402/invoice-three-way-match-audit","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"invoice":{"type":"object","required":["invoiceId","vendorId","currency","lines","declaredSubtotalMinor","taxMinor","shippingMinor","declaredTotalMinor"],"properties":{"lines":{"type":"array","items":{"type":"object","required":["invoiceLineId","poLineId","invoicedQuantity","unitPriceMinor","lineAmountMinor"],"properties":{"poLineId":{"type":"string","maxLength":120,"minLength":1},"invoiceLineId":{"type":"string","maxLength":120,"minLength":1},"unitPriceMinor":{"type":"integer","maximum":1000000000,"minimum":0},"lineAmountMinor":{"type":"integer","maximum":1000000000000000,"minimum":0},"invoicedQuantity":{"type":"number","maximum":1000000,"exclusiveMinimum":0}},"additionalProperties":false},"maxItems":200,"minItems":1},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"taxMinor":{"type":"integer","default":0,"maximum":1000000000000000,"minimum":0},"vendorId":{"type":"string","maxLength":120,"minLength":1},"invoiceId":{"type":"string","maxLength":120,"minLength":1},"shippingMinor":{"type":"integer","default":0,"maximum":1000000000000000,"minimum":0},"declaredTotalMinor":{"type":"integer","maximum":1000000000000000,"minimum":0},"declaredSubtotalMinor":{"type":"integer","maximum":1000000000000000,"minimum":0}},"additionalProperties":false},"receipts":{"type":"array","items":{"type":"object","required":["receiptId","lines"],"properties":{"lines":{"type":"array","items":{"type":"object","required":["poLineId","receivedQuantity","rejectedQuantity"],"properties":{"poLineId":{"type":"string","maxLength":120,"minLength":1},"receivedQuantity":{"type":"number","maximum":1000000,"exclusiveMinimum":0},"rejectedQuantity":{"type":"number","default":0,"maximum":1000000,"minimum":0}},"additionalProperties":false},"maxItems":200,"minItems":1},"receiptId":{"type":"string","maxLength":120,"minLength":1}},"additionalProperties":false},"maxItems":500},"tolerances":{"type":"object","default":{"quantityOverageBps":0,"amountRoundingMinor":0,"unitPriceOverageBps":0},"required":["quantityOverageBps","unitPriceOverageBps","amountRoundingMinor"],"properties":{"quantityOverageBps":{"type":"integer","default":0,"maximum":10000,"minimum":0},"amountRoundingMinor":{"type":"integer","default":0,"maximum":10000,"minimum":0},"unitPriceOverageBps":{"type":"integer","default":0,"maximum":10000,"minimum":0}},"additionalProperties":false},"purchaseOrder":{"type":"object","required":["purchaseOrderId","vendorId","currency","lines"],"properties":{"lines":{"type":"array","items":{"type":"object","required":["poLineId","orderedQuantity","previouslyInvoicedQuantity","unitPriceMinor"],"properties":{"sku":{"type":"string","maxLength":200,"minLength":1},"poLineId":{"type":"string","maxLength":120,"minLength":1},"unitPriceMinor":{"type":"integer","maximum":1000000000,"minimum":0},"orderedQuantity":{"type":"number","maximum":1000000,"exclusiveMinimum":0},"previouslyInvoicedQuantity":{"type":"number","default":0,"maximum":1000000,"minimum":0}},"additionalProperties":false},"maxItems":200,"minItems":1},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"vendorId":{"type":"string","maxLength":120,"minLength":1},"purchaseOrderId":{"type":"string","maxLength":120,"minLength":1}},"additionalProperties":false}}},"responseSchema":{"type":"json","example":{"summary":{"invoiceLineCount":1,"matchedLineCount":1,"reviewExceptionCount":0,"blockingExceptionCount":0,"potentialOverpaymentExposureMinor":0},"verdict":"MATCHED_WITHIN_TOLERANCE","currency":"USD","exceptions":[],"reportHash":"sha256-hex","tolerances":{"quantityOverageBps":0,"amountRoundingMinor":0,"unitPriceOverageBps":0},"documentIds":{"invoiceId":"INV-9001","receiptIds":["GR-88"],"purchaseOrderId":"PO-1042"},"evidenceGaps":["CALLER_SUPPLIED_DOCUMENTS_NOT_AUTHENTICATED"],"claimBoundary":{"paymentApproved":false,"paymentExecuted":false},"schemaVersion":"INVOICE_THREE_WAY_MATCH_AUDIT_V1","lineComparisons":[],"requestCommitment":"sha256-hex","recommendedDisposition":"ELIGIBLE_FOR_CONFIGURED_APPROVAL_WORKFLOW"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"5","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":"$5/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"5","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"5","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_U-xWt0U7cCbNongKEGcKk","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"5","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Validates an invoice against a purchase order and goods receipts, detecting quantity discrepancies, price mismatches, and arithmetic errors to determine if the invoice is eligible for payment approval.","exampleAgentPrompt":"Run a three-way match audit on invoice INV-9001 from vendor V-42 for $1,250.00 USD — it has one line matching PO line PO-L-7 for 10 units at $125.00 each — and check it against goods receipt GR-88 which shows 10 units received and 0 rejected, with no quantity or price tolerance buffers.","exampleUseCases":[{"title":"Pre-payment vendor invoice check","prompt":"Before we pay this invoice from Acme Supplies — INV-2024-0055, vendor ACM-001, $4,800 USD total, 3 line items each tied to PO-7712 lines — can you run a three-way match against our two goods receipts GR-201 and GR-202 and tell me if there are any discrepancies or if it's safe to approve?"},{"title":"Detecting overcharged unit prices","prompt":"We got an invoice from vendor PARTS-CO, invoice ID INV-5500, claiming $15,000 USD for 500 units at $30 each on PO line PO-L-99, but our receipt GR-310 only shows 480 units received. Run a three-way match with zero tolerance and flag any overpayment exposure."},{"title":"Automated AP reconciliation with rounding tolerance","prompt":"Audit invoice INV-88321 from vendor SUP-17 — total declared as $9,999.50 USD across 5 lines tied to purchase order lines — against receipts GR-400 through GR-403, and allow up to 50 basis points of quantity overage and $100 rounding tolerance so minor discrepancies don't block payment approval."}],"resultDescription":"Returns a structured audit report including a top-level verdict (e.g. MATCHED_WITHIN_TOLERANCE or EXCEPTION), a recommended disposition for the approval workflow, a list of blocking and review exceptions with details, per-line comparisons of invoiced vs. received quantities and prices, potential overpayment exposure in minor currency units, applied tolerance settings, a SHA-256 report hash for audit trail, and evidence gap disclosures (e.g. documents not independently authenticated).","failureModes":["Invoice lines referencing PO line IDs not present in receipts — results in evidence gap or exception","Declared total does not match sum of line amounts plus tax and shipping — triggers arithmetic exception","invoicedQuantity exceeds receivedQuantity beyond tolerance — blocking exception flagged","Unit price overage beyond configured basis points — exception raised","Malformed currency code or missing required fields — validation error returned","Receipt array empty or missing lines for referenced PO lines — evidence gap flagged"],"whenToPreferThis":"Choose this endpoint when you need automated, structured validation that an invoice matches both a purchase order and goods receipts before approving payment — especially in autonomous AP workflows where a machine-readable verdict and disposition recommendation are required. It is well-suited for per-invoice spot checks or automated pipeline integration where configurable tolerances (quantity overage, price overage, rounding) need to be applied consistently. Prefer this over manual review or general-purpose LLM analysis when you need a deterministic, auditable report hash and structured exception list for downstream workflow decisions.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:41:16.947Z","isFirstParty":false}