Async Enrichments for Receipts & Invoices
When you submit a document for processing, the initial API response is returned as soon as core data extraction completes. Certain enrichment steps can then run asynchronously in the background, updating the document with additional data and notifying you via webhook when they finish.
This page covers async enrichments specifically. In the future, Veryfi will also support on-demand re-triggering of enrichments for any document, which will be documented separately.
Prerequisites
Async enrichments require all of the following:
- Webhooks enabled -- Your account must have a webhook URL set. Without webhooks, async enrichments are silently disabled since there is no way to notify you when they complete. See Add a Webhook to configure webhooks via API, or use the hub.
asyncmust befalse-- Theasyncparameter on the request must not be set totrue. Theasyncflag is a separate mechanism for asynchronous document processing and is incompatible withallowed_async_enrichments.boost_modemust befalse-- Boost mode skips all enrichment steps for faster processing. It cannot be combined withallowed_async_enrichments.
Default Behavior
By default, Veryfi configures which enrichments run asynchronously as an account-level setting. Contact Veryfi Support to view or adjust your defaults.
When no per-request override is provided, the account-level defaults apply automatically.
Per-Request Override
You can override the default async enrichments on a per-request basis using the allowed_async_enrichments parameter in your POST body:
| Value | Behavior |
|---|---|
Omitted or null | Uses your account default |
[] (empty list) | Disables all async enrichments for this request; everything runs inline |
["fraud", "duplicates", "rules"] | Only the specified enrichments run asynchronously |
When specifying any enrichments, you must include "rules" in the list. Business rules depend on the results of other enrichments and must run after them.
Example
{
"file_url": "https://example.com/receipt.jpg",
"allowed_async_enrichments": ["fraud", "duplicates", "rules"]
}
In this example, fraud detection and duplicate detection run asynchronously after the initial response, followed by business rules. All other enrichments run inline during the initial request.
Available Enrichment Types
| Value | Description | Affected Response Fields |
|---|---|---|
duplicates | Checks whether the document is a duplicate of a previously submitted one. | is_duplicate, duplicate_of |
similar_documents | Finds text-similar documents in your account history. | meta.duplicates (list of similar document IDs and similarity scores) |
line_item_expansion | Normalizes and expands abbreviated line item descriptions using AI. | line_items[].product_info (expanded_description, brand, category, suspicious) |
line_item_categorization | Assigns each line item to a category from your configured category list using AI. | line_items[].category |
address_parsing | Breaks vendor, ship-to, and bill-to addresses into structured components (street, city, state, zip, country). | vendor.parsed_address, ship_to.parsed_address, bill_to.parsed_address |
fraud | Runs AI-powered fraud detection and risk scoring on the document. | meta.fraud (decision, score, color, types), meta.warnings |
rules | Applies your configured business rules after other enrichments complete. Required whenever other enrichments are specified. | Any field, depending on your rule configuration |
vendor_resolution | Improves resolution of the vendor to a canonical entity, enriching vendor details. | vendor.name, vendor.address, vendor.phone_number, and other vendor fields |
Webhook Events
When async enrichments finish, Veryfi sends a webhook to your configured endpoint:
document.enriched
Sent when all async enrichments complete successfully.
{
"event": "document.enriched",
"data": {
"id": 123456789
}
}
document.enrichment_failed
Sent when enrichments fail permanently (after retries are exhausted).
{
"event": "document.enrichment_failed",
"data": {
"id": 123456789,
"error": "Description of the failure"
}
}
After receiving either webhook, fetch the document via GET /documents/{id} to see the latest data.