customerEmailMarketingConsentUpdate
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 customers’ email marketing messages
Arguments
Update input fields for customer email marketing information
Return
The updated customer.
error message
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Update email subscription information
Code
{
"input": {
"customerId": "gid://shopline/Customer/4600419096",
"emailMarketingConsent": {
"consentUpdatedAt": "2023-12-27T03:31:06.960Z",
"marketingState": "SUBSCRIBED"
}
}
}
Response
{
"data": {
"customerEmailMarketingConsentUpdate": {
"customer": {
"email": "******@example.com",
"phone": "0086185****1234",
"tags": [
"test1"
],
"taxExempt": true,
"verifiedEmail": false,
"firstName": "S*****",
"lastName": "T*****",
"addresses": [
{
"company": "C*****",
"country": "United States",
"countryCodeV2": "US",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"lastName": "T*****",
"phone": "0086****1234",
"province": "Kentucky",
"provinceCode": null,
"zip": "40202",
"address1": "Chestnut Street 92",
"address2": "Apartment 2",
"city": "Louisville"
}
],
"createdAt": "2024-01-11T06:06:22.500Z",
"emailMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:06:36.819Z",
"marketingState": "SUBSCRIBED"
},
"id": "gid://shopline/Customer/4600507018",
"note": "Placed an order that had a fraud warning",
"smsMarketingConsent": {
"consentUpdatedAt": "2024-01-13T08:03:52.337Z",
"marketingState": "SUBSCRIBED"
},
"taxExemptions": [
{
"countryCode": "US",
"provinceGCodeList": [
"AK"
]
}
],
"updatedAt": "2024-01-13T08:03:51.321Z",
"defaultAddress": {
"lastName": "T****",
"provinceCode": null,
"zip": "40202",
"address2": "Apartment 2",
"country": "United States",
"countryCodeV2": "US",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6288183152684310781",
"phone": "0086185****1234",
"province": "Kentucky",
"address1": "Chestnut Street 92",
"city": "Louisville",
"company": "C*****"
}
},
"userErrors": null
}
}
}
Was this article helpful to you?