Skip to main content

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.
  • async must be false -- The async parameter on the request must not be set to true. The async flag is a separate mechanism for asynchronous document processing and is incompatible with allowed_async_enrichments.
  • boost_mode must be false -- Boost mode skips all enrichment steps for faster processing. It cannot be combined with allowed_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:

ValueBehavior
Omitted or nullUses your account default
[] (empty list)Disables all async enrichments for this request; everything runs inline
["fraud", "duplicates", "rules"]Only the specified enrichments run asynchronously
info

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

ValueDescriptionAffected Response Fields
duplicatesChecks whether the document is a duplicate of a previously submitted one.is_duplicate, duplicate_of
similar_documentsFinds text-similar documents in your account history.meta.duplicates (list of similar document IDs and similarity scores)
line_item_expansionNormalizes and expands abbreviated line item descriptions using AI.line_items[].product_info (expanded_description, brand, category, suspicious)
line_item_categorizationAssigns each line item to a category from your configured category list using AI.line_items[].category
address_parsingBreaks 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
fraudRuns AI-powered fraud detection and risk scoring on the document.meta.fraud (decision, score, color, types), meta.warnings
rulesApplies your configured business rules after other enrichments complete. Required whenever other enrichments are specified.Any field, depending on your rule configuration
vendor_resolutionImproves 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.