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

    assert res.purchase_order is not None

    # Handle response
    print(res.purchase_order)
{
  "meta": {
    "id": "wh23anb5xjf0ntw5taase5qz",
    "name": "document.jpg",
    "createdAt": "2025-02-07T17:44:06.949Z",
    "model": "purchase-order",
    "status": "Processed",
    "pageCount": 10,
    "errors": [
      {
        "message": "Total is required"
      }
    ]
  },
  "fields": {
    "orderNumber": "O-2024-001",
    "orderDate": "2024-03-20",
    "total": 1234.56,
    "currency": "EUR",
    "buyer": {
      "name": "Acme Corp",
      "taxId": "ATU12345678",
      "address": "123 Business Street",
      "iban": "DE89370400440532013000",
      "buyerId": "BU-001",
      "bankAccount": "532013000",
      "bankCode": "37040044",
      "country": "Austria",
      "city": "Vienna",
      "street": "Business Street 123",
      "postalCode": "1010",
      "stateOrProvince": "Vienna"
    },
    "supplier": {
      "name": "Tech Supplies GmbH",
      "taxId": "DE987654321",
      "supplierId": "V-001",
      "address": "456 Vendor Avenue",
      "country": "Germany",
      "city": "Berlin",
      "street": "Vendor Avenue 456",
      "postalCode": "10115",
      "stateOrProvince": "Berlin"
    },
    "deliveryDate": "2024-03-15",
    "taxes": {
      "totalNetAmount": 1000,
      "totalTaxAmount": 234.56
    },
    "shipTo": {
      "name": "John Doe",
      "address": "123 Main St"
    },
    "billTo": {
      "name": "Jane Doe",
      "address": "456 Main St"
    },
    "lineItems": [
      {
        "position": 1,
        "articleNumberBuyer": "BU-TECH-001",
        "articleNumberSupplier": "SU-TECH-001",
        "description": "High-end laptop computer",
        "quantity": 1,
        "unitOfMeasurement": "pcs",
        "unitPrice": 1000,
        "discount": 0,
        "totalPrice": 1234.56,
        "currency": "EUR",
        "deliveryDate": "2024-03-10"
      }
    ]
  }
}

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 Purchase Order 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 purchase order

Example:
{
  "orderNumber": "O-2024-001",
  "orderDate": "2024-03-20",
  "total": 1234.56,
  "currency": "EUR",
  "buyer": {
    "name": "Acme Corp",
    "taxId": "ATU12345678",
    "address": "123 Business Street",
    "iban": "DE89370400440532013000",
    "buyerId": "BU-001",
    "bankAccount": "532013000",
    "bankCode": "37040044",
    "country": "Austria",
    "city": "Vienna",
    "street": "Business Street 123",
    "postalCode": "1010",
    "stateOrProvince": "Vienna"
  },
  "supplier": {
    "name": "Tech Supplies GmbH",
    "taxId": "DE987654321",
    "supplierId": "V-001",
    "address": "456 Vendor Avenue",
    "country": "Germany",
    "city": "Berlin",
    "street": "Vendor Avenue 456",
    "postalCode": "10115",
    "stateOrProvince": "Berlin"
  },
  "deliveryDate": "2024-03-15",
  "taxes": {
    "totalNetAmount": 1000,
    "totalTaxAmount": 234.56
  },
  "shipTo": {
    "name": "John Doe",
    "address": "123 Main St"
  },
  "billTo": {
    "name": "Jane Doe",
    "address": "456 Main St"
  },
  "lineItems": [
    {
      "position": 1,
      "articleNumberBuyer": "BU-TECH-001",
      "articleNumberSupplier": "SU-TECH-001",
      "description": "High-end laptop computer",
      "quantity": 1,
      "unitOfMeasurement": "pcs",
      "unitPrice": 1000,
      "discount": 0,
      "totalPrice": 1234.56,
      "currency": "EUR",
      "deliveryDate": "2024-03-10"
    }
  ]
}
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.