Update customer
Updates a customer profile.
To change an attribute, specify the new value. To remove an attribute, specify the value as an empty string or empty object.
As a best practice, you should include the version
field in the request to enable optimistic concurrency control. The value must be set to the current version of the customer profile.
To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.
You cannot use this endpoint to change cards on file. To make changes, use the Cards API or Gift Cards API.
Name | Description |
---|---|
customer_
Required
|
The ID of the customer to update. |
Name | Description |
---|---|
given_
|
The given name (that is, the first name) associated with the customer profile. |
family_
|
The family name (that is, the last name) associated with the customer profile. |
company_
|
A business name associated with the customer profile. |
nickname
|
A nickname for the customer profile. |
email_
|
The email address associated with the customer profile. |
address
|
The physical address associated with the customer profile. To make any changes to an address, you must provide the complete |
phone_
|
The phone number associated with the customer profile. A phone number can contain 9–16 digits, with an optional |
reference_
|
An optional second ID used to associate the customer profile with an entity in another system. |
note
|
A custom note associated with the customer profile. |
birthday
|
The birthday associated with the customer profile, in RFC 3339 format. The year is optional. The timezone and time are not allowed.
For example, |
version
|
The current version of the customer profile. As a best practice, you should include this field to enable optimistic concurrency control. For more information, see Update a customer profile. |
tax_
|
The tax ID associated with the customer profile. This field is available only for customers of sellers in EU countries or the United Kingdom.
In other countries, this field is ignored when included in an |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
customer
|
The updated customer. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/customers/JDKYHBWT1D4F8MFH63DBMEN8Y4 \
-X PUT \
-H 'Square-Version: 2022-06-16' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"phone_number": "",
"email_address": "New.Amelia.Earhart@example.com",
"note": "updated customer note",
"version": 2
}'
{
"customer": {
"id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
"created_at": "2016-03-23T20:21:54.859Z",
"updated_at": "2016-05-15T20:21:55Z",
"given_name": "Amelia",
"family_name": "Earhart",
"email_address": "New.Amelia.Earhart@example.com",
"address": {
"address_line_1": "500 Electric Ave",
"address_line_2": "Suite 600",
"locality": "New York",
"administrative_district_level_1": "NY",
"postal_code": "10003",
"country": "US"
},
"reference_id": "YOUR_REFERENCE_ID",
"note": "updated customer note",
"preferences": {
"email_unsubscribed": false
},
"creation_source": "THIRD_PARTY",
"version": 3
}
}