GET
/
v1-preview
/
models
/
receipt
/
{documentId}
from abbyy_document_ai import DocumentAi
import os


with DocumentAi(
    api_key_auth=os.getenv("DOCUMENTAI_API_KEY_AUTH", ""),
) as document_ai:

    res = document_ai.models.receipt.get_extracted_fields(document_id="wh23anb5xjf0ntw5taase5qz")

    assert res.receipt is not None

    # Handle response
    print(res.receipt)
{
  "meta": {
    "id": "wh23anb5xjf0ntw5taase5qz",
    "name": "document.jpg",
    "createdAt": "2025-02-07T17:44:06.949Z",
    "model": "receipt",
    "status": "Processed",
    "pageCount": 10,
    "errors": [
      {
        "message": "Total is required"
      }
    ]
  },
  "fields": {
    "vendor": "Abbyy",
    "address": "123 Main St\nAnytown, USA 12345",
    "city": "Anytown",
    "country": "USA",
    "date": "2021-01-01",
    "currency": "USD",
    "total": 100,
    "phone": "123-456-7890",
    "paymentMethod": "Card",
    "cardType": "Visa",
    "cardNumber": "1234567890123456",
    "tip": 0,
    "taxTotal": 10,
    "taxes": [
      {
        "taxAmount": 10,
        "taxRate": 10
      }
    ],
    "lineItems": [
      {
        "amount": 100,
        "price": 100,
        "description": "Item 1",
        "quantity": 1,
        "sku": "1234567890"
      }
    ],
    "expenseType": {
      "airfare": false,
      "carParking": false,
      "carRental": false,
      "gasolineStation": false,
      "generalRetail": true,
      "hotel": false,
      "other": false,
      "restaurant": false,
      "taxi": false,
      "tollRoad": false,
      "transport": false
    }
  }
}

Authorizations

Authorization
string
header
required

Our API offers authentication via API keys. You can obtain an API key from https://developer.abbyy.com

Path Parameters

documentId
string
required

The id of the document

Response

200
application/json

Extracted Receipt Data Response

meta
object
required

Represents a document that has been submitted for processing.

Example:
{
  "id": "wh23anb5xjf0ntw5taase5qz",
  "name": "document.jpg",
  "createdAt": "2025-02-07T17:44:06.949Z",
  "model": "image-to-text",
  "status": "Processed",
  "pageCount": 10,
  "errors": [{ "message": "Total is required" }]
}
fields
object

Fields extracted from a receipt

Example:
{
  "vendor": "Abbyy",
  "address": "123 Main St\nAnytown, USA 12345",
  "city": "Anytown",
  "country": "USA",
  "date": "2021-01-01",
  "currency": "USD",
  "total": 100,
  "phone": "123-456-7890",
  "paymentMethod": "Card",
  "cardType": "Visa",
  "cardNumber": "1234567890123456",
  "tip": 0,
  "taxTotal": 10,
  "taxes": [{ "taxAmount": 10, "taxRate": 10 }],
  "lineItems": [
    {
      "amount": 100,
      "price": 100,
      "description": "Item 1",
      "quantity": 1,
      "sku": "1234567890"
    }
  ],
  "expenseType": {
    "airfare": false,
    "carParking": false,
    "carRental": false,
    "gasolineStation": false,
    "generalRetail": true,
    "hotel": false,
    "other": false,
    "restaurant": false,
    "taxi": false,
    "tollRoad": false,
    "transport": false
  }
}
validationErrors
object[]

An array of validation errors that occurred while processing the document. These typically do not prevent field extraction, but rather indicate issues extracting key fields.