Manage vendors with the API
Vendors are the entities that provide goods or services to paypoints and organizations. They’re who gets paid in money out (pay out) transactions. Before you can use vendors in bills and payouts, you must add them. This guide explains how to add and manage vendors using the Payabli API.
Create a vendor
To create a vendor record, send a POST request to the /api/Vendor/single/{entry} endpoint.
For complete details, see the API reference for this endpoint.
This example creates a new vendor record in the entrypoint 8cfec329267.
A successful request returns a JSON response. The IdVendor is returned as responseData.
responseData is the vendor ID, and is used to manage the vendor via the APIField requirements and validation
When you create or update a vendor, Payabli validates each field according to the following rules.
General information fields
These fields identify the vendor and apply to every create or update request.
Address fields
Address fields follow an all-or-nothing rule: if you provide any address field, then all required address fields must be present and valid. You can’t submit a partial address. This applies to the primary address and remittance address independently. You can provide one without the other, but each group must be complete.
Primary address
These fields make up the vendor’s main business address.
Remittance address
The remittance address is where payment should be sent when it’s different from the primary address. The same validation rules apply.
State and country validation
The state value is validated against the country value:
Common validation errors
Error messages and how to resolve them
“Invalid or missing Vendor Number”:The vendorNumber field was left blank or contained only spaces. Provide a non-empty value.
“Invalid Vendor Name”:The name1 field was blank or contained characters that aren’t permitted. Remove special characters like @, !, $, %, ^, *, +, =, [, ], or non-ASCII characters.
“Missing Address Line 1”:You provided some address fields (like city or zip) but omitted address1. Either provide a complete address or remove all address fields.
“Missing City”:address1 was provided but city was blank. All four fields (address1, city, state, and zip) must be supplied together.
“Missing or invalid State / Province”:The state field was blank, or it doesn’t match a recognized US state or Canadian province abbreviation.
“Missing ZIP / Postal Code”:address1 was provided but zip was blank. Provide a valid ZIP code alongside the other required fields.
“Invalid country code”:The country field contains a value other than US or CA.
“Invalid EIN”:The ein value doesn’t match the XX-XXXXXXX format (two digits, a dash, then seven digits).
“Invalid email address”:The email value isn’t a properly formatted email address.
“Invalid phone number”:The phone value doesn’t match a recognized phone number format.
“Invalid vendor status”:The vendorStatus value isn’t one of the accepted options: 1, 0, or -99.
“Invalid characters in name or address”:A name or address field contains characters that aren’t permitted. See the allowed character lists in the tables above.
Import vendors
You can import a list of vendors into Payabli using the API. This is useful if you have many vendors to add at once, or if you want to automate the process. Before you get started, download the example CSV file and open it with the editor of your choice. Use it as an example to help you build your import file.
To import a list of vendors, send a POST request to the /api/Import/vendorsForm/{entrypoint} endpoint, with an attached CSV file.
This example imports vendorImport.csv for the entrypoint e56ce00572.
A successful request returns a JSON response with the number of added and rejected records, and any errors. The imported data is now available for use, and you can confirm by checking PartnerHub or PayHub.
After you import vendors, you can manage them with the API. For example, you can update vendor information, manage payment methods, and create bills associated with specific vendors.
Manage vendors
You can use the API to manage existing vendors, including updating their information, deleting them, and retrieving their details. See these endpoint references for more information:
Vendor status
In vendor endpoints and endpoints that return vendor data, the vendor status field is VendorStatus.
Enrich vendors
You can use AI-powered vendor enrichment to automatically gather payment acceptance info and contact information for your vendors. Enrichment scans invoices and searches the web to fill in vendor details, reducing manual research. See Vendor enrichment for an overview, or Enrich vendors with the API for implementation details.
Related resources
See these related resources to help you get the most out of Payabli.