# Invoice & Receipt Parser API

> Invoice & receipt parser: PDF, scan or photo to JSON with VAT IDs, lines, taxes and math checks.

**Stop retyping invoices.** Send a **PDF** (digital or scanned), a **photo** of a receipt or an **e-invoice XML**, and get the data your books need: **supplier** with **VAT and company IDs**, **invoice number**, **dates**, **currency**, every **line item**, **taxes by rate**, **totals**, **payment terms** and **IBAN**. Then the API **re-adds the figures itself** and flags what does not add up, so a misread price never slips into your ledger. Any language, any currency, from about **$0.01 per page**.

- Host: `invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com`
- Base URL: `https://invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com/v1/invoices`
- Auth: headers `X-RapidAPI-Key` and `X-RapidAPI-Host`
- OpenAPI: https://helenis-api.com/docs/invoices/openapi.json

## Endpoints

### Invoice Parsing

Invoices and receipts to accounting JSON, with checks.

#### Parse Invoice from URL

`POST /v1/invoices/parse`

Parse an invoice or receipt from its URL. Parse an invoice or receipt from its URL into JSON: parties with VAT IDs, number, dates, line items, taxes, totals, IBAN, plus arithmetic checks. PDF, photo, or e-invoice XML (Factur-X, ZUGFeRD, UBL, read without AI). 1 credit per page read by the AI; 1 for an e-invoice's XML.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `url` | body | `string` | yes | Direct link to an invoice or receipt: PDF (digital or scanned), photo or scan (JPEG, PNG, WEBP, HEIC, GIF, BMP, TIFF), or an e-invoice XML (Factur-X / ZUGFeRD CII, UBL, XRechnung), up to 20 MB. | `https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare...` |
| `pages` | body | `string` | no | PDF pages to read, e.g. '1-2'. All pages when empty (30 at most). 1 credit per page read. | `1-2` |
| `password` | body | `string` | no | Password of an encrypted PDF. |  |

```bash
curl -X POST "https://invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com/v1/invoices/parse" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/saeco.pdf"
  }'
```

#### Parse Uploaded Invoice

`POST /v1/invoices/parse/upload`

Parse an uploaded invoice or receipt. Same as /parse, for a file sent as multipart/form-data (field `file`).

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `file` | form | `file` | yes | PDF, image or e-invoice XML, up to 20 MB. |  |
| `pages` | form | `string` | no | PDF pages to read, e.g. '1-2'. All pages when empty (30 at most). 1 credit per page read. |  |
| `password` | form | `string` | no | Password of an encrypted PDF. |  |

```bash
curl -X POST "https://invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com/v1/invoices/parse/upload" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com" \
  -F "file=@./my-file"
```

## Sample call

Parse Invoice from URL: `POST /v1/invoices/parse`.

```bash
curl -X POST "https://invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com/v1/invoices/parse" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: invoice-receipt-parser-pdf-image-to-json.p.rapidapi.com" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/saeco.pdf"
  }'
```

## Response

