# Update vendor PUT https://api-sandbox.payabli.com/api/Vendor/{idVendor} Content-Type: application/json Updates a vendor's information. Send only the fields you need to update. Reference: https://docs.payabli.com/developers/api-reference/vendor/update-vendor ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update vendor version: endpoint_vendor.EditVendor paths: /Vendor/{idVendor}: put: operationId: edit-vendor summary: Update vendor description: Updates a vendor's information. Send only the fields you need to update. tags: - - subpackage_vendor parameters: - name: idVendor in: path description: Vendor ID. required: true schema: type: integer - 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 Update `name1` field from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.vendor.edit_vendor( id_vendor=1, name_1="Theodore's Janitorial", ) ``` ```typescript Update `name1` field import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.vendor.editVendor(1, { name1: "Theodore's Janitorial" }); ``` ```go Update `name1` field 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.EditVendor( context.TODO(), 1, &sdkgo.VendorData{ Name1: sdkgo.String( "Theodore's Janitorial", ), }, ) ``` ```csharp Update `name1` field using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Vendor.EditVendorAsync(1, new VendorData { Name1 = "Theodore's Janitorial" }); ``` ```ruby Update `name1` field require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Vendor/1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"name1\": \"Theodore's Janitorial\"\n}" response = http.request(request) puts response.read_body ``` ```java Update `name1` field HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/Vendor/1") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"name1\": \"Theodore's Janitorial\"\n}") .asString(); ``` ```php Update `name1` field request('PUT', 'https://api-sandbox.payabli.com/api/Vendor/1', [ 'body' => '{ "name1": "Theodore\'s Janitorial" }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Update `name1` field import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = ["name1": "Theodore's Janitorial"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Vendor/1")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" 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() ```