# Invoice & Receipt Extraction API

> Invoice & Receipt Extraction API is a paid API for AI agents from x402-safe-upgrade-api.onrender.com, paid per call via x402, $0.02/call, status down (last checked 2026-10-12).

Extracts structured fields (reference numbers, amounts, dates, line items) from invoice or receipt document text.

## Facts

- Endpoint: POST https://x402-safe-upgrade-api.onrender.com/v1/invoice-receipt-extraction?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: down
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/invoice-receipt-extraction-api-e92fc4b1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_KYVp8KjcY2GibSgLaMgs0

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-receipt-extraction-api-e92fc4b1 -d '<json body>'
```

Example prompt: I have the full text of an invoice here — can you extract the structured fields from it, like the reference number, amounts, and dates? The document type is 'invoice'.

## When to prefer this

Use this endpoint when you have raw invoice or receipt text and need structured field extraction without storing the document. Ideal for automated accounts payable pipelines, expense automation, or any agent workflow that ingests billing documents as text. Prefer this over OCR services when the document text is already available; prefer over general LLM extraction when you want a cost-predictable, purpose-built API at $0.02/call.

## Known failure modes

- Document text too long (exceeds 200,000 character limit) — request rejected
- Malformed or unparseable document text — extracted fields may be empty or incomplete
- Ambiguous document format when using 'auto' type — may misclassify document
- Invalid documentType enum value — schema validation error
- Payment failure via x402 protocol — 402 response, no extraction performed

## How this service works

Evidence-backed npm package upgrade decisions for coding agents.

## Output

A JSON object containing an 'extracted' field with structured data pulled from the document, such as referenceNumber, amounts, dates, line items, vendor names, and other relevant billing fields found in the input text.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "documentText": {
   "type": "string",
   "maxLength": 200000,
   "description": "Content supplied by the caller only; it is processed in memory and not retained."
  },
  "documentType": {
   "enum": [
    "auto",
    "invoice",
    "receipt"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "extracted": {
   "referenceNumber": "INV-100"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/invoice-receipt-extraction-api-e92fc4b1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-safe-upgrade-api.onrender.com](https://www.zero.xyz/host/x402-safe-upgrade-api.onrender.com/llms.txt)
