Retrieve invoice OCR data

Prev Next
Get
/v1/invoices/{invoiceId}/ocr

Retrieves the raw OCR (Optical Character Recognition) extraction data for an invoice.

This endpoint returns the data extracted during invoice processing, including recognized text lines, parsed line items, and summary fields. Useful for debugging extraction issues or building custom integrations.


Response Fields

Field Type Description
ocrLines array Raw text lines extracted from the document.
lineItems array Parsed line items with quantities, prices, and descriptions.
summaryFields object Extracted summary fields (totals, dates, vendor info, etc.).

Note: The structure of OCR data may vary depending on the document format and extraction confidence.

Security
HTTP
Type bearer

Enter your API token.

Path parameters
invoiceId
integerRequired

The unique identifier of the invoice.

Minimum1
Responses
200

OCR data retrieved successfully

success

OCR Data Retrieved

{
  "status": "OK",
  "msg": "Invoice OCR data retrieved.",
  "result": {
    "ocrLines": [
      "INVOICE",
      "Acme Corporation",
      "Invoice #: INV-2024-001",
      "Date: January 15, 2024",
      "Widget A    10    $100.00    $1,000.00",
      "Total: $1,000.00"
    ],
    "lineItems": [
      {
        "description": "Widget A",
        "qty": 10,
        "price": 100.0,
        "total": 1000.0
      }
    ],
    "summaryFields": {
      "invoiceNumber": "INV-2024-001",
      "invoiceDate": "2024-01-15",
      "vendorName": "Acme Corporation",
      "total": 1000.0
    }
  }
}
Expand All
object
status
string
Valid values[ "OK" ]
msg
string
result
object

The extracted OCR data from the invoice document.

ocrLines
Array of string

Raw text lines extracted from the document.

string
lineItems
Array of object

Parsed line items with quantities, prices, and descriptions.

object
description
string
qty
number
price
number
total
number
summaryFields
object

Extracted summary fields (totals, dates, vendor info, etc.).

400

Bad Request - Invalid or empty invoice ID

401

Unauthorized - Missing or invalid API token

missingToken

Missing Token

{
  "status": "Error",
  "msg": "Bearer token is not set.",
  "result": null
}
invalidToken

Invalid Token

{
  "status": "Error",
  "msg": "Token is invalid.",
  "result": null
}
tokenNotFound

Token Not Found

{
  "status": "Error",
  "msg": "Token not found.",
  "result": null
}
revokedToken

Revoked Token

{
  "status": "Error",
  "msg": "Token is revoked.",
  "result": null
}
object
status
string
Valid values[ "Error" ]
msg
string
result
404

Invoice or OCR data not found

notFound

Invoice Not Found

{
  "status": "Error",
  "msg": "Record not found.",
  "result": null
}
noOcrData

No OCR Data

{
  "status": "Error",
  "msg": "This invoice has no data extraction record.",
  "result": null
}
object
status
string
Valid values[ "Error" ]
msg
string
result