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

    assert res.utility_bill is not None

    # Handle response
    print(res.utility_bill)
{
  "meta": {
    "id": "wh23anb5xjf0ntw5taase5qz",
    "name": "document.jpg",
    "createdAt": "2025-02-07T17:44:06.949Z",
    "model": "utility-bill",
    "status": "Processed",
    "pageCount": 10,
    "errors": [
      {
        "message": "Total is required"
      }
    ]
  },
  "fields": {
    "billingPeriod": {
      "startDate": "2024-02-01",
      "endDate": "2024-02-29"
    },
    "billDate": "2024-03-01",
    "billNumber": "INV-2024-001",
    "issuer": {
      "name": "Power & Light Company",
      "address": "123 Energy Street",
      "taxId": "TAX123456"
    },
    "customer": {
      "accountNumber": "ACC987654",
      "name": "John Smith",
      "customerAddress": "456 Customer Ave",
      "serviceAddress": "789 Service Blvd",
      "taxId": "CUST123456"
    },
    "remitTo": {
      "name": "Power & Light Billing",
      "address": "321 Billing Street"
    },
    "amountDue": 150,
    "currentCharges": 145,
    "currency": "USD",
    "lineItems": [
      {
        "billingNumber": "ACC987654",
        "description": "Electricity Usage",
        "quantity": 500,
        "unitPrice": 0.25,
        "uom": "kWh",
        "amount": 125
      },
      {
        "billingNumber": "ACC987654",
        "description": "Service Fee",
        "quantity": 1,
        "unitPrice": 20,
        "uom": "EA",
        "amount": 20
      }
    ],
    "previousBalance": 0,
    "lastPayment": -150,
    "balanceForward": 0,
    "dueDate": "2024-03-15",
    "amountAfterDueDate": 155,
    "lateCharge": 5,
    "penalties": 0,
    "adjustments": [
      {
        "adjustments": -150
      }
    ]
  }
}

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 Utility Bill 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 utility bill

Example:
{
  "billingPeriod": {
    "startDate": "2024-02-01",
    "endDate": "2024-02-29"
  },
  "billDate": "2024-03-01",
  "billNumber": "INV-2024-001",
  "issuer": {
    "name": "Power & Light Company",
    "address": "123 Energy Street",
    "taxId": "TAX123456"
  },
  "customer": {
    "accountNumber": "ACC987654",
    "name": "John Smith",
    "customerAddress": "456 Customer Ave",
    "serviceAddress": "789 Service Blvd",
    "taxId": "CUST123456"
  },
  "remitTo": {
    "name": "Power & Light Billing",
    "address": "321 Billing Street"
  },
  "amountDue": 150,
  "currentCharges": 145,
  "currency": "USD",
  "lineItems": [
    {
      "billingNumber": "ACC987654",
      "description": "Electricity Usage",
      "quantity": 500,
      "unitPrice": 0.25,
      "uom": "kWh",
      "amount": 125
    },
    {
      "billingNumber": "ACC987654",
      "description": "Service Fee",
      "quantity": 1,
      "unitPrice": 20,
      "uom": "EA",
      "amount": 20
    }
  ],
  "previousBalance": 0,
  "lastPayment": -150,
  "balanceForward": 0,
  "dueDate": "2024-03-15",
  "amountAfterDueDate": 155,
  "lateCharge": 5,
  "penalties": 0,
  "adjustments": [{ "adjustments": -150 }]
}
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.