Content
# Receipt Extraction
Turn receipts and invoices into structured, validated JSON — vendor, line items, tax, totals — with
Australian GST and ABN checksum validation built in from day one. One API call, no hand-rolled
vision-LLM prompts, no re-deriving ABN/GST rules from the ATO's own documentation.
## What it does
- Accepts a receipt/invoice image or PDF (base64), returns a clean, versioned `Receipt` JSON object.
- Validates the vendor's ABN (11-digit modulus-89 checksum) and cross-checks GST across line items and
totals, correctly excluding non-creditable GST on entertainment-coded expenses.
- Works as an MCP server (`extract_receipt` tool) or a plain HTTPS API — usable from Claude, Cursor, or
any HTTP client.
### Example (MCP tool call)
```json
{
"tool": "extract_receipt",
"input": { "document_base64": "<base64 image or PDF>", "mime_type": "image/jpeg" }
}
```
```json
{
"vendor": { "name": "Acme Pty Ltd", "abn": "51824753556", "abn_valid": true },
"date": "2026-07-14",
"line_items": [{ "description": "Widget", "qty": 2, "unit_price": 12.5, "gst": 2.5, "tax_code": "taxable" }],
"totals": { "subtotal": 25.0, "gst": 2.5, "total": 27.5 },
"schema_version": "1.0"
}
```
## Pricing
- **Free** — 20 documents/month, no card required.
- **Pay-as-you-go** — $0.02/document, no minimum.
- **Pro** — $19/month for 1,500 documents (~$0.013/doc effective), with priority support.
## Getting a key
The MCP server is live at `https://acjlabs-receipt-extraction.acjlabs.workers.dev/mcp`. Free-tier keys
self-serve — `POST /v1/signup` with `{ "email": "you@example.com" }` returns your key directly in the
response, good for 20 documents/month, no card required. **Store it immediately — it is shown once and
cannot be recovered if lost** (re-signup for a new one). Paid keys provision the same way via a
one-time claim link once Pro/pay-as-you-go billing is live.
## Connecting it to an MCP client
With Claude Code:
```bash
claude mcp add --transport http receipt-extraction \
https://acjlabs-receipt-extraction.acjlabs.workers.dev/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
```
Any other MCP client that supports a remote HTTP server with a custom header (Cursor, Cline, VS Code,
etc.) works the same way: point it at the URL above with an `Authorization: Bearer YOUR_API_KEY`
header. A gateway or scanner that can only forward the raw key value (no `Bearer` prefix) also works —
both forms authenticate. Tool discovery (`initialize`/`tools/list`) doesn't require a key at all; only
calling `extract_receipt` does.
## How accurate is it?
Validated 4/4 against hand-built (but genuinely readable) test documents covering net-priced,
GST-inclusive-only, checksum-invalid-ABN, and unreadable-document cases. Real production accuracy
across more document formats will be tracked once live traffic exists.
## npm client
Prefer a typed function over hand-rolling MCP JSON-RPC calls? `@acjlabs/receipt-extraction-client`
(`client/`, not published yet — npm publish is a gated founder action) wraps the `extract_receipt`
tool call:
```ts
import { createReceiptExtractionClient } from "@acjlabs/receipt-extraction-client";
const client = createReceiptExtractionClient({
baseUrl: "https://acjlabs-receipt-extraction.acjlabs.workers.dev",
apiKey: "...",
});
const receipt = await client.extractReceipt(base64EncodedImageOrPdf, "image/png");
```
## Why not just use generic OCR?
Generic OCR APIs (Mindee, Veryfi) extract raw fields but don't know that an Australian ABN has an
11-digit checksum, or that GST apportionment differs for entertainment expenses — you'd build and
maintain that yourself. See the [full comparison](docs/comparison.md), or read
[why AU GST rules break most receipt-extraction tools](docs/au-gst-receipt-extraction.md) (the ABN
checksum, the three real GST cases, and how to test any tool against them).
## Source availability & support
This repository hosts the documentation for the hosted service. The service implementation is not open source. Bug reports and feature requests are welcome in this repo's Issues; you can also reach us at <contact@acjlabs.com>.