# Rafid Invoice Anomaly Check

> Rafid Invoice Anomaly Check is a paid API for AI agents from api.rafidsystem.com, paid per call via x402, $0.25/call, status unknown (last checked 2026-10-10).

Analyzes an invoice for fraud indicators, duplicates, mismatches, and financial inconsistencies, returning a structured risk score and recommended action.

## Facts

- Endpoint: POST https://api.rafidsystem.com/api/v1/x402/finance/invoice-anomaly-check?utm_source=zero.xyz
- Price: $0.25/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/rafid-invoice-anomaly-check-20985f7b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_5vVZk1H1_iga6lCJhK0B1

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 rafid-invoice-anomaly-check-20985f7b -d '<json body>'
```

Example prompt: Can you run an anomaly check on this invoice from ABC Trading LLC — invoice number INV-2026-1043-A for $9,660 USD due October 20, with supplier ID SUP-291 — and tell me if it looks like a duplicate or if the bank details have changed?

## When to prefer this

Use this endpoint when you need structured, scored fraud and anomaly analysis on individual invoices before approving payment — especially when duplicate detection, bank account change alerts, PO contract mismatches, or financial math validation are required. Prefer this over generic rule-based checks when you want a context-aware risk score that incorporates supplier history, payment history, and escalation bonuses for multi-family risk signals.

## Known failure modes

- Missing required invoice fields cause validation errors
- Insufficient historical invoice data reduces anomaly detection accuracy
- Unrecognized supplier ID may limit context-aware scoring
- Ambiguous or incomplete PO reference prevents PO mismatch checks
- Network or service timeouts on large invoice payloads
- Payment authorization failure if x402 USDC balance is insufficient

## How this service works

Rafid Agent API provides structured intelligence and paid APIs for AI agents across property, company and risk, supplier, finance, document, website, automotive, logistics, recruitment, trading, voice, video and business-planning workflows.

## Output

Returns a structured JSON object containing: an overall risk score (0–100) and risk level (low/medium/high/critical), a decision recommendation (e.g. 'hold' or 'approve'), a list of detected anomalies with codes (e.g. POSSIBLE_DUPLICATE, BANK_ACCOUNT_CHANGED, PO_MISMATCH), severity levels and confidence scores per anomaly, financial validation results (tax, totals, line items), context used in the assessment, and a recommended action narrative. Also includes an invoice summary and a data completeness report.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "additionalProperties": true
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "context_aware",
  "scoring": {
   "model": "iac-1.0.0",
   "rawScore": 147.3,
   "components": [
    {
     "code": "POSSIBLE_DUPLICATE",
     "points": 36,
     "severity": "high",
     "basePoints": 40,
     "confidence": 0.9
    }
   ],
   "levelBands": {
    "low": "0-14",
    "high": "40-64",
    "medium": "15-39",
    "critical": "65-100"
   },
   "escalationBonus": 26,
   "cappedBySeverity": true,
   "escalationReasons": [
    "3 independent risk families with ≥ medium anomalies (duplicate, payment_details, po_contract)..."
   ],
   "lowSeverityPoints": 4.3,
   "highSeverityPoints": 117,
   "mediumSeverityPoints": 0
  },
  "summary": "4 anomalies detected (POSSIBLE_DUPLICATE, BANK_ACCOUNT_CHANGED, PO_MISMATCH, INVOICE_NUMBER_A...",
  "asOfDate": "2026-09-23",
  "decision": "hold",
  "anomalies": [
   {
    "code": "POSSIBLE_DUPLICATE",
    "field": "invoiceNumber",
    "evidence": {},
    "severity": "high",
    "confidence": 0.9,
    "explanation": "A same-supplier invoice with the same amount and a slightly altered invoice number (e.g. suff..."
   }
  ],
  "checkedAt": "2026-09-23T00:00:00.000Z",
  "riskLevel": "critical",
  "riskScore": 100,
  "contextUsed": {
   "contract": false,
   "purchaseOrder": true,
   "paymentHistory": 0,
   "approvalContext": false,
   "supplierProfile": false,
   "historicalInvoices": 4,
   "supplierHistoryMatched": 4
  },
  "limitations": [
   "The capability identifies invoice anomalies and risk indicators. It does not independently es..."
  ],
  "anomalyCount": 4,
  "invoiceSummary": {
   "total": 9660,
   "dueDate": "2026-10-20",
   "currency": "USD",
   "supplierId": "SUP-291",
   "invoiceDate": "2026-09-20",
   "supplierName": "ABC Trading LLC",
   "invoiceNumber": "INV-2026-1043-A",
   "lineItemCount": 1,
   "bankAccountMasked": "****6789"
  },
  "financialChecks": {
   "computed": {
    "tolerance": 0.01,
    "expectedTax": 460,
    "lineItemsSum": 9200,
    "expectedTotal": 9660
   },
   "taxValid": true,
   "totalValid": true,
   "subtotalValid": true,
   "lineTotalsValid": true
  },
  "dataCompleteness": {
   "missingRequiredFields": [],
   "missingRecommendedFields": []
  },
  "recommendedAction": "Compare this invoice with the matched invoice and supporting documents to rule out a duplicat..."
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/rafid-invoice-anomaly-check-20985f7b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.rafidsystem.com](https://www.zero.xyz/host/api.rafidsystem.com/llms.txt)
