---
title: Update Customer
slug: payments/pkg6-update-customer
description: Learn how to effortlessly update customer information using the "UpdateCustomer" action in this detailed document. We discuss the process of storing the required data in a map object and transmitting it as JSON in the request. Discover the extensive range
docTags: 
createdAt: 2023-11-07T11:36:51.905Z
---

The following is an example of updating the Customer where we change some fields. (See [Customer](docId\:DM98bI1-BrwesrPxuduVe) for all available fields). The Processor Customer ID (*processorCustomerId*) 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, which you can see in our example.

:::CodeblockTabs
```apex
//  Create a Map to store all the data of a Customer
Map<String, Object> customerMap = new Map<String, Object>();
    customerMap.put('processorCustomerId', 'processorCustomerId');
    customerMap.put('customerName', 'Johnny Doe');
    customerMap.put('email', 'test@bwp.com');
    customerMap.put('customerPhone', '616-928-5099');

//  Create Stripe Address data
    customerMap.put('line1', '124 Main Street');
    customerMap.put('line2', 'Apt 3');
    customerMap.put('city', 'Anytown');
    customerMap.put('state', 'NY');
    customerMap.put('postal_code', '12346');

//  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('processorId', 'processorId');
    reqObj.put('requestJSON', reqJSON);

//  Placing a request to Breadwinner Global API
Map<String, Object> resp = bw_payments.BreadwinnerPaymentsAPI.call(reqObj);
System.debug(resp);
```

```json
{
	action=UpdateCustomer,
	timestamp=1599492195202, 
	validRequest=true,
	version=1.0, 
  statusCode=200,
	responseJSON={
    "customers": [
      {
        "taxType": "vat",
        "taxId": "",
        "taxExempt": "none",
        "shippingStreetAddress2": null,
        "shippingStreetAddress1": null,
        "shippingState": null,
        "shippingPostalCode": null,
        "shippingPhone": null,
        "shippingCountry": null,
        "shippingCity": null,
        "shippingAddressee": null,
        "salesforceName": "Johnny Depp",
        "salesforceId": "salesforceId",
        "salesforceContact": null,
        "salesforceAccount": null,
        "referenceId": null,
        "processorType": "processorType",
        "processorOrgName": "processorOrgName",
        "processorOrgId": "processorId",
        "processorCustomerId": "processorCustomerId",
        "noAssociatedSFContact": false,
        "noAssociatedSFAccount": false,
        "liveMode": false,
        "lastName": null,
        "language": null,
        "invoicePrefix": "1F55E486",
        "hasSuccessfulPayments": false,
        "firstName": null,
        "errorMessage": null,
        "email": "test@bwp.com",
        "description": null,
        "delinquent": false,
        "defaultSource": "",
        "customerPhone": "616-928-5099",
        "customerName": "Johnny Doe",
        "customerId": "processorCustomerId-processorType-processorId",
        "customerAccountBalance": 0.00,
        "custCurrency": null,
        "createdVia": "Breadwinner API",
        "createdDateInProcessor": "2022-06-02T07:52:21.000Z",
        "company": null,
        "billingStreetAddress2": "Apt 3",
        "billingStreetAddress1": "124 Main Street",
        "billingState": "NY",
        "billingPostalCode": "12346",
        "billingCountry": "US",
        "billingCity": "Anytown"
      }
    ]
  }
}
```
:::

