---
title: Update
slug: quickbooks/6xiV-update
description: Learn how to update a customer in QuickBooks with this comprehensive document. Discover a helpful code snippet in Apex language that guides you through creating a map for storing customer data and submitting a request to update the customer. Gain valuable
docTags: 
createdAt: 2021-10-29T05:37:28.000Z
---

The following is an example of update Customer. The QuickBooks customer Id (Id) is required to update the customer (See [Customer](docId\:BEUVWRPdRH8smtNBYnEnJ) for the available fields).

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

- When you want to update specific fields of an entity without affecting others, use a sparse update operation by setting sparse= 'true' in your request. This approach is more efficient and less prone to unintended changes than a full update.
:::

:::CodeblockTabs
Request

```apex
//  Create a Map to store all the data of a Customer
Map<String, Object> customerMap = new Map<String, Object>(); 
    customerMap.put('DisplayName','Weiskopf Consulting');
	customerMap.put('Id','1201');
	customerMap.put('SyncToken','0');

//  Initializing the RequestJSON Data to be passed.
Map<String, Object> requestJSONMap = new Map<String, Object>();
    requestJSONMap.put('customers', new List<Object>{customerMap});
    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);
    //Required, if QuickBooks Multi-Org is enabled in Breadwinner. 
    reqObj.put('qbOrgId', '4620816365285051610');

//  Placing a request to Breadwinner Global API
Map<String, Object> respMap = breadwinner_qbo.BreadwinnerQBAPI.call(reqObj);
System.debug(respMap);
```

Response

```json
{
  action=updateCustomer,
  responseJSON={
    "statusCode": 200,
    "customers": [
      {
        "Taxable": false,
        "SyncToken": "1",
        "sparse": false,
        "SFRecordID": "a085j000002ChCIAA0",
        "PrintOnCheckName": "Weiskopf Consulting",
        "PreferredDeliveryMethod": "Print",
        "Metadata": {
          "LastUpdatedTime": "2021-10-31T23:44:02-07:00",
          "CreateTime": "2021-07-17T17:29:04-07:00"
        },
        "Job": false,
        "Id": "1201",
        "FullyQualifiedName": "Weiskopf Consulting",
        "DisplayName": "Weiskopf Consulting",
        "CurrencyRef": {
          "value": "USD",
          "name": "United States Dollar"
        },
        "BillWithParent": false,
        "BalanceWithJobs": "325.00",
        "Balance": "325.00",
        "Active": "true"
      }
    ]
  },
  timestamp=1635749043782,
  validRequest=true,
  version=1.0
}
```
:::

