Manage vendors with the API

Learn how to add and manage vendors with the Payabli API

Applies to:Developers

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.

Payabli supports payouts to US and Canadian vendors only. International vendors aren’t supported, and as a best practice you should avoid adding them in Payabli.

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.

POST
/api/Vendor/single/:entry
1curl -X POST https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "vendorNumber": "1234",
6 "address1": "123 Ocean Drive",
7 "address2": "Suite 400",
8 "billingData": {
9 "accountNumber": "123123123",
10 "bankAccountFunction": 0,
11 "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
12 "bankAccountHolderType": "Business",
13 "bankName": "Country Bank",
14 "id": 123,
15 "routingAccount": "123123123",
16 "typeAccount": "Checking"
17 },
18 "city": "Miami",
19 "contacts": [
20 {
21 "contactEmail": "example@email.com",
22 "contactName": "Herman Martinez",
23 "contactPhone": "3055550000",
24 "contactTitle": "Owner"
25 }
26 ],
27 "country": "US",
28 "customerVendorAccount": "A-37622",
29 "ein": "12-3456789",
30 "email": "example@email.com",
31 "internalReferenceId": 123,
32 "locationCode": "MIA123",
33 "mcc": "7777",
34 "name1": "Herman\'s Coatings and Masonry",
35 "name2": "<string>",
36 "payeeName1": "<string>",
37 "payeeName2": "<string>",
38 "paymentMethod": {
39 "method": "managed"
40 },
41 "phone": "5555555555",
42 "remitAddress1": "123 Walnut Street",
43 "remitAddress2": "Suite 900",
44 "remitCity": "Miami",
45 "remitCountry": "US",
46 "remitState": "FL",
47 "remitZip": "31113",
48 "state": "FL",
49 "vendorStatus": 1,
50 "zip": "33139"
51}'

A successful request returns a JSON response. The IdVendor is returned as responseData.

Response
1{
2 "isSuccess": true,
3 "responseCode": 1,
4 "responseData": 3890,
5 "responseText": "Success"
6}
The value returned in responseData is the vendor ID, and is used to manage the vendor via the API

Import vendors

You can import a list of vendors into Payabli using the API. This is useful if you have a large number of 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.

POST
/api/Import/vendorsForm/:entry
1curl -X POST https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267 \
2 -H "requestToken: <apiKey>" \
3 -H "Content-Type: multipart/form-data" \
4 -F file=@<file1>

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.

Response
1{
2 "isSuccess": true,
3 "pageIdentifier": "null",
4 "responseCode": 1,
5 "responseData": {
6 "added": 26,
7 "errors": [
8 "errors",
9 "errors"
10 ],
11 "rejected": 2
12 },
13 "responseText": "Success"
14}

The responseData object contains the number of records added and rejected. The errors field contains any errors that occurred during the import process.
Next steps

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.

ValueKey
Inactive0
Active1
Deleted-99