> This page is for version v2024-05-25 (default).
> For other versions, use one of these documentation indexes:
> - v2024-05-25 (default): https://docs.monite.com/v-2024-05-25/llms.txt
> - v2024-01-31: https://docs.monite.com/v2024-01-31/llms.txt
> - v2023-09-01: https://docs.monite.com/v2023-09-01/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.monite.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.monite.com/_mcp/server.

# Monite OCR

## Overview

Monite’s OCR provides a flexible, standalone endpoint for extracting text data from documents across multiple formats, including PDF, JPG, and PNG. The Monite OCR returns a structured JSON response with all detected text data for contextual analysis, enabling use cases such as receipt parsing, contract analysis, or custom form data extraction. The response retains the extracted content without post-processing, allowing you to integrate and manipulate the data according to your specific requirements.

> **Info**
>
> This OCR endpoint is a generic one and is not meant to replace the existing [OCR for Accounts Payable (AP)](../../accounts-payable/payables/collect#about-monite-ocr).

### Considerations and limitations

* The OCR process is asynchronous and the processing time may vary according to the document size.
* The minimum image file size is 100 KB.
* The maximum image file size is 20 MB.
* Multipage PDF files can have up to 100 pages.

## Covered languages

While this is not an exhaustive list, Monite OCR guarantees tested coverage for the following languages:



## Create an OCR task

There are two ways you can send a document for OCR recognition:

* [Process file via URL](#url)
* [Upload from file](#file)

The OCR scanning might take up to 10-15 seconds, so it is recommended to poll the document every 5 seconds. In the meantime, the document's `status` field is set as `processing` and the `recognized_data` field is not populated yet.

The [webhook](../../references/webhooks#events) `ocr_task.finished` is triggered once the OCR has finished processing the file and storing the extracted data. The webhook will be triggered only if the `x-monite-entity-id` header parameter is provided.

### Process file via URL \[#url]

To process a file, thus creating an OCR task, call [`POST /ocr_tasks`](/api/ocr/post-ocr-tasks). The query parameter `document_type` is optional and its possible values are `invoice`, `credit_note`, and `receipt`. If `document_type` is not specified, the system will attempt to determine it automatically:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/ocr_tasks' \
  -H 'accept: application/json' \
  -H 'x-monite-version: 2024-05-25' \
  -H 'x-monite-entity-id: aad60980-e2d0-436d-aa68-b9463f39870c' \
  -H 'Content-Type: application/json' \
  -d '{
        "document_type": "invoice",
        "file_url": "https://www.file.com/invoice.pdf"
  }'
```

The `202 Accepted` response contains the information found in the file:

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2025-02-11T14:18:01.013Z",
  "updated_at": "2025-02-11T14:18:01.013Z",
  "status": "success",
  "document_type": "invoice",
  "recognized_data": {
    "type": "invoice",
    "currency": "EUR",
    "due_date": "2025-02-25",
    "issue_date": "2025-02-11",
    "document_number": "DE2287",
    "sender": {
      "vat_number": "DE123456789",
      "tax_number": "123/456/78901",
      "email": "billing@acme-corp.com",
      "name": "Acme Corporation",
      "address": {
        "street_and_number": "123 Business Road",
        "city": "Berlin",
        "postal_code": "10115",
        "country": "DE",
        "state": "Berlin"
      },
      "bank_account": {
        "bank_account_number": "1234567890",
        "iban": "DE89370400440532013000",
        "swift_bic": "COBADEFFXXX"
      }
    },
    "recipient": {
      "vat_number": "FR987654321",
      "tax_number": "FR12345678901",
      "email": "finance@xyz-enterprise.fr",
      "name": "XYZ Enterprise",
      "address": {
        "street_and_number": "456 Market Street",
        "city": "Paris",
        "postal_code": "75001",
        "country": "FR",
        "state": "Île-de-France"
      },
      "bank_account": {
        "bank_account_number": "0987654321",
        "iban": "FR7630006000011234567890189",
        "swift_bic": "BNPAFRPPXXX"
      }
    },
    "subtotal": 2000.00,
    "total_amount": 2380.00,
    "tax_amount": 380.00,
    "tax_rate": 19.00,
    "amount_paid": 0.00,
    "payment_terms": "Payment due within 14 days",
    "line_items": [
      {
        "line_reference": "ITEM001",
        "name": "Consulting Services",
        "description": "IT consulting services for January 2025",
        "quantity": 10,
        "unit_price": 200.00,
        "unit": "hour",
        "subtotal": 2000.00,
        "tax_rate": 19.00,
        "tax_amount": 380.00,
        "total_amount": 2380.00
      }
    ]
  }
}
```

If the file cannot be recognized, the system returns an error.

### Upload from file \[#file]

You can upload files in the PDF, PNG, or JPG format by calling [`POST /ocr_tasks/upload_from_file`](/api/ocr/post-ocr-tasks-upload-from-file). The query parameter `document_type` is optional and its possible values are `invoice`, `credit_note`, and `receipt`. If `document_type` is not specified, the system will attempt to determine it automatically:

```sh
curl -X POST 'https://api.sandbox.monite.com/v1/ocr_tasks/upload_from_file?document_type=invoice' \
  -H 'accept: application/json' \
  -H 'x-monite-version: 2024-05-25' \
  -H 'x-monite-entity-id: 3b28a315-1e10-46bf-8d83-37f64147ae9f' \
  -H 'Content-Type: multipart/form-data' \
  -F 'file=@Invoice-01-25.pdf;type=application/pdf'
```

The sucessful `202 Accepted` response contains the `id` and other parameters of the file:

```json
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_at": "2025-02-11T14:18:01.013Z",
  "updated_at": "2025-02-11T14:18:01.013Z",
  "status": "success",
  "document_type": "invoice",
  "recognized_data": {
    "type": "invoice",
    "currency": "EUR",
    "due_date": "2025-02-25",
    "issue_date": "2025-02-11",
    "document_number": "DE2287",
    "sender": {
      "vat_number": "DE123456789",
      "tax_number": "123/456/78901",
      "email": "billing@acme-corp.com",
      "name": "Acme Corporation",
      "address": {
        "street_and_number": "123 Business Road",
        "city": "Berlin",
        "postal_code": "10115",
        "country": "DE",
        "state": "Berlin"
      },
      "bank_account": {
        "bank_account_number": "1234567890",
        "iban": "DE89370400440532013000",
        "swift_bic": "COBADEFFXXX"
      }
    },
    "recipient": {
      "vat_number": "FR987654321",
      "tax_number": "FR12345678901",
      "email": "finance@xyz-enterprise.fr",
      "name": "XYZ Enterprise",
      "address": {
        "street_and_number": "456 Market Street",
        "city": "Paris",
        "postal_code": "75001",
        "country": "FR",
        "state": "Île-de-France"
      },
      "bank_account": {
        "bank_account_number": "0987654321",
        "iban": "FR7630006000011234567890189",
        "swift_bic": "BNPAFRPPXXX"
      }
    },
    "subtotal": 2000.00,
    "total_amount": 2380.00,
    "tax_amount": 380.00,
    "tax_rate": 19.00,
    "amount_paid": 0.00,
    "payment_terms": "Payment due within 14 days",
    "line_items": [
      {
        "line_reference": "ITEM001",
        "name": "Consulting Services",
        "description": "IT consulting services for January 2025",
        "quantity": 10,
        "unit_price": 200.00,
        "unit": "hour",
        "subtotal": 2000.00,
        "tax_rate": 19.00,
        "tax_amount": 380.00,
        "total_amount": 2380.00
      }
    ]
  }
}
```

If the file cannot be recognized, the system returns an error.

## List all OCR tasks

To obtain a list of all OCR tasks, call [`GET /ocr_tasks`](/api/ocr/get-ocr-tasks).

## Retrieve a specific OCR task

To obtain information about a specific OCR task, call [`GET /ocr_tasks/{task_id}`](/api/ocr/get-ocr-tasks-id).