---
title: Update
slug: netsuite/0Bud-update
description: Learn how to update a vendor in NetSuite effortlessly with this comprehensive document. Find code snippets to update vital vendor details such as internal ID, currency, terms, category, email, and phone number. Discover how to modify custom fields, and ex
docTags: 
createdAt: 2021-10-26T11:52:35.000Z
---

The following is an example of updating a Vendor where we are changing some of the fields. (See [Vendor](docId\:C_d4TMRw1zb71V-7pN2Ty) for all available fields).  The NetSuite Vendor Id (internalId) is required to update the Vendor.

:::hint{type="info"}
Note: You can only update one record at a time.
:::

The response returns the complete vendor information, but we have shortened the response in our example for ease of reading.

:::CodeblockTabs
Request

```apex
//  Create a Map to store all the data of a Vendor
Map<String, Object> nsVendor = new Map<String, Object>();
	nsVendor.put('internalId', '32442');
    nsVendor.put('currencyRecord', new Map<String, Object>{'internalId'=>'2'});
    nsVendor.put('terms', new Map<String, Object>{'internalId'=>'5'});
    nsVendor.put('category', new Map<String, Object>{'internalId'=>'4'});
    nsVendor.put('email', 'john@pyramid.com');
    nsVendor.put('phone', '7897734343');

//  Initializing the Vendor Custom Fields
    List<Object> vendCustomFieldList = new List<Object>();
    Map<String, Object> vendCustomField1 = new Map<String, Object>();
        vendCustomField1.put('fieldType', 'date');
        vendCustomField1.put('scriptId', 'custentity_renewal_date');
        vendCustomField1.put('value', String.valueOf(DateTime.newInstance(2020, 12, 26).getTime()/1000));
        vendCustomFieldList.add(vendCustomField1);
    Map<String,Object> vendCustomField2 = new Map<String, Object>();
        vendCustomField2.put('fieldType', 'String');
        vendCustomField2.put('scriptId', 'custentity_vendor_description');
        vendCustomField2.put('value', 'Vendor for the Construction Materials');
        vendCustomFieldList.add(vendCustomField2);

//  Adding the Vendor Custom Fields
    nsVendor.put('customFieldList', new Map<String, Object>{'customField'=>vendCustomFieldList});

//  Initializing the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
    requestJSONMap.put('vendors', new List<Object>{nsVendor});
    String reqJSON = JSON.serialize(requestJSONMap);

Map<String, Object> reqObj = new Map<String, Object>();
    reqObj.put('version', '1.0');
    reqObj.put('action', 'updateVendor');
    reqObj.put('requestJSON', reqJSON);

//  Placing a request to Breadwinner Global API
Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);
System.debug(resp);
```

Response

```json
{
  action=updateVendor,
  timestamp=1607420691759,
  validRequest=true,
  version=1.0,
  responseJSON={
    "status": "200",
    "errors": [],
    "vendors": [
      {
        "url": "https://www.pyramid.com",
        "title": null,
        "terms": {
          "type": null,
          "name": "1% 10 Net 30",
          "internalId": "5",
          "externalId": null
        },
        "taxItem": null,
        "taxIdNum": null,
        "subsidiary": {
          "type": null,
          "name": "Parent Company",
          "internalId": "1",
          "externalId": null
        },
        "salutation": null,
        "salesforceID": "a012w00000XUnDLAA1",
        "phone": "7897734343",
        "payablesAccount": {
          "type": null,
          "name": "Accounts Payable",
          "internalId": "114",
          "externalId": null
        },
        "nullFieldList": null,
        "mobilePhone": null,
        "middleName": null,
        "legalName": null,
        "lastName": null,
        "lastModifiedDate": 1607420689,
        "isPerson": false,
        "isJobResourceVend": false,
        "isInactive": false,
        "isAccountant": null,
        "is1099Eligible": null,
        "internalId": "32442",
        "incoterm": null,
        "homePhone": null,
        "firstName": null,
        "fax": null,
        "externalId": null,
        "expenseAccount": null,
        "entityId": "Pyramid Construction Inc.",
        "email": "john@pyramid.com",
        "dateCreated": 1607419609,
        "customForm": {
          "type": null,
          "name": "Custom Vendor Form",
          "internalId": "4",
          "externalId": null
        },
        "customFieldList": {
          "customField": [
            {
              "valueLookup": null,
              "value": "1608921000",
              "scriptId": "custentity_renewal_date",
              "internalId": "434",
              "fieldType": null
            },
            {
              "valueLookup": {
                "type": null,
                "name": "Forecast",
                "internalId": "1",
                "externalId": null
              },
              "value": null,
              "scriptId": "custentity_atlas_pbcs_category",
              "internalId": "131",
              "fieldType": null
            },
            {
              "valueLookup": null,
              "value": "Vendor for the Construction Materials",
              "scriptId": "custentity_vendor_description",
              "internalId": "437",
              "fieldType": null
            }
          ]
        },
        "currencyRecord": {
          "type": null,
          "name": "US Dollars",
          "internalId": "2",
          "externalId": null
        },
        "currencyList": {
          "vendorCurrency": [
            {
              "currencyRecord": {
                "type": null,
                "name": "INR",
                "internalId": "1",
                "externalId": null
              }
            },
            {
              "currencyRecord": {
                "type": null,
                "name": "US Dollars",
                "internalId": "2",
                "externalId": null
              }
            }
          ],
          "currencyRecord": null
        },
        "creditLimit": null,
        "companyName": "Pyramid Construction Inc.",
        "category": {
          "type": null,
          "name": "Supplies",
          "internalId": "4",
          "externalId": null
        },
        "bcn": null,
        "addressbookList": {
          "replaceAll": null,
          "addressbook": [
            {
              "label": "2334 N. Michigan Avenue, Suite 1500",
              "isResidential": null,
              "internalId": "29789",
              "defaultShipping": true,
              "defaultBilling": true,
              "addressbookAddress": {
                "zip": "60601",
                "state": "IL",
                "internalId": null,
                "country": "_unitedStates",
                "city": "Chicago",
                "attention": null,
                "addrPhone": null,
                "addressee": "Pyramid Construction Inc.",
                "addr3": null,
                "addr2": null,
                "addr1": "2334 N. Michigan Avenue, Suite 1500"
              }
            }
          ]
        },
        "accountNumber": null
      }
    ]
  }
}
```
:::