```json
{
  "document_type": "invoice",
  "language": "nl",
  "number": "VF1005193039",
  "issue_date": "2022-09-08",
  "due_date": "2022-09-22",
  "purchase_order": "SCONL000000444",
  "currency": "EUR",
  "supplier": {
    "name": "e-Luscious Nederland B.V. iov Saeco.com",
    "vat_id": "NL8152.54.295.B01",
    "tax_ids": [{ "type": "Kvk", "value": "04080176" }],
    "address": "Badweg 48, 8401 BL, Gorredijk",
    "country": "NL"
  },
  "customer": { "name": "Strategic Corp", "tax_ids": [], "country": "NL" },
  "lines": [
    {
      "description": "Onderhoudsset CA6707/10",
      "code": "E103184",
      "quantity": 1.0,
      "unit": "PCS",
      "unit_price": 49.99,
      "tax_rate": 21.0,
      "total": 49.99
    },
    {
      "description": "SX Flyer SAECO Korting KVDNL",
      "code": "E103560",
      "quantity": 1.0,
      "unit": "PCS",
      "unit_price": 0.0,
      "tax_rate": 21.0,
      "total": 0.0
    }
  ],
  "amounts_include_tax": true,
  "totals": {
    "subtotal": 41.31,
    "taxes": [{ "rate": 21.0, "base": 41.31, "amount": 8.68, "label": "21 %" }],
    "tax_total": 8.68,
    "total": 49.99
  },
  "payment": { "method": "card", "iban": "NL58RABO0198723202", "bic": "RABONL2U" },
  "expense_category": "shopping",
  "source": "https://raw.githubusercontent.com/invoice-x/invoice2data/master/tests/compare/saeco.pdf",
  "mime_type": "application/pdf",
  "method": "ai",
  "page_count": 1,
  "pages_read": 1,
  "validation": {
    "consistent": true,
    "checks": [
      { "name": "line_math", "status": "ok", "detail": "2 line(s) checked." },
      { "name": "lines_sum", "status": "ok", "expected": 49.99, "found": 49.99, "difference": 0.0, "detail": "Sum of the line amounts against the subtotal or total." },
      { "name": "tax_rates", "status": "ok", "detail": "1 tax rate(s) checked." },
      { "name": "tax_sum", "status": "ok", "expected": 8.68, "found": 8.68, "difference": 0.0, "detail": "Sum of the taxes by rate against the tax total." },
      { "name": "total", "status": "ok", "expected": 49.99, "found": 49.99, "difference": 0.0, "detail": "Subtotal + tax (+ charges - discount + tip) against the total." },
      { "name": "amount_due", "status": "skipped", "detail": "Total, amount paid or amount due missing." },
      { "name": "iban", "status": "ok", "detail": "IBAN checksum valid." }
    ]
  }
}
```

*From a real response.* Empty fields are left out. A receipt photo works the same way, here a Polish supermarket receipt with its discount line:

```json
{
  "document_type": "receipt",
  "issue_date": "2020-01-09",
  "issue_time": "13:18",
  "currency": "PLN",
  "supplier": { "name": "Biedronka", "vat_id": "PL7791011327", "address": "ul. Żniwna 5, 62-025 Kostrzyn", "country": "PL" },
  "lines": [
    { "description": "ChlebPszen-Żyt550g", "quantity": 1.0, "unit_price": 1.99, "total": 1.99 },
    { "description": "Ser ż.Świat. 150g", "quantity": 1.0, "unit_price": 3.29, "total": 3.29 },
    { "description": "Polędw łos 100g", "quantity": 1.0, "unit_price": 4.99, "total": 4.99 },
    { "description": "Rabat", "total": -2.0 }
  ],
  "amounts_include_tax": true,
  "totals": { "taxes": [{ "rate": 5.0, "base": 7.88, "amount": 0.39, "label": "PTU C" }], "tax_total": 0.39, "total": 8.27, "amount_paid": 8.27 },
  "payment": { "method": "card" },
  "expense_category": "groceries"
}
```

## Why developers pick this API

- 🧮 **Numbers you can trust:** the model copies what is printed and never computes; the API does the arithmetic and tells you exactly which check failed, with the expected and the printed value.
- 💸 **A fraction of the usual price:** about **$0.01 per page** on PRO. Popular invoice APIs charge $0.015 to $0.12 per document on RapidAPI, $0.08 to $0.16 at Veryfi (with a $500 monthly minimum), $0.01 to $0.04 per document on Apify. Failed calls use 0 credits.
- 🇫🇷 **Ready for e-invoicing:** a Factur-X or ZUGFeRD PDF is read from its embedded XML, exact to the cent, for 1 credit whatever its length.
- 🔒 **Privacy by design:** no personal contact data in the output (a private customer's name, address, email or phone are never returned), masked card and bank numbers are dropped, and documents are not stored.

## The checks

| `name` | What is re-added |
|---|---|
| `line_math` | quantity x unit price (less the line discount, with or without tax) against each line amount |
| `lines_sum` | the line amounts against the subtotal (net lines) or the total (receipts, tax included) |
| `tax_rates` | taxable base x rate against each tax amount |
| `tax_sum` | the taxes by rate against the tax total |
| `total` | subtotal + tax + charges - discount + tip against the grand total |
| `amount_due` | total - amount paid against the amount due |
| `iban` | the ISO 13616 checksum of the supplier's IBAN (an IBAN that fails it is flagged and left out: you never get an account number that cannot exist) |

`validation.consistent` is `true` when every check that could run passed, `false` as soon as one figure does not add up (send that document for review), `null` when the document gave nothing to check. Rounding of one cent per line is tolerated.

## E-invoices (Factur-X, ZUGFeRD, UBL)

A PDF that carries its own XML (Factur-X, ZUGFeRD, or UBL as some ERPs attach it) is read from that XML: exact to the cent, `"method": "e-invoice"`, **1 credit** however long the PDF. You can also send the XML file itself (CII or UBL, XRechnung included). A Factur-X MINIMUM or BASIC WL file has no line items: the AI reads them from the pages and the XML's values win everywhere else (`"method": "e-invoice+ai"`).

```json
{
  "method": "e-invoice",
  "e_invoice": { "format": "UBL", "file": "UBL-Invoice-2.1.xml" },
  "number": "INV/2023/03/0008",
  "totals": { "subtotal": 262.9, "tax_total": 16.94, "total": 279.84, "amount_paid": 0.0, "amount_due": 279.84 },
  "...": "..."
}
```

## Errors

| Status | `code` | Meaning |
|---|---|---|
| 400 | `unsupported_file` | Not a PDF, an image or a CII / UBL invoice XML, or a damaged file. |
| 400 | `not_an_invoice` | The file holds no invoice, receipt or bill. Not billed. |
| 400 | `too_many_pages` | More than 30 pages: choose them with `pages`. |
| 400 | `pdf_encrypted` | Send the PDF's `password`. |
| 400 | `plan_limit` | The free BASIC plan reads 2 pages per call. |
| 400 | `invalid_url` / `site_unreachable` / `file_too_large` | The link is invalid or not reachable, or the file is over 20 MB. |
| 429 | `daily_limit_reached` | Daily safety limit of your plan; resets at 00:00 UTC. |
| 503 | `ai_error` / `capacity_exhausted` | The AI did not answer; retry. Not billed. |

## Limits

20 MB per file, 30 pages per call. Handwritten, faded or crumpled receipts are read as well as they can be, and the checks tell you when the result does not add up. No bounding boxes. Bank statements are not supported.

## Pricing

1 credit per page read by the AI (a photo is one page); an e-invoice XML, 1. Failed calls are never billed.

| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 2 / day | resets every day |
| PRO | $4.99/month | 480 / month | $0.11 per credit |
| ULTRA | $14.99/month | 1,440 / month | $0.11 per credit |
| MEGA | $49.99/month | 4,800 / month | $0.11 per credit |

Apify actor **Invoice & Receipt Parser - PDF & Photo to JSON**: billed per event; free-plan users get 5 documents of 2 pages per run.

| Event | Charged for | Price |
|---|---|---|
| `invoice-page` | each page read by the AI | $0.01 |
| `e-invoice` | each e-invoice read from its XML | $0.003 |

## Links

- API reference (HTML): https://helenis-api.com/docs/invoices
- OpenAPI: https://helenis-api.com/docs/invoices/openapi.json
- Overview and pricing: https://helenis-api.com/apis/invoices/
- RapidAPI listing: https://rapidapi.com/helenis-api-helenis-api-business/api/invoice-receipt-parser-pdf-image-to-json?utm_source=helenis&utm_medium=site&utm_campaign=invoices&utm_content=markdown
- Apify actor: https://apify.com/helenisapi/invoice-receipt-parser?utm_source=helenis&utm_medium=site&utm_campaign=invoices&utm_content=markdown
- MCP server (Apify): https://mcp.apify.com?tools=helenisapi/invoice-receipt-parser

MCP: Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify (your Apify token).

## Conventions (every Helenis API)

- Auth: two headers on every call, `X-RapidAPI-Key` (your key) and `X-RapidAPI-Host` (the API's host). One RapidAPI key works for every API you subscribe to.
- Billing in credits: one for a simple call, more for heavier work (a minute of audio, a page read by AI). Each API states its rule.
- Failed calls are never billed: a `4xx` bills zero credits and a `5xx` is never counted.
- Errors share one envelope: `{"error": {"status", "code", "message"}}` with a stable machine-readable `code`.
- `400`: fix the input (validation errors are always 400, never 422); not billed.
- `429`: rate limit; wait for `Retry-After`. `503`: temporary upstream or AI failure (`ai_error`, `upstream_timeout`); retry later, not billed.
- Values the source does not give come back as `null`, never invented.
