Enrich vendors with the API
This guide covers how to integrate vendor enrichment into your application using the Payabli API. For background on how enrichment works, see Vendor enrichment.
Vendor enrichment is an opt-in feature. Contact Payabli to enable it for your organization.
Prerequisites
- Vendor enrichment enabled for your organization (contact Payabli)
- A valid API token with vendor permissions
- At least one active vendor to enrich
Enrich an existing vendor
Use the enrich vendor endpoint to run enrichment stages on a vendor that already exists.
Request
Specify the vendorId and which stages to run in scope. Include a Base64-encoded PDF in invoiceFile when using the invoice_scan scope.
Response
The response includes the enrichment status and, when applyEnrichmentData is false, the raw extraction results.
When applyEnrichmentData is true, the extracted data is written to the vendor record and also returned in the response.
Response status values
Handling the response
After receiving enrichment results in review mode (applyEnrichmentData: false):
- Display the extracted data from
enrichmentDatato the user for confirmation. - Apply selected fields to the vendor with the update vendor endpoint.
Check stagesTriggered to confirm which stages succeeded. Failed stages are excluded from this array.
Scan an invoice during vendor creation
Attach a PDF invoice to the create vendor request using the attachment field. When enrichment is enabled, the invoice is scanned and extracted details are merged into the vendor record.
The merge follows the empty-field-only rule: request body fields always take precedence over extracted data. If you include name1 in the request and the invoice scan also extracts a vendor name, your value wins.
If the scan fails for any reason, vendor creation proceeds with the original request data. The scan never causes vendor creation to fail.
Scan an invoice during bill creation
The create bill endpoint triggers an invoice scan when the first item in the attachments array is a PDF. No new request fields are needed — use the existing attachments array.
When the scan succeeds, the system:
- Extracts vendor contact information and creates or matches a vendor using the extracted name and address.
- Populates bill fields like invoice number, amount due, and due date from the scan results (empty-field-only).
- Attaches the vendor to the bill.
The same empty-field-only rule applies — your request values always take precedence.
Read enrichment status
The get vendor endpoint returns enrichment fields directly on the vendor response:
Key fields:
Error handling
The enrich endpoint returns specific error messages when enrichment can’t proceed:
For invoice scans during vendor or bill creation, scan failures don’t block the request. The creation request always succeeds, even if the scan fails.
Related resources
See these related resources to help you get the most out of Payabli.
Prerequisites
- Manage vendors with the API - You need to understand vendor records before enriching them