---
title: Update
slug: netsuite/update
description: Learn how to update customer information using NetSuite with this comprehensive document. It covers various fields such as company name, custom form, currency, price level, and more. Discover how to update custom fields and customer addresses, and obtain 
docTags: 
createdAt: 2021-10-26T11:52:35.000Z
---

The following is an example of updating the Customer where we are changing some of the fields. (See [Customer](docId\:hnjmkN99QxWdEafyYIFSq) for all available fields).  The NetSuite customer Id (internalId) is required to update the customer.

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

The response returns the complete customer 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 Customer
Map<String, Object> nsCustomer = new Map<String, Object>();
nsCustomer.put('internalId', '121357');
nsCustomer.put('companyName', 'Grand Hotels & Resorts Ltd');
nsCustomer.put('customForm', new Map<String, Object>{'internalId'=>'-2'});
nsCustomer.put('currencyRecord', new Map<String, Object>{'internalId'=>'1'});
nsCustomer.put('priceLevel', new Map<String, Object>{'internalId'=>'1'});
nsCustomer.put('receivablesAccount', new Map<String, Object>{'internalId'=>'122'});
nsCustomer.put('subsidiary', new Map<String, Object>{'internalId'=>'1'});
nsCustomer.put('startDate', DateTime.newInstance(2020, 12, 2).getTime()/1000);
nsCustomer.put('terms', new Map<String, Object>{'internalId'=>'5'});
nsCustomer.put('territory', new Map<String, Object>{'internalId'=>'-5'});
nsCustomer.put('url', 'https://www.grandhotel.com');

//  Initialize the Customer Custom Fields
List<Object> custCustomFieldList = new List<Object>();
Map<String, Object> custCustomField1 = new Map<String, Object>();
custCustomField1.put('fieldType', 'select');
custCustomField1.put('scriptId', 'custentityrating');
custCustomField1.put('valueLookup', new Map<String, Object>{'internalId'=>'2'});
custCustomFieldList.add(custCustomField1);

Map<String, Object> custCustomField2 = new Map<String, Object>();
custCustomField2.put('fieldType', 'double');
custCustomField2.put('scriptId', 'custentity_decimal');
custCustomField2.put('value', '76.89');
custCustomFieldList.add(custCustomField2);

//  Add the Customer Custom Fields
nsCustomer.put('customFieldList', new Map<String, Object>{'customField'=>custCustomFieldList});

//  Initialize the Customer Addresses
List<Object> addressBookList = new List<Object>();
Map<String, Object> addressBook = new Map<String, Object>();
Map<String, Object> addressbookAddress = new Map<String, Object>();
addressbookAddress.put('addr1','2334 N. Michigan Avenue, Suite 1500');
addressbookAddress.put('city','Chicago');
addressbookAddress.put('state','IL');
addressbookAddress.put('country','_unitedStates');
addressbookAddress.put('zip','60601');

addressBook.put('addressbookAddress',addressbookAddress);
addressBook.put('defaultBilling',true);
addressBook.put('defaultShipping',true);
addressBook.put('isResidential',true);

addressBookList.add(addressBook);

nsCustomer.put('addressbookList', new Map<String,Object>{'addressbook'=>addressBookList});	

//  Initialize the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
requestJSONMap.put('customers', new List<Object>{nsCustomer});
String reqJSON = JSON.serialize(requestJSONMap);

Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'updateCustomer');
reqObj.put('requestJSON', reqJSON);

//  Place a request to Breadwinner Global API
Map<String, Object> resp = breadwinner_ns.BreadwinnerNetSuiteAPI.call(reqObj);
System.debug(resp);
```

Response

```json
{
  action=createCustomer,
  timestamp=1606907168426,
  validRequest=true,
  version=1.0,
  responseJSON={
    "status": "200",
    "errors": [],
    "customers": [
      {
        "vatRegNumber": null,
        "url": "https://www.grandhotel.com",
        "title": null,
        "territory": {
          "type": null,
          "name": "Default Round-Robin",
          "internalId": "-5",
          "externalId": null
        },
        "terms": {
          "type": null,
          "name": "1% 10 Net 30",
          "internalId": "5",
          "externalId": null
        },
        "taxItem": null,
        "subsidiary": {
          "type": null,
          "name": "Parent Company",
          "internalId": "1",
          "externalId": null
        },
        "startDate": 1606847400,
        "stage": "_customer",
        "salutation": null,
        "salesRep": null,
        "salesforceID": "a012w00000XUP93AAH",
        "resaleNumber": null,
        "reminderDays": null,
        "receivablesAccount": {
          "type": null,
          "name": "Accounts Receivable",
          "internalId": "122",
          "externalId": null
        },
        "priceLevel": {
          "type": null,
          "name": "Base Price",
          "internalId": "1",
          "externalId": null
        },
        "phone": null,
        "parent": null,
        "nullFieldList": null,
        "middleName": null,
        "lastName": null,
        "lastModifiedDate": 1606907165,
        "itemPricingList": null,
        "isPerson": false,
        "isInactive": false,
        "internalId": "32342",
        "firstName": null,
        "fax": null,
        "externalId": null,
        "entityStatus": {
          "type": null,
          "name": "CUSTOMER-Closed Won",
          "internalId": "13",
          "externalId": null
        },
        "entityId": "CUST533AT Grand Hotels & Resorts Ltd",
        "endDate": null,
        "email": null,
        "dateCreated": 1606907165,
        "customForm": {
          "type": null,
          "name": "Standard Customer Form",
          "internalId": "-2",
          "externalId": null
        },
        "customFieldList": {
          "customField": [
            {
              "valueLookup": null,
              "value": "76.89",
              "scriptId": "custentity_decimal",
              "internalId": "435",
              "fieldType": null
            },
            {
              "valueLookup": {
                "type": null,
                "name": "Acquired",
                "internalId": "2",
                "externalId": null
              },
              "value": null,
              "scriptId": "custentityrating",
              "internalId": "42",
              "fieldType": null
            }
          ]
        },
        "currencyRecord": {
          "type": null,
          "name": "INR",
          "internalId": "1",
          "externalId": null
        },
        "currencyList": {
          "currencyRecord": [
            {
              "currencyRecord": {
                "type": null,
                "name": "INR",
                "internalId": "1",
                "externalId": null
              }
            }
          ]
        },
        "creditLimit": null,
        "creditHoldOverride": "_auto",
        "companyName": "Grand Hotels & Resorts Ltd",
        "category": null,
        "addressbookList": {
          "replaceAll": null,
          "addressbook": [
            {
              "label": "2334 N. Michigan Avenue, Suite 1500",
              "isResidential": true,
              "internalId": "29188",
              "defaultShipping": true,
              "defaultBilling": true,
              "addressbookAddress": {
                "zip": "60601",
                "state": "IL",
                "internalId": null,
                "country": "_unitedStates",
                "city": "Chicago",
                "attention": null,
                "addrPhone": null,
                "addressee": "Grand Hotels & Resorts Ltd",
                "addr3": null,
                "addr2": null,
                "addr1": "2334 N. Michigan Avenue, Suite 1500"
              }
            }
          ]
        },
        "accountNumber": null
      }
    ]
  }
}
```
:::



