# Create vendor POST https://api-sandbox.payabli.com/api/Vendor/single/{entry} Content-Type: application/json Creates a vendor in an entrypoint. Reference: https://docs.payabli.com/developers/api-reference/vendor/create-vendor ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create vendor version: endpoint_vendor.AddVendor paths: /Vendor/single/{entry}: post: operationId: add-vendor summary: Create vendor description: Creates a vendor in an entrypoint. tags: - - subpackage_vendor parameters: - name: entry in: path description: Entrypoint identifier. required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponseVendors' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/type_:VendorData' components: schemas: type_:VendorNumber: type: string type_:AdditionalData: type: object additionalProperties: type: object additionalProperties: description: Any type type_:AddressNullable: type: string type_:AddressAddtlNullable: type: string type_:BankAccountHolderName: type: string type_:BankAccountHolderType: type: string enum: - value: Personal - value: Business type_:BankName: type: string type_:RoutingAccount: type: string type_:TypeAccount: type: string enum: - value: Checking - value: Savings type_:BillingData: type: object properties: accountNumber: type: string description: Account number for bank account. bankAccountFunction: type: integer description: >- Describes whether the bank account is used for deposits or withdrawals in Payabli: - `0`: Deposit - `1`: Withdrawal - `2`: Deposit and withdrawal bankAccountHolderName: $ref: '#/components/schemas/type_:BankAccountHolderName' bankAccountHolderType: $ref: '#/components/schemas/type_:BankAccountHolderType' bankName: $ref: '#/components/schemas/type_:BankName' id: type: integer description: The bank's ID in Payabli. routingAccount: $ref: '#/components/schemas/type_:RoutingAccount' typeAccount: $ref: '#/components/schemas/type_:TypeAccount' type_:Email: type: string format: email type_:AdditionalDataString: type: string type_:Contacts: type: object properties: contactEmail: $ref: '#/components/schemas/type_:Email' description: Contact email address. contactName: type: string description: Contact name. contactPhone: type: string description: Contact phone number. contactTitle: type: string description: Contact title. additionalData: $ref: '#/components/schemas/type_:AdditionalDataString' type_:ContactsField: type: array items: $ref: '#/components/schemas/type_:Contacts' type_:VendorEin: type: string type_:LocationCode: type: string type_:Mcc: type: string type_:VendorName1: type: string type_:VendorName2: type: string type_:PayeeName: type: string type_:VendorPaymentMethodString: type: string type_:VendorPhone: type: string type_:Remitaddress1: type: string type_:Remitaddress2: type: string type_:Remitcity: type: string type_:Remitcountry: type: string type_:RemitEmail: type: string format: email type_:Remitstate: type: string type_:Remitzip: type: string type_:Vendorstatus: type: integer type_:VendorData: type: object properties: vendorNumber: $ref: '#/components/schemas/type_:VendorNumber' AdditionalData: $ref: '#/components/schemas/type_:AdditionalData' address1: $ref: '#/components/schemas/type_:AddressNullable' description: Vendor's address address2: $ref: '#/components/schemas/type_:AddressAddtlNullable' description: Additional line for vendor's address. billingData: $ref: '#/components/schemas/type_:BillingData' description: Object containing vendor's bank information. city: type: string description: Vendor's city. contacts: $ref: '#/components/schemas/type_:ContactsField' description: Array of objects describing the vendor's contacts. country: type: string description: Vendor's country. customField1: type: string description: Custom field 1 for vendor customField2: type: string description: Custom field 2 for vendor customerVendorAccount: type: string description: Account number of paypoint in the vendor side. ein: $ref: '#/components/schemas/type_:VendorEin' email: $ref: '#/components/schemas/type_:Email' description: Vendor's email address. Required for vCard. internalReferenceId: type: integer format: int64 description: Internal identifier for global vendor account. locationCode: $ref: '#/components/schemas/type_:LocationCode' mcc: $ref: '#/components/schemas/type_:Mcc' name1: $ref: '#/components/schemas/type_:VendorName1' name2: $ref: '#/components/schemas/type_:VendorName2' payeeName1: $ref: '#/components/schemas/type_:PayeeName' payeeName2: $ref: '#/components/schemas/type_:PayeeName' paymentMethod: $ref: '#/components/schemas/type_:VendorPaymentMethodString' phone: $ref: '#/components/schemas/type_:VendorPhone' remitAddress1: $ref: '#/components/schemas/type_:Remitaddress1' remitAddress2: $ref: '#/components/schemas/type_:Remitaddress2' remitCity: $ref: '#/components/schemas/type_:Remitcity' remitCountry: $ref: '#/components/schemas/type_:Remitcountry' remitEmail: $ref: '#/components/schemas/type_:RemitEmail' remitState: $ref: '#/components/schemas/type_:Remitstate' remitZip: $ref: '#/components/schemas/type_:Remitzip' state: type: string description: Vendor's state. Must be a 2 character state code. vendorStatus: $ref: '#/components/schemas/type_:Vendorstatus' zip: type: string description: Vendor's zip code. type_:IsSuccess: type: boolean type_:PageIdentifier: type: string type_:Responsecode: type: integer type_:ResponseText: type: string type_:PayabliApiResponseVendors: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseData: type: integer description: >- If the request was successful, this field contains the identifier for the vendor. responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```python CreateVendor from payabli import BillingData, Contacts, payabli client = payabli( api_key="YOUR_API_KEY", ) client.vendor.add_vendor( entry="8cfec329267", vendor_number="1234", name_1="Herman's Coatings and Masonry", name_2="", ein="12-3456789", phone="5555555555", email="example@email.com", address_1="123 Ocean Drive", address_2="Suite 400", city="Miami", state="FL", zip="33139", country="US", mcc="7777", location_code="MIA123", contacts=[ Contacts( contact_name="Herman Martinez", contact_email="example@email.com", contact_title="Owner", contact_phone="3055550000", ) ], billing_data=BillingData( id=123, bank_name="Country Bank", routing_account="123123123", account_number="123123123", type_account="Checking", bank_account_holder_name="Gruzya Adventure Outfitters LLC", bank_account_holder_type="Business", bank_account_function=0, ), payment_method="managed", vendor_status=1, remit_address_1="123 Walnut Street", remit_address_2="Suite 900", remit_city="Miami", remit_state="FL", remit_zip="31113", remit_country="US", payee_name_1="", payee_name_2="", customer_vendor_account="A-37622", internal_reference_id=123, ) ``` ```typescript CreateVendor import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.vendor.addVendor("8cfec329267", { vendorNumber: "1234", name1: "Herman's Coatings and Masonry", name2: "", ein: "12-3456789", phone: "5555555555", email: "example@email.com", address1: "123 Ocean Drive", address2: "Suite 400", city: "Miami", state: "FL", zip: "33139", country: "US", mcc: "7777", locationCode: "MIA123", contacts: [{ contactName: "Herman Martinez", contactEmail: "example@email.com", contactTitle: "Owner", contactPhone: "3055550000" }], billingData: { id: 123, bankName: "Country Bank", routingAccount: "123123123", accountNumber: "123123123", typeAccount: "Checking", bankAccountHolderName: "Gruzya Adventure Outfitters LLC", bankAccountHolderType: "Business", bankAccountFunction: 0 }, paymentMethod: "managed", vendorStatus: 1, remitAddress1: "123 Walnut Street", remitAddress2: "Suite 900", remitCity: "Miami", remitState: "FL", remitZip: "31113", remitCountry: "US", payeeName1: "", payeeName2: "", customerVendorAccount: "A-37622", internalReferenceId: 123 }); ``` ```go CreateVendor import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Vendor.AddVendor( context.TODO(), "8cfec329267", &sdkgo.VendorData{ VendorNumber: sdkgo.String( "1234", ), Name1: sdkgo.String( "Herman's Coatings and Masonry", ), Name2: sdkgo.String( "", ), Ein: sdkgo.String( "12-3456789", ), Phone: sdkgo.String( "5555555555", ), Email: sdkgo.String( "example@email.com", ), Address1: sdkgo.String( "123 Ocean Drive", ), Address2: sdkgo.String( "Suite 400", ), City: sdkgo.String( "Miami", ), State: sdkgo.String( "FL", ), Zip: sdkgo.String( "33139", ), Country: sdkgo.String( "US", ), Mcc: sdkgo.String( "7777", ), LocationCode: sdkgo.String( "MIA123", ), Contacts: []*sdkgo.Contacts{ &sdkgo.Contacts{ ContactName: sdkgo.String( "Herman Martinez", ), ContactEmail: sdkgo.String( "example@email.com", ), ContactTitle: sdkgo.String( "Owner", ), ContactPhone: sdkgo.String( "3055550000", ), }, }, BillingData: &sdkgo.BillingData{ Id: sdkgo.Int( 123, ), BankName: sdkgo.String( "Country Bank", ), RoutingAccount: sdkgo.String( "123123123", ), AccountNumber: sdkgo.String( "123123123", ), TypeAccount: sdkgo.TypeAccountChecking, BankAccountHolderName: sdkgo.String( "Gruzya Adventure Outfitters LLC", ), BankAccountHolderType: sdkgo.BankAccountHolderTypeBusiness, BankAccountFunction: sdkgo.Int( 0, ), }, PaymentMethod: sdkgo.String( "managed", ), VendorStatus: sdkgo.Int( 1, ), RemitAddress1: sdkgo.String( "123 Walnut Street", ), RemitAddress2: sdkgo.String( "Suite 900", ), RemitCity: sdkgo.String( "Miami", ), RemitState: sdkgo.String( "FL", ), RemitZip: sdkgo.String( "31113", ), RemitCountry: sdkgo.String( "US", ), PayeeName1: sdkgo.String( "", ), PayeeName2: sdkgo.String( "", ), CustomerVendorAccount: sdkgo.String( "A-37622", ), InternalReferenceId: sdkgo.Int64( 123, ), }, ) ``` ```csharp CreateVendor using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Vendor.AddVendorAsync( "8cfec329267", new VendorData { VendorNumber = "1234", Name1 = "Herman's Coatings and Masonry", Name2 = "", Ein = "12-3456789", Phone = "5555555555", Email = "example@email.com", Address1 = "123 Ocean Drive", Address2 = "Suite 400", City = "Miami", State = "FL", Zip = "33139", Country = "US", Mcc = "7777", LocationCode = "MIA123", Contacts = new List() { new Contacts { ContactName = "Herman Martinez", ContactEmail = "example@email.com", ContactTitle = "Owner", ContactPhone = "3055550000", }, }, BillingData = new BillingData { Id = 123, BankName = "Country Bank", RoutingAccount = "123123123", AccountNumber = "123123123", TypeAccount = TypeAccount.Checking, BankAccountHolderName = "Gruzya Adventure Outfitters LLC", BankAccountHolderType = BankAccountHolderType.Business, BankAccountFunction = 0, }, PaymentMethod = "managed", VendorStatus = 1, RemitAddress1 = "123 Walnut Street", RemitAddress2 = "Suite 900", RemitCity = "Miami", RemitState = "FL", RemitZip = "31113", RemitCountry = "US", PayeeName1 = "", PayeeName2 = "", CustomerVendorAccount = "A-37622", InternalReferenceId = 123, } ); ``` ```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"] = '' 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\": \"\",\n \"payeeName1\": \"\",\n \"payeeName2\": \"\",\n \"paymentMethod\": \"managed\",\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 ``` ```java CreateVendor HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/Vendor/single/8cfec329267") .header("requestToken", "") .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\": \"\",\n \"payeeName1\": \"\",\n \"payeeName2\": \"\",\n \"paymentMethod\": \"managed\",\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(); ``` ```php CreateVendor 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": "", "payeeName1": "", "payeeName2": "", "paymentMethod": "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' => '', ], ]); echo $response->getBody(); ``` ```swift CreateVendor import Foundation let headers = [ "requestToken": "", "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": "", "payeeName1": "", "payeeName2": "", "paymentMethod": "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() ```