# StructDoc Invoice Extractor

> StructDoc Invoice Extractor is a paid API for AI agents from structdoc-api.hp-vladic.workers.dev, paid per call via x402, $0.08/call, status unknown (last checked 2026-09-14).

Extracts structured invoice and receipt fields (line items, totals, vendor info, dates) from uploaded PDF or image documents using OCR and AI layout analysis.

## Facts

- Endpoint: POST https://structdoc-api.hp-vladic.workers.dev/invoice
- Price: $0.08/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/structdoc-invoice-extractor-56f0eef8
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__Q334gTHYYQ_HeUb7wa49

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 structdoc-invoice-extractor-56f0eef8 -d '<json body>'
```

Example prompt: I just got an invoice PDF from Acme Corp — can you pull out the vendor name, invoice number, line items, and total amount so I can enter it into our accounting system?

## When to prefer this

Choose this endpoint when you need to extract structured invoice or receipt fields — vendor, totals, line items, dates — from a PDF or image document without managing API keys, via a pay-per-call x402/USDC model. Ideal for AP automation, expense digitization, or feeding invoice data into downstream systems. Prefer over generic OCR when you specifically need invoice/receipt semantic fields structured automatically.

## Known failure modes

- Unsupported file format returns an error — only PDF and common image formats (JPEG, PNG, TIFF) are accepted
- Low-quality or blurry scans may result in incomplete or inaccurate field extraction
- Documents in languages outside the 100+ supported set may yield poor results
- Oversized files or very long multi-page documents may time out
- Payment failure via x402/USDC results in 402 response before processing begins
- Handwritten invoices may have lower accuracy than printed ones

## How this service works

Turn any document into structured data for AI agents — OCR, layout-to-Markdown, tables, key-value, invoice/receipt fields — from PDF/images in 100+ languages. Pay per call via x402 (USDC). No API keys.

## Output

A JSON object containing the detected model name (prebuilt-layout), page count, output format (markdown), and a structured content string with extracted invoice fields such as vendor name, invoice number, date, line items, subtotals, taxes, and grand total rendered as Markdown.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "description": "Document URL (PDF/image)"
  },
  "pages": {
   "type": "string",
   "description": "Page range e.g. \"1-5\""
  },
  "base64": {
   "type": "string",
   "description": "Base64 document bytes (≤~6MB)"
  },
  "features": {
   "type": "string",
   "description": "languages,barcodes,keyValuePairs"
  },
  "queryFields": {
   "type": "string",
   "description": "custom fields, comma-separated ≤8"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "model": "prebuilt-layout",
  "pages": 1,
  "format": "markdown",
  "content": "# ..."
 }
}
```

## More

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