# SiteCheck Invoice Extractor

> SiteCheck Invoice Extractor is a paid API for AI agents from api.sitecheck-api.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-16).

Extracts structured invoice data from a PDF or text invoice and validates line item arithmetic

## Facts

- Endpoint: POST https://api.sitecheck-api.workers.dev/api/invoice/extract?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-16
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sitecheck-invoice-extractor-9ec0b352
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PX7S-Azg1U_bpI7bpp1sF

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 sitecheck-invoice-extractor-9ec0b352 -d '<json body>'
```

Example prompt: Can you extract the invoice details from this PDF — https://example.com/invoices/INV-42.pdf — and tell me the buyer, seller, line items, total, due date, and whether the numbers all add up correctly?

## When to prefer this

Choose this endpoint when you need to programmatically extract structured invoice fields from a PDF or raw invoice text and simultaneously verify the arithmetic consistency of the document. It is particularly useful for accounts-payable automation, pre-payment validation, or any workflow that needs to ingest invoices into a structured format without setting up a dedicated OCR pipeline. It accepts PDFs by URL, base64, or plain text, making it flexible for different document delivery methods.

## Known failure modes

- PDF URL unreachable or not a valid PDF returns error
- PDF has no text layer (scanned image-only PDF) may produce poor extraction quality
- Base64 payload exceeding 15 MB limit rejected
- Missing all three input fields (url, text, pdf_base64) returns validation error
- Arithmetic checks may fail if invoice has complex discount or multi-tax structures
- Model hallucination on ambiguous or poorly formatted invoices — disclaimer always returned

## How this service works

Structured data from an invoice: seller and buyer (name, address, tax ID), invoice number, dates, currency, line items, subtotal, tax, total and payment details, with null for anything absent. The arithmetic is checked (line sum against subtotal, subtotal plus tax against total) and mismatches are returned. PDF with a text layer by URL or base64, or plain text. Not live-checked: Workers AI is checked by the owner after the merge.

## Output

A JSON object containing the full structured invoice — buyer and seller (name, tax ID, address), invoice number, issue date, due date, currency, line items (description, quantity, unit price, amount, tax rate), subtotal, tax, total, and payment details (IBAN, reference). Also includes an array of arithmetic validation checks (e.g. line items sum to subtotal, subtotal plus tax equals total) each with ok/check/computed fields, the model used, the source of data, and a disclaimer to verify against the original document.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "https link to a PDF invoice with a text layer (JSON body field)"
  },
  "text": {
   "type": "string",
   "description": "The invoice text (JSON body field); or give url or pdf_base64 instead"
  },
  "pdf_base64": {
   "type": "string",
   "description": "The PDF as base64, up to 15 MB (JSON body field)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
  "checks": [
   {
    "ok": true,
    "check": "lineItems sum equals subtotal"
   },
   {
    "ok": true,
    "check": "subtotal plus tax equals total",
    "total": 24,
    "computed": 24
   }
  ],
  "source": "text in the request",
  "invoice": {
   "tax": 4,
   "buyer": {
    "name": "Acme GmbH",
    "taxId": "DE811907980",
    "address": "Unter den Linden 77, Berlin"
   },
   "total": 24,
   "seller": {
    "name": "Widgets Ltd",
    "taxId": "GB123456789",
    "address": "1 High Street, London"
   },
   "dueDate": "2026-10-31",
   "currency": "EUR",
   "subtotal": 20,
   "issueDate": "2026-10-01",
   "lineItems": [
    {
     "amount": 20,
     "taxRate": 20,
     "quantity": 2,
     "unitPrice": 10,
     "description": "Widget"
    }
   ],
   "invoiceNumber": "INV-42",
   "paymentDetails": {
    "iban": null,
    "reference": "INV-42"
   }
  },
  "checkedAt": "2026-10-15T00:00:00.000Z",
  "disclaimer": "Model extraction. Check the numbers against the document before paying or booking.",
  "allChecksPass": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sitecheck-invoice-extractor-9ec0b352/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.sitecheck-api.workers.dev](https://www.zero.xyz/host/api.sitecheck-api.workers.dev/llms.txt)
