GET
/
v1-preview
/
models
/
invoice
/
{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.invoice.get_extracted_fields(document_id="wh23anb5xjf0ntw5taase5qz")

    assert res.invoice is not None

    # Handle response
    print(res.invoice)
{
  "meta": {
    "id": "wh23anb5xjf0ntw5taase5qz",
    "name": "document.jpg",
    "createdAt": "2025-02-07T17:44:06.949Z",
    "model": "invoice",
    "status": "Processed",
    "pageCount": 10,
    "errors": [
      {
        "message": "Total is required"
      }
    ]
  },
  "fields": {
    "invoiceNumber": "INV-2024-001",
    "invoiceDate": "2024-03-20",
    "total": 1234.56,
    "currency": "EUR",
    "businessUnit": {
      "name": "Acme Corp",
      "taxId": "ATU12345678",
      "address": "123 Business Street",
      "country": "Austria",
      "city": "Vienna",
      "street": "Business Street 123",
      "postalCode": "1010",
      "id": "BU-001"
    },
    "vendor": {
      "name": "Tech Supplies GmbH",
      "taxId": "DE987654321",
      "nationalTaxId": "123/456/789",
      "iban": "DE89370400440532013000",
      "bankAccount": "532013000",
      "bankCode": "37040044",
      "swiftCode": "DEUTDEBBXXX",
      "address": "456 Vendor Avenue",
      "country": "Germany",
      "city": "Berlin",
      "street": "Vendor Avenue 456",
      "postalCode": "10115",
      "id": "V-001"
    },
    "deliveryDate": "2024-03-15",
    "dueDate": "2024-04-20",
    "reversedCharge": false,
    "taxes": {
      "totalNetAmount": 1000,
      "totalTaxes": 234.56,
      "nonTaxableAmount": 0,
      "taxRates": [
        {
          "netAmount": 1000,
          "taxAmount": 234.56,
          "taxRate": 23.456
        }
      ]
    },
    "invoiceType": {
      "invoice": true,
      "creditNote": false
    },
    "purchaseOrder": [
      {
        "orderNumber": "PO-2024-001",
        "total": 1234.56,
        "orderChecked": true
      }
    ],
    "lineItems": [
      {
        "orderNumber": "PO-2024-001",
        "isValid": true,
        "orderDate": "2024-03-10",
        "position": 1,
        "articleNumberVendor": "V-TECH-001",
        "articleNumberBu": "BU-TECH-001",
        "description": "High-end laptop computer",
        "quantity": 1,
        "unitOfMeasurement": "pcs",
        "unitPrice": 1000,
        "discountPercentage": 0,
        "discount": 0,
        "netPrice": 1000,
        "taxRate": 23.456,
        "taxAmount": 234.56,
        "taxCode": "STD",
        "totalPrice": 1234.56,
        "currency": "EUR",
        "orderItemId": "OI-001"
      }
    ]
  }
}

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 Invoice 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 an invoice

Example:
{
  "invoiceNumber": "INV-2024-001",
  "invoiceDate": "2024-03-20",
  "total": 1234.56,
  "currency": "EUR",
  "businessUnit": {
    "name": "Acme Corp",
    "taxId": "ATU12345678",
    "address": "123 Business Street",
    "country": "Austria",
    "city": "Vienna",
    "street": "Business Street 123",
    "postalCode": "1010",
    "id": "BU-001"
  },
  "vendor": {
    "name": "Tech Supplies GmbH",
    "taxId": "DE987654321",
    "nationalTaxId": "123/456/789",
    "iban": "DE89370400440532013000",
    "bankAccount": "532013000",
    "bankCode": "37040044",
    "swiftCode": "DEUTDEBBXXX",
    "address": "456 Vendor Avenue",
    "country": "Germany",
    "city": "Berlin",
    "street": "Vendor Avenue 456",
    "postalCode": "10115",
    "id": "V-001"
  },
  "deliveryDate": "2024-03-15",
  "dueDate": "2024-04-20",
  "reversedCharge": false,
  "taxes": {
    "totalNetAmount": 1000,
    "totalTaxes": 234.56,
    "nonTaxableAmount": 0,
    "taxRates": [
      {
        "netAmount": 1000,
        "taxAmount": 234.56,
        "taxRate": 23.456
      }
    ]
  },
  "invoiceType": { "invoice": true, "creditNote": false },
  "purchaseOrder": [
    {
      "orderNumber": "PO-2024-001",
      "total": 1234.56,
      "orderChecked": true
    }
  ],
  "lineItems": [
    {
      "orderNumber": "PO-2024-001",
      "isValid": true,
      "orderDate": "2024-03-10",
      "position": 1,
      "articleNumberVendor": "V-TECH-001",
      "articleNumberBu": "BU-TECH-001",
      "description": "High-end laptop computer",
      "quantity": 1,
      "unitOfMeasurement": "pcs",
      "unitPrice": 1000,
      "discountPercentage": 0,
      "discount": 0,
      "netPrice": 1000,
      "taxRate": 23.456,
      "taxAmount": 234.56,
      "taxCode": "STD",
      "totalPrice": 1234.56,
      "currency": "EUR",
      "orderItemId": "OI-001"
    }
  ]
}
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.