Usage

Copy the code block, replace YOUR_API_KEY with your API key, then process documents quickly.
from abbyy_document_ai import DocumentAi

with DocumentAi(api_key_auth=YOUR_API_KEY) as document_ai:
  res = document_ai.models.receipt.begin_field_extraction(input_source={
    "url": "https://example.com/document.pdf",
  })

  assert res.documents is not None
  doc_id = res.documents[0].id

  processed = False
  while not processed:
      time.sleep(3)  # Wait 3 seconds between checks
      res = document_ai.models.receipt.get_extracted_fields(
          document_id=doc_id
      )
      processed = res.receipt.meta.status == "Processed"

  print(res.receipt.fields)

Extracted Fields

Field NameDescription
Merchant InformationInformation about the merchant.
  NameThe merchant’s name.
  AddressThe merchant’s address.
  PhoneThe merchant’s phone number.
  Tax IDThe merchant’s tax identification number.
  Store NumberThe store or branch number.
Receipt DetailsInformation about the receipt.
  NumberThe receipt number.
  DateThe date of the transaction.
  TimeThe time of the transaction.
  Register NumberThe register or terminal number.
  Employee IDThe ID of the employee who processed the transaction.
Payment InformationInformation about the payment.
  MethodThe payment method used (cash, credit card, debit card, etc.).
  Card TypeThe type of card used for payment (if applicable).
  Card Last 4The last 4 digits of the card used (if applicable).
  Authorization NumberThe payment authorization number (if applicable).
AmountsInformation about monetary amounts.
  SubtotalThe subtotal amount before taxes and tips.
  TaxThe total tax amount.
  TipThe tip amount (if applicable).
  TotalThe total amount including taxes and tips.
  CurrencyThe currency used in the transaction.
Line Items (repeating group)Information about individual items purchased.
  DescriptionThe description of the item.
  QuantityThe quantity of items.
  Unit PriceThe price per unit.
  AmountThe total amount for the line item.
  Tax AmountThe tax amount for the line item.
  Tax RateThe tax rate applied to the line item.
  DiscountAny discount applied to the line item.

Supported Languages

CountriesLanguages
GlobalEnglish