# Invoice Three-Way Match Audit

> Invoice Three-Way Match Audit is a paid API for AI agents from rooke-token-risk-pilot.rookepoole.workers.dev, paid per call via x402, $5/call, status unknown (last checked 2026-09-15).

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.

## Facts

- Endpoint: POST https://rooke-token-risk-pilot.rookepoole.workers.dev/v1/x402/invoice-three-way-match-audit
- Price: $5/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/invoice-three-way-match-audit-191b567e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_NfYL923SfwtYVYly2oGp1

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability invoice-three-way-match-audit-191b567e -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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).

## Request schema (JSON Schema)

```json
{
 "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",
     
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "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"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/invoice-three-way-match-audit-191b567e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from rooke-token-risk-pilot.rookepoole.workers.dev](https://www.zero.xyz/host/rooke-token-risk-pilot.rookepoole.workers.dev/llms.txt)
