> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://beta-docs.payabli.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://beta-docs.payabli.com/_mcp/server.

# 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.

> **Note**
>
> 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](/api-reference/vendor/create-vendor) for this endpoint.

This example creates a new vendor record in the entrypoint `8cfec329267`.

### Request

POST [https://api-sandbox.payabli.com/api/Vendor/single/\{entry}](https://api-sandbox.payabli.com/api/Vendor/single/\{entry})

**`CreateVendor`**

```curl CreateVendor
curl -X POST https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267 \
     -H "requestToken: <apiKey>" \
     -H "Content-Type: application/json" \
     -d '{
  "vendorNumber": "1234",
  "address1": "123 Ocean Drive",
  "address2": "Suite 400",
  "billingData": {
    "accountNumber": "123123123",
    "bankAccountFunction": 0,
    "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
    "bankAccountHolderType": "Business",
    "bankName": "Country Bank",
    "id": 123,
    "routingAccount": "123123123",
    "typeAccount": "Checking"
  },
  "city": "Miami",
  "contacts": [
    {
      "contactEmail": "example@email.com",
      "contactName": "Herman Martinez",
      "contactPhone": "3055550000",
      "contactTitle": "Owner"
    }
  ],
  "country": "US",
  "customerVendorAccount": "A-37622",
  "ein": "12-3456789",
  "email": "example@email.com",
  "internalReferenceId": 123,
  "locationCode": "MIA123",
  "mcc": "7777",
  "name1": "Herman'\''s Coatings and Masonry",
  "name2": "<string>",
  "payeeName1": "<string>",
  "payeeName2": "<string>",
  "paymentMethod": {
    "method": "managed"
  },
  "phone": "5555555555",
  "remitAddress1": "123 Walnut Street",
  "remitAddress2": "Suite 900",
  "remitCity": "Miami",
  "remitCountry": "US",
  "remitState": "FL",
  "remitZip": "31113",
  "state": "FL",
  "vendorStatus": 1,
  "zip": "33139"
}'
```

**`CreateVendor`**

```python CreateVendor
import requests

url = "https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267"

payload = {
    "vendorNumber": "1234",
    "address1": "123 Ocean Drive",
    "address2": "Suite 400",
    "billingData": {
        "accountNumber": "123123123",
        "bankAccountFunction": 0,
        "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
        "bankAccountHolderType": "Business",
        "bankName": "Country Bank",
        "id": 123,
        "routingAccount": "123123123",
        "typeAccount": "Checking"
    },
    "city": "Miami",
    "contacts": [
        {
            "contactEmail": "example@email.com",
            "contactName": "Herman Martinez",
            "contactPhone": "3055550000",
            "contactTitle": "Owner"
        }
    ],
    "country": "US",
    "customerVendorAccount": "A-37622",
    "ein": "12-3456789",
    "email": "example@email.com",
    "internalReferenceId": 123,
    "locationCode": "MIA123",
    "mcc": "7777",
    "name1": "Herman's Coatings and Masonry",
    "name2": "<string>",
    "payeeName1": "<string>",
    "payeeName2": "<string>",
    "paymentMethod": { "method": "managed" },
    "phone": "5555555555",
    "remitAddress1": "123 Walnut Street",
    "remitAddress2": "Suite 900",
    "remitCity": "Miami",
    "remitCountry": "US",
    "remitState": "FL",
    "remitZip": "31113",
    "state": "FL",
    "vendorStatus": 1,
    "zip": "33139"
}
headers = {
    "requestToken": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

**`CreateVendor`**

```javascript CreateVendor
const url = 'https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267';
const options = {
  method: 'POST',
  headers: {requestToken: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"vendorNumber":"1234","address1":"123 Ocean Drive","address2":"Suite 400","billingData":{"accountNumber":"123123123","bankAccountFunction":0,"bankAccountHolderName":"Gruzya Adventure Outfitters LLC","bankAccountHolderType":"Business","bankName":"Country Bank","id":123,"routingAccount":"123123123","typeAccount":"Checking"},"city":"Miami","contacts":[{"contactEmail":"example@email.com","contactName":"Herman Martinez","contactPhone":"3055550000","contactTitle":"Owner"}],"country":"US","customerVendorAccount":"A-37622","ein":"12-3456789","email":"example@email.com","internalReferenceId":123,"locationCode":"MIA123","mcc":"7777","name1":"Herman\'s Coatings and Masonry","name2":"<string>","payeeName1":"<string>","payeeName2":"<string>","paymentMethod":{"method":"managed"},"phone":"5555555555","remitAddress1":"123 Walnut Street","remitAddress2":"Suite 900","remitCity":"Miami","remitCountry":"US","remitState":"FL","remitZip":"31113","state":"FL","vendorStatus":1,"zip":"33139"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`CreateVendor`**

```go CreateVendor
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267"

	payload := strings.NewReader("{\n  \"vendorNumber\": \"1234\",\n  \"address1\": \"123 Ocean Drive\",\n  \"address2\": \"Suite 400\",\n  \"billingData\": {\n    \"accountNumber\": \"123123123\",\n    \"bankAccountFunction\": 0,\n    \"bankAccountHolderName\": \"Gruzya Adventure Outfitters LLC\",\n    \"bankAccountHolderType\": \"Business\",\n    \"bankName\": \"Country Bank\",\n    \"id\": 123,\n    \"routingAccount\": \"123123123\",\n    \"typeAccount\": \"Checking\"\n  },\n  \"city\": \"Miami\",\n  \"contacts\": [\n    {\n      \"contactEmail\": \"example@email.com\",\n      \"contactName\": \"Herman Martinez\",\n      \"contactPhone\": \"3055550000\",\n      \"contactTitle\": \"Owner\"\n    }\n  ],\n  \"country\": \"US\",\n  \"customerVendorAccount\": \"A-37622\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"example@email.com\",\n  \"internalReferenceId\": 123,\n  \"locationCode\": \"MIA123\",\n  \"mcc\": \"7777\",\n  \"name1\": \"Herman's Coatings and Masonry\",\n  \"name2\": \"<string>\",\n  \"payeeName1\": \"<string>\",\n  \"payeeName2\": \"<string>\",\n  \"paymentMethod\": {\n    \"method\": \"managed\"\n  },\n  \"phone\": \"5555555555\",\n  \"remitAddress1\": \"123 Walnut Street\",\n  \"remitAddress2\": \"Suite 900\",\n  \"remitCity\": \"Miami\",\n  \"remitCountry\": \"US\",\n  \"remitState\": \"FL\",\n  \"remitZip\": \"31113\",\n  \"state\": \"FL\",\n  \"vendorStatus\": 1,\n  \"zip\": \"33139\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("requestToken", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`CreateVendor`**

```ruby CreateVendor
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"vendorNumber\": \"1234\",\n  \"address1\": \"123 Ocean Drive\",\n  \"address2\": \"Suite 400\",\n  \"billingData\": {\n    \"accountNumber\": \"123123123\",\n    \"bankAccountFunction\": 0,\n    \"bankAccountHolderName\": \"Gruzya Adventure Outfitters LLC\",\n    \"bankAccountHolderType\": \"Business\",\n    \"bankName\": \"Country Bank\",\n    \"id\": 123,\n    \"routingAccount\": \"123123123\",\n    \"typeAccount\": \"Checking\"\n  },\n  \"city\": \"Miami\",\n  \"contacts\": [\n    {\n      \"contactEmail\": \"example@email.com\",\n      \"contactName\": \"Herman Martinez\",\n      \"contactPhone\": \"3055550000\",\n      \"contactTitle\": \"Owner\"\n    }\n  ],\n  \"country\": \"US\",\n  \"customerVendorAccount\": \"A-37622\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"example@email.com\",\n  \"internalReferenceId\": 123,\n  \"locationCode\": \"MIA123\",\n  \"mcc\": \"7777\",\n  \"name1\": \"Herman's Coatings and Masonry\",\n  \"name2\": \"<string>\",\n  \"payeeName1\": \"<string>\",\n  \"payeeName2\": \"<string>\",\n  \"paymentMethod\": {\n    \"method\": \"managed\"\n  },\n  \"phone\": \"5555555555\",\n  \"remitAddress1\": \"123 Walnut Street\",\n  \"remitAddress2\": \"Suite 900\",\n  \"remitCity\": \"Miami\",\n  \"remitCountry\": \"US\",\n  \"remitState\": \"FL\",\n  \"remitZip\": \"31113\",\n  \"state\": \"FL\",\n  \"vendorStatus\": 1,\n  \"zip\": \"33139\"\n}"

response = http.request(request)
puts response.read_body
```

**`CreateVendor`**

```java CreateVendor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267")
  .header("requestToken", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"vendorNumber\": \"1234\",\n  \"address1\": \"123 Ocean Drive\",\n  \"address2\": \"Suite 400\",\n  \"billingData\": {\n    \"accountNumber\": \"123123123\",\n    \"bankAccountFunction\": 0,\n    \"bankAccountHolderName\": \"Gruzya Adventure Outfitters LLC\",\n    \"bankAccountHolderType\": \"Business\",\n    \"bankName\": \"Country Bank\",\n    \"id\": 123,\n    \"routingAccount\": \"123123123\",\n    \"typeAccount\": \"Checking\"\n  },\n  \"city\": \"Miami\",\n  \"contacts\": [\n    {\n      \"contactEmail\": \"example@email.com\",\n      \"contactName\": \"Herman Martinez\",\n      \"contactPhone\": \"3055550000\",\n      \"contactTitle\": \"Owner\"\n    }\n  ],\n  \"country\": \"US\",\n  \"customerVendorAccount\": \"A-37622\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"example@email.com\",\n  \"internalReferenceId\": 123,\n  \"locationCode\": \"MIA123\",\n  \"mcc\": \"7777\",\n  \"name1\": \"Herman's Coatings and Masonry\",\n  \"name2\": \"<string>\",\n  \"payeeName1\": \"<string>\",\n  \"payeeName2\": \"<string>\",\n  \"paymentMethod\": {\n    \"method\": \"managed\"\n  },\n  \"phone\": \"5555555555\",\n  \"remitAddress1\": \"123 Walnut Street\",\n  \"remitAddress2\": \"Suite 900\",\n  \"remitCity\": \"Miami\",\n  \"remitCountry\": \"US\",\n  \"remitState\": \"FL\",\n  \"remitZip\": \"31113\",\n  \"state\": \"FL\",\n  \"vendorStatus\": 1,\n  \"zip\": \"33139\"\n}")
  .asString();
```

**`CreateVendor`**

```php CreateVendor
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267', [
  'body' => '{
  "vendorNumber": "1234",
  "address1": "123 Ocean Drive",
  "address2": "Suite 400",
  "billingData": {
    "accountNumber": "123123123",
    "bankAccountFunction": 0,
    "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
    "bankAccountHolderType": "Business",
    "bankName": "Country Bank",
    "id": 123,
    "routingAccount": "123123123",
    "typeAccount": "Checking"
  },
  "city": "Miami",
  "contacts": [
    {
      "contactEmail": "example@email.com",
      "contactName": "Herman Martinez",
      "contactPhone": "3055550000",
      "contactTitle": "Owner"
    }
  ],
  "country": "US",
  "customerVendorAccount": "A-37622",
  "ein": "12-3456789",
  "email": "example@email.com",
  "internalReferenceId": 123,
  "locationCode": "MIA123",
  "mcc": "7777",
  "name1": "Herman\'s Coatings and Masonry",
  "name2": "<string>",
  "payeeName1": "<string>",
  "payeeName2": "<string>",
  "paymentMethod": {
    "method": "managed"
  },
  "phone": "5555555555",
  "remitAddress1": "123 Walnut Street",
  "remitAddress2": "Suite 900",
  "remitCity": "Miami",
  "remitCountry": "US",
  "remitState": "FL",
  "remitZip": "31113",
  "state": "FL",
  "vendorStatus": 1,
  "zip": "33139"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`CreateVendor`**

```csharp CreateVendor
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267");
var request = new RestRequest(Method.POST);
request.AddHeader("requestToken", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"vendorNumber\": \"1234\",\n  \"address1\": \"123 Ocean Drive\",\n  \"address2\": \"Suite 400\",\n  \"billingData\": {\n    \"accountNumber\": \"123123123\",\n    \"bankAccountFunction\": 0,\n    \"bankAccountHolderName\": \"Gruzya Adventure Outfitters LLC\",\n    \"bankAccountHolderType\": \"Business\",\n    \"bankName\": \"Country Bank\",\n    \"id\": 123,\n    \"routingAccount\": \"123123123\",\n    \"typeAccount\": \"Checking\"\n  },\n  \"city\": \"Miami\",\n  \"contacts\": [\n    {\n      \"contactEmail\": \"example@email.com\",\n      \"contactName\": \"Herman Martinez\",\n      \"contactPhone\": \"3055550000\",\n      \"contactTitle\": \"Owner\"\n    }\n  ],\n  \"country\": \"US\",\n  \"customerVendorAccount\": \"A-37622\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"example@email.com\",\n  \"internalReferenceId\": 123,\n  \"locationCode\": \"MIA123\",\n  \"mcc\": \"7777\",\n  \"name1\": \"Herman's Coatings and Masonry\",\n  \"name2\": \"<string>\",\n  \"payeeName1\": \"<string>\",\n  \"payeeName2\": \"<string>\",\n  \"paymentMethod\": {\n    \"method\": \"managed\"\n  },\n  \"phone\": \"5555555555\",\n  \"remitAddress1\": \"123 Walnut Street\",\n  \"remitAddress2\": \"Suite 900\",\n  \"remitCity\": \"Miami\",\n  \"remitCountry\": \"US\",\n  \"remitState\": \"FL\",\n  \"remitZip\": \"31113\",\n  \"state\": \"FL\",\n  \"vendorStatus\": 1,\n  \"zip\": \"33139\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

**`CreateVendor`**

```swift CreateVendor
import Foundation

let headers = [
  "requestToken": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "vendorNumber": "1234",
  "address1": "123 Ocean Drive",
  "address2": "Suite 400",
  "billingData": [
    "accountNumber": "123123123",
    "bankAccountFunction": 0,
    "bankAccountHolderName": "Gruzya Adventure Outfitters LLC",
    "bankAccountHolderType": "Business",
    "bankName": "Country Bank",
    "id": 123,
    "routingAccount": "123123123",
    "typeAccount": "Checking"
  ],
  "city": "Miami",
  "contacts": [
    [
      "contactEmail": "example@email.com",
      "contactName": "Herman Martinez",
      "contactPhone": "3055550000",
      "contactTitle": "Owner"
    ]
  ],
  "country": "US",
  "customerVendorAccount": "A-37622",
  "ein": "12-3456789",
  "email": "example@email.com",
  "internalReferenceId": 123,
  "locationCode": "MIA123",
  "mcc": "7777",
  "name1": "Herman's Coatings and Masonry",
  "name2": "<string>",
  "payeeName1": "<string>",
  "payeeName2": "<string>",
  "paymentMethod": ["method": "managed"],
  "phone": "5555555555",
  "remitAddress1": "123 Walnut Street",
  "remitAddress2": "Suite 900",
  "remitCity": "Miami",
  "remitCountry": "US",
  "remitState": "FL",
  "remitZip": "31113",
  "state": "FL",
  "vendorStatus": 1,
  "zip": "33139"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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

### Response (200)

```json
{
  "isSuccess": true,
  "responseCode": 1,
  "responseData": 3890,
  "responseText": "Success"
}
```

> **Check**
>
> 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.

Download CSV

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.

### Request

POST [https://api-sandbox.payabli.com/api/Import/vendorsForm/\{entry}](https://api-sandbox.payabli.com/api/Import/vendorsForm/\{entry})

**`ImportVendor`**

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

**`ImportVendor`**

```python ImportVendor
import requests

url = "https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267"

files = { "file": "open('<file1>', 'rb')" }
headers = {"requestToken": "<apiKey>"}

response = requests.post(url, files=files, headers=headers)

print(response.json())
```

**`ImportVendor`**

```javascript ImportVendor
const url = 'https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267';
const form = new FormData();
form.append('file', '<file1>');

const options = {method: 'POST', headers: {requestToken: '<apiKey>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`ImportVendor`**

```go ImportVendor
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("requestToken", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`ImportVendor`**

```ruby ImportVendor
require 'uri'
require 'net/http'

url = URI("https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["requestToken"] = '<apiKey>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

**`ImportVendor`**

```java ImportVendor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267")
  .header("requestToken", "<apiKey>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

**`ImportVendor`**

```php ImportVendor
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267', [
  'multipart' => [
    [
        'name' => 'file',
        'filename' => '<file1>',
        'contents' => null
    ]
  ]
  'headers' => [
    'requestToken' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

**`ImportVendor`**

```csharp ImportVendor
using RestSharp;

var client = new RestClient("https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267");
var request = new RestRequest(Method.POST);
request.AddHeader("requestToken", "<apiKey>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"<file1>\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

**`ImportVendor`**

```swift ImportVendor
import Foundation

let headers = ["requestToken": "<apiKey>"]
let parameters = [
  [
    "name": "file",
    "fileName": "<file1>"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Import/vendorsForm/8cfec329267")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

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 (200)

```json
{
  "isSuccess": true,
  "pageIdentifier": "null",
  "responseCode": 1,
  "responseData": {
    "added": 26,
    "errors": [
      "errors",
      "errors"
    ],
    "rejected": 2
  },
  "responseText": "Success"
}
```

> **Check**
>
> 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:

* [Update Vendor](/api-reference/vendor/update-vendor)
* [Delete Vendor](/api-reference/vendor/delete-vendor)
* [Get Vendor](/api-reference/vendor/get-vendor)

## Vendor status

In vendor endpoints and endpoints that return vendor data, the vendor status field is `VendorStatus`.

<table>
  <thead>
    <tr>
      <th>
        Value
      </th>

      <th>
        Key
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        Inactive
      </td>

      <td>
        0
      </td>
    </tr>

    <tr>
      <td>
        Active
      </td>

      <td>
        1
      </td>
    </tr>

    <tr>
      <td>
        Deleted
      </td>

      <td>
        -99
      </td>
    </tr>
  </tbody>
</table>