# SchemaLock Invoice Extractor

> SchemaLock Invoice Extractor is a paid API for AI agents from doc-extract-api.thestarboy9696-4ef.workers.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-14).

Extracts structured, financially-validated JSON (vendor, line items, subtotal, tax, total, dates, payment terms) from an invoice PDF or image file.

## Facts

- Endpoint: GET https://doc-extract-api.thestarboy9696-4ef.workers.dev/extract/invoice
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/schemalock-invoice-extractor-1299389f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_sFirXjAngpfgQ54Sk854S

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 schemalock-invoice-extractor-1299389f
```

Example prompt: Can you extract all the structured data from this invoice PDF — vendor name, every line item, subtotal, tax, and total — and validate that the numbers actually add up?

## When to prefer this

Choose SchemaLock when you need financially-validated structured JSON from an invoice — not just raw OCR text — and require cross-checked totals, validated dates and currency, per-field confidence scores, and automatic retry logic. Prefer this over generic OCR or text-extraction APIs when the downstream system needs machine-readable invoice data with arithmetic validation built in.

## Known failure modes

- Unreadable or heavily degraded image/PDF may result in low-confidence or missing fields
- Unsupported file format or corrupt file returns extraction failure
- Handwritten or non-standard invoice layouts may produce inaccurate line item parsing
- Math validation failure flagged when invoice totals don't reconcile with line items
- Network timeout on very large files
- Payment not received or insufficient USDC balance returns 402 error

## How this service works

SchemaLock — extract structured JSON data from an invoice PDF or image (vendor, line items, subtotal, tax, total, dates, payment terms). Unlike generic OCR (raw text) or text-only extraction APIs, this takes the raw file directly and validates against source math: line items checked against subtotal/tax/total, dates and currency checked, one automatic retry. If it still fails after that, you aren't charged — settlement is skipped, not just flagged.

## Output

A financially-validated JSON object containing: vendor details, an array of line items (description, quantity, unit price, line total), subtotal, tax amount, grand total, invoice date, due date, payment terms, currency, and per-field confidence scores. Totals are cross-checked against line items; the service performs one automatic retry on failure.

## 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": {
     "properties": {}
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/schemalock-invoice-extractor-1299389f/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from doc-extract-api.thestarboy9696-4ef.workers.dev](https://www.zero.xyz/host/doc-extract-api.thestarboy9696-4ef.workers.dev/llms.txt)
