customerUpdate
mutation
Requires write_customers access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Update customer information by ID
Arguments
Provide customers with updated fields
Return
The updated customer.
Error message
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Update a customer
Code
{
"input": {
"id": "gid://shopline/Customer/******018",
"addresses": [
{
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"city": "Louisville",
"company": "C*****",
"country": "United States",
"countryCode": "US",
"firstName": "S*****",
"lastName": "T*****",
"phone": "0086134****8765",
"province": "Kentucky",
"provinceCode": "4200021",
"zip": "40202",
"district":"district",
"town":"Street"
}
],
"email": "*****@example.com",
"emailMarketingConsent": {
"consentUpdatedAt": null,
"marketingState": "SUBSCRIBED"
},
"firstName": "S*****",
"lastName": "T*****",
"note": "Placed an order that had a fraud warning",
"phone": "0086138****1234",
"smsMarketingConsent": {
"consentUpdatedAt": null,
"marketingState": "SUBSCRIBED"
},
"tags": [
"test1"
],
"taxExempt":true,
"taxExemptions": [
{
"countryCode":"US",
"provinceGCodeList":["AK"]
}
]
}
}
Response
{
"data": {
"customerUpdate": {
"customer": {
"createdAt": "2024-01-11T06:06:22.500Z",
"defaultAddress": {
"province": "Kentucky",
"provinceCode": null,
"city": "Louisville",
"company": "C*****",
"country": "United States",
"lastName": "T*****",
"zip": "40202",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"countryCodeV2": "US",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"phone": "0086138****1234"
},
"emailMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:03:52.257Z",
"marketingState": "SUBSCRIBED"
},
"phone": "008138****1234",
"smsMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:03:52.337Z",
"marketingState": "SUBSCRIBED"
},
"addresses": [
{
"company": "C*****",
"country": "United States",
"countryCodeV2": "US",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"province": "Kentucky",
"zip": "40202",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"lastName": "T*****",
"phone": "0086138****1234",
"provinceCode": null,
"city": "Louisville"
}
],
"email": "*****@example.com",
"lastName": "T*****",
"taxExemptions": [
{
"countryCode": "US",
"provinceGCodeList": [
"AK"
]
}
],
"firstName": "S*****",
"note": "Placed an order that had a fraud warning",
"tags": [
"test1"
],
"id": "gid://shopline/Customer/******018",
"taxExempt": true,
"updatedAt": "2024-01-13T08:03:51.321Z",
"verifiedEmail": false
},
"userErrors": null
}
}
}
Was this article helpful to you?