Document AI Integration Guide
Kaunt's Document AI can be used directly out of the box without requiring pre-training or template configuration. You only need a Tenant ID with a corresponding API Key to begin extracting information from your documents.
This guide provides recommendations, considerations, and best practices for integrating Document AI into your application.
Tenants & Companies
Unlike the Kaunt Invoice Coding API, which is always scoped at the company level, Kaunt Document AI can be used at both tenant and company levels. This capability supports use cases where your legal entity is identified using content on the document, or when a company-level scope is not important.
If you are already using the Kaunt Invoice Coding API at company level, we recommend using the same scope for both Document AI as well. Data is always segregated at the scope within which it is uploaded, which means that a document uploaded for tenant "A" and company "B" is only accessible using the specific tenant "A" and company "B" scope and not using only the tenant "A" scope even though it is the same tenant.
Integrating Kaunt Document AI Into Your Workflow
To provide the best user experience, our general recommendation is to integrate Kaunt Document AI as a background step in your invoice workflow. We also recommend integrating Kaunt Document AI into your workflow before any user intervention. In other words, we recommend sending documents to Kaunt Document AI as soon as they are received by your system.
Kaunt Document AI prioritizes accuracy over speed, which means typical response times can range from a few seconds to up to a minute, depending on document complexity.
Webhooks
Kaunt Document AI supports webhooks. The following two webhooks event types are related to Document AI:
- DocumentAIDocumentResultReady
- DocumentAIDocumentResultFailed
We recommend using webhooks to avoid polling the API while waiting until document processing completes. For more details on webhooks, read our Webhook Guide.
Extracted Content
Kaunt Document AI revolutionizes document content processing. Unlike template-based OCR, which requires pre-configuration and post-processing rules, Kaunt Document AI adapts instantly. Corrections and new field extractions can be defined in plain language and applied immediately, without training or templates.
Providing Feedback on Extracted Content
In Kaunt Document AI, feedback is provided through plain text. Users simply write in plain text what needs to be corrected, whether it involves date formats, splitting invoice lines by quantity, or other modifications. After feedback is sent to Kaunt, our Document AI automatically creates an instruction based on the feedback, which is applied when processing subsequent documents.
The feedback can be provided on different scopes:
- Tenant: The feedback should be applied for the entire tenant
- Company: The feedback should be applied for the company only (requires company-level API calls)
- Supplier: Should apply to invoices from this supplier only. Uses name or TAX ID for matching.
- Buyer: Should apply to invoices for this buyer only. Uses name or TAX ID for matching.
Example feedback:
Split invoice lines mentioning ‘mortgage’ into separate items
Example feedback:
Translate line items on all Japanese invoices into English
After providing plain text feedback, we do not recommend automatically reprocessing the document. In most cases, the best user experience involves manually correcting the content and then proceeding to the next document. However, there may be cases where corrections are so complex that reprocessing is preferable, but this should be initiated by the user.
Kaunt Document AI does not rely solely on plain text feedback. If users make manual corrections to extracted content (e.g., changing date format from YYYY-MM-DD to MM-DD-YYYY), we recommend sending the corrected content as structured feedback. Structured feedback does not have the same instant learning effect, but it is used to monitor and improve overall model performance over time.
Displaying Applied Instructions
When Kaunt Document AI processes a document, it checks for instructions that should be applied to the document. Only instructions that actually modify the content are included in our API output along with the extracted content. We recommend displaying these instructions in the UI to users, along with the option to delete an applied instruction. Before proceeding with the deletion make sure the user understands that the deletion affects all future documents.
Extracting Custom Fields
Similar to providing plain text feedback on extracted content, Kaunt Document AI also offers the capability to define custom fields for extraction. Custom fields can be defined on the header-level and line-level. Defining custom fields applies to all documents for the specific tenant or company.
When defining a custom field, make sure to be specific in your provided extraction instructions. While the instructions are not directly used as provided, they serve as the basis for the extraction.
Example field:
Name: Contract Reference
Scope: Header
Extraction instruction: Extract ‘Contract Reference’ from header section if present (e.g., CRX-2025-045)
Example field:
Name: Vehicle Plate Number
Scope: Line
Extraction instruction: Extract ‘Vehicle Plate Number’ from line descriptions (e.g., AB12345).
Error Handling
Ensure your workflow includes a fallback procedure for when automation fails. If your system already has some form of document automation in place, this is likely not a new consideration. However, if you are upgrading from a completely manual system, this is an important scenario to consider.