Enrich vendors with the API

Use the API to enrich vendors with payment acceptance info and contact information
View as MarkdownOpen in Claude

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 requires configuration by the Payabli team. Contact us to get started.

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.

To add the AI outreach call as a third stage, set scheduleCallIfNeeded to true. When the invoice scan and web search return insufficient payment acceptance info, Payabli schedules a call to the vendor. See Schedule an outreach call for behavior and requirements. This option is in beta.

POST
/api/Vendor/enrich/:entry
1curl -X POST https://api-sandbox.payabli.com/api/Vendor/enrich/8cfec329267 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "vendorId": 456,
6 "scope": [
7 "invoice_scan"
8 ],
9 "applyEnrichmentData": false,
10 "invoiceFile": {
11 "fContent": "<base64-encoded-pdf>",
12 "filename": "invoice-2026-001.pdf",
13 "ftype": "pdf"
14 },
15 "fallbackMethod": "check"
16}'

Response

The response includes the enrichment status and, when applyEnrichmentData is false, the raw extraction results.

Response
1{
2 "responseText": "Success",
3 "responseCode": 1,
4 "isSuccess": true,
5 "responseData": {
6 "enrichmentId": "enrich-3890-a1b2c3d4",
7 "status": "insufficient",
8 "stagesTriggered": [
9 "invoice_scan"
10 ],
11 "vendorPayoutReady": false,
12 "enrichmentData": {
13 "invoiceScan": {
14 "vendorName": "Greenfield Landscaping",
15 "street": "456 Commerce Blvd",
16 "city": "Indianapolis",
17 "state": "IN",
18 "zipCode": "46201",
19 "country": "US",
20 "phone": "5555550100",
21 "email": null,
22 "paymentLink": null,
23 "cardAccepted": "unable to determine",
24 "achAccepted": "unable to determine",
25 "checkAccepted": "yes",
26 "invoiceNumber": "INV-2345",
27 "amountDue": 390.5,
28 "dueDate": "2026-01-31"
29 },
30 "webSearch": null
31 }
32 }
33}

When applyEnrichmentData is true, the extracted data is written to the vendor record and also returned in the response.

Response
1{
2 "responseText": "Success",
3 "responseCode": 1,
4 "isSuccess": true,
5 "responseData": {
6 "enrichmentId": "enrich-3891-c9d0e1f2",
7 "status": "completed",
8 "stagesTriggered": [
9 "web_search"
10 ],
11 "vendorPayoutReady": true,
12 "enrichmentData": {
13 "invoiceScan": null,
14 "webSearch": {
15 "phone": "5555550200",
16 "phoneType": "main",
17 "email": "ap@greenfield-landscaping.com",
18 "emailType": "billing",
19 "street": "456 Commerce Blvd",
20 "city": "Indianapolis",
21 "state": "IN",
22 "zipCode": "46201",
23 "country": "US",
24 "addressType": "business",
25 "paymentLink": "https://greenfield-landscaping.com/pay",
26 "paymentLinkType": "payment_portal",
27 "cardAccepted": "yes",
28 "achAccepted": "unable to determine",
29 "checkAccepted": "yes"
30 }
31 }
32 }
33}

Response status values

StatusMeaning
completedEnrichment finished and the vendor is payout-ready.
completed_from_networkThe vendor was already enriched in Payabli’s vendor network. No AI processing was needed.
insufficientAll requested stages ran but the vendor still lacks sufficient payment data.

Handling the response

After receiving enrichment results in review mode (applyEnrichmentData: false):

  1. Display the extracted data from enrichmentData to the user for confirmation.
  2. 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 vendorNumber field is required.

$curl -X POST 'https://api-sandbox.payabli.com/api/Vendor/single/$ENTRY_POINT' \
> -H 'Content-Type: application/json' \
> -H 'requestToken: $API_TOKEN' \
> -d '{
> "vendorNumber": "VEN-123",
> "name1": "Acme Supplies",
> "attachment": {
> "ftype": "pdf",
> "filename": "invoice-101.pdf",
> "fContent": "<base64-encoded-pdf>"
> }
> }'

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.

$curl -X POST 'https://api-sandbox.payabli.com/api/Bill/single/$ENTRY_POINT' \
> -H 'Content-Type: application/json' \
> -H 'requestToken: $API_TOKEN' \
> -d '{
> "billNumber": "INV-2026-001",
> "netAmount": 1500.00,
> "attachments": [
> {
> "ftype": "pdf",
> "filename": "invoice-2026-001.pdf",
> "fContent": "<base64-encoded-pdf>"
> }
> ],
> "vendor": {
> "name1": "Acme Supplies"
> }
> }'

When the scan succeeds, the system:

  1. Extracts vendor contact information and creates or matches a vendor using the extracted name and address.
  2. Populates bill fields like invoice number, amount due, and due date from the scan results (empty-field-only).
  3. Attaches the vendor to the bill.

The same empty-field-only rule applies — your request values always take precedence.

Schedule an outreach call

Use the schedule outreach call endpoint to have an AI agent call a vendor and collect their preferred payment method and contact email. This is the third enrichment stage. Use it when invoice scanning and web search can’t determine how a vendor wants to be paid.

Outreach calling is in beta and is opt-in. Contact your Payabli representative to enable it, provision a phone number for your merchants, and discuss pricing.

Request

At minimum, provide the vendorId. Pass a phone number (digits only) to override the vendor’s stored phone, or omit it to call the number on the vendor’s record. The call is scheduled for the next business day at around 9 AM in the vendor’s timezone unless you set sendNow to true.

POST
/api/Vendor/enrich/schedule_call/:entry
1curl -X POST https://api-sandbox.payabli.com/api/Vendor/enrich/schedule_call/8cfec329267 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "vendorId": 456,
6 "phone": "5555550200",
7 "enrichmentId": "enrich-3890-a1b2c3d4",
8 "billId": 54323,
9 "fallbackMethod": "check",
10 "maxRetries": 3,
11 "timezone": "America/New_York"
12}'

Key request fields:

FieldRequiredDescription
vendorIdYesID of the vendor to call.
phoneNoVendor phone number, digits only. Overrides the vendor’s stored phone. When omitted, Payabli uses the number on the vendor’s record.
enrichmentIdNoLinks the call to an originating enrichment run. When omitted, Payabli generates a standalone schedule.
billIdNoEnables the due-date check. Evaluated only when enrichmentId is also supplied.
fallbackMethodNoMethod applied if the call can’t determine a preference or retries are exhausted: check (default) or managed.
maxRetriesNoRetry attempts on no-answer. Default 3, maximum 5.
timezoneNoIANA timezone for scheduling. Default America/New_York.
sendNowNoWhen true, dispatches the call immediately and bypasses the business-hours window and due-date check. Default false.

Response

A successful request returns the call schedule identifier, the associated enrichment ID, the scheduled call date, and the schedule status.

Response
1{
2 "responseText": "Success",
3 "responseCode": 1,
4 "pageIdentifier": null,
5 "roomId": 0,
6 "isSuccess": true,
7 "responseData": {
8 "callScheduleId": 430,
9 "enrichmentId": "enrich-3890-a1b2c3d4",
10 "scheduledCallDate": "2026-06-16T13:00:00Z",
11 "status": "dispatched"
12 }
13}

Error handling

The schedule outreach call endpoint returns HTTP 400 or 429 with a descriptive message:

ConditionStatusMessage
Outreach calling not enabled for the organization400Outreach calls not enabled.
No phone number on the vendor and none provided400No phone number available for vendor.
Bill due in fewer than three days400Bill due date is within 3 days — fallback applied.
An open call schedule already exists for the vendor400An open call schedule already exists for this vendor.
Retries already exhausted for the vendor400Max retries exhausted for this vendor.
enrichmentId not found400Enrichment request not found.
Invalid timezone value400Invalid timezone identifier.
Calling system rate limited429PAI is rate limited — please retry shortly.

Read enrichment status

The get vendor endpoint returns enrichment fields directly on the vendor response:

Response
1{
2 "VendorNumber": "VEN-123",
3 "Name1": "Herman's Coatings",
4 "Name2": "Herman's Coating Supply Company, LLC",
5 "EIN": "123456789",
6 "Phone": "2125551234",
7 "Email": "example@email.com",
8 "RemitEmail": null,
9 "Address1": "123 Ocean Drive",
10 "Address2": "Suite 400",
11 "City": "Bristol",
12 "State": "GA",
13 "Zip": "31113",
14 "Country": "US",
15 "Mcc": "7777",
16 "LocationCode": "LOC123",
17 "Contacts": [
18 {
19 "ContactName": "Eric Martinez",
20 "ContactEmail": "eric@martinezcoatings.com",
21 "ContactTitle": "Owner",
22 "ContactPhone": "5555555555"
23 }
24 ],
25 "BillingData": {
26 "id": 123456,
27 "nickname": "Main Checking Account",
28 "bankName": "Example Bank",
29 "routingAccount": "123456789",
30 "accountNumber": "9876543210",
31 "typeAccount": "Checking",
32 "bankAccountHolderName": "John Doe",
33 "bankAccountHolderType": "Business",
34 "bankAccountFunction": 2,
35 "verified": true,
36 "status": 1,
37 "services": [],
38 "default": true,
39 "accountId": "bank-account-001"
40 },
41 "PaymentMethod": null,
42 "VendorStatus": 1,
43 "VendorId": 456,
44 "EnrollmentStatus": null,
45 "Summary": {
46 "ActiveBills": 2,
47 "PendingBills": 4,
48 "InTransitBills": 3,
49 "PaidBills": 18,
50 "OverdueBills": 1,
51 "ApprovedBills": 5,
52 "DisapprovedBills": 1,
53 "TotalBills": 34,
54 "ActiveBillsAmount": 1250.75,
55 "PendingBillsAmount": 2890.5,
56 "InTransitBillsAmount": 1675.25,
57 "PaidBillsAmount": 15420.8,
58 "OverdueBillsAmount": 425,
59 "ApprovedBillsAmount": 3240.9,
60 "DisapprovedBillsAmount": 180,
61 "TotalBillsAmount": 25083.2
62 },
63 "PaypointLegalname": "Sunshine Services, LLC",
64 "PaypointDbaname": "Sunshine Gutters",
65 "PaypointEntryname": "d193cf9a46",
66 "ParentOrgName": "PropertyManager Pro",
67 "ParentOrgId": 1000,
68 "CreatedDate": "2022-07-01T15:00:01Z",
69 "LastUpdated": "2022-07-01T15:00:01Z",
70 "remitAddress1": "123 Walnut Street",
71 "remitAddress2": "Suite 900",
72 "remitCity": "Miami",
73 "remitState": "FL",
74 "remitZip": "31113",
75 "remitCountry": "US",
76 "payeeName1": "payeeName1",
77 "payeeName2": "payeeName2",
78 "customField1": "",
79 "customField2": "",
80 "customerVendorAccount": "123-456",
81 "InternalReferenceId": 1000000,
82 "PaymentPortalUrl": "https://greenfield-landscaping.com/pay",
83 "CardAccepted": "yes",
84 "AchAccepted": "unable to determine",
85 "EnrichmentStatus": "fully_enriched",
86 "EnrichedBy": "web_search",
87 "EnrichedAt": "2026-03-05T14:22:10Z",
88 "EnrichmentId": "enrich-3890-a1b2c3d4",
89 "additionalData": null,
90 "externalPaypointID": "Paypoint-100",
91 "StoredMethods": []
92}

Key fields:

FieldDescription
EnrichmentStatusCurrent enrichment state: not_enriched, partially_enriched, fully_enriched, or fallback_applied.
EnrichedByWhich method resolved the vendor’s payment acceptance info.
PaymentPortalUrlURL for the vendor’s online payment portal, if known.
CardAcceptedWhether the vendor accepts card payments: yes, no, or unable to determine.
AchAcceptedWhether the vendor accepts ACH payments: yes, no, or unable to determine.

Read outreach call status

The get outreach call status endpoint returns the latest outreach call activity for a vendor. The response is a composite object: the state field tells you which block is populated. This endpoint is in beta.

Response
1{
2 "vendorId": 456,
3 "state": "successful",
4 "completed": {
5 "completedAt": "2026-06-16T13:13:42Z",
6 "durationSeconds": 222,
7 "summary": "Vendor confirmed they accept card payments and provided a billing email.",
8 "callId": "call-3890-9f8e7d6c",
9 "transcript": "AI Agent: Hi, I'm calling on behalf of Acme Corporation about payment options. Does Greenfield Landscaping accept card payments?\nVendor: Yes, we take cards. You can send receipts to our billing email.",
10 "extractedData": {
11 "selectedPaymentMethod": "card",
12 "contactEmail": "ap@greenfield-landscaping.com"
13 }
14 }
15}

The state field is one of four values:

StatePopulated blockWhat it carries
noneNoneThe vendor has no call activity. The response returns HTTP 200.
scheduledscheduledThe next scheduled call date and the attempts remaining.
successfulcompletedThe completion time, a call summary, extracted payment method and contact email, and the transcript.
failedfailedThe last attempt time, the reason, attempts remaining, and the next retry date if one is scheduled.

When state is successful, the completed block includes a transcript field with the full call transcript. It’s null when no transcript is available.

Error handling

The enrich endpoint returns specific error messages when enrichment can’t proceed:

ConditionMessage
Feature not enabledVendor enrichment isn’t enabled for this organization.
Vendor not found or inactiveVendor not found or isn’t active.
Vendor doesn’t belong to entryVendor doesn’t belong to this entrypoint.
Enrichment already in progressAn enrichment request is already in progress for this vendor.
Missing invoice fileAn invoice file is required when invoice_scan is included in scope.

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.

See these related resources to help you get the most out of Payabli.