Anchor to customerEmailMarketingConsentUpdatecustomer
customerEmailMarketingConsentUpdate
mutation
Requires access scope.
Update a customer's email marketing information information.
Anchor to Arguments
Arguments
- Anchor to inputinput•
Specifies the input fields to update a customer's email marketing consent information.
Was this section helpful?
Anchor to CustomerEmailMarketingConsentUpdatePayload returnsCustomerEmailMarketingConsentUpdatePayload returns
- Anchor to customercustomer•
The updated customer.
- Anchor to userErrorsuser•
Errors The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {
customerEmailMarketingConsentUpdate(input: $input) {
customer {
# Customer fields
}
userErrors {
field
message
}
}
}
Input
{
"input": {
"customerId": "gid://shopify/<objectName>/10079785100",
"emailMarketingConsent": {
"consentUpdatedAt": "2019-09-07T15:50:00Z",
"marketingOptInLevel": "",
"marketingState": ""
}
}
}
{
"input": {
"customerId": "gid://shopify/<objectName>/10079785100",
"emailMarketingConsent": {
"consentUpdatedAt": "2019-09-07T15:50:00Z",
"marketingOptInLevel": "",
"marketingState": ""
}
}
}
input CustomerEmailMarketingConsentUpdateInput {
customerId: ID!
emailMarketingConsent: CustomerEmailMarketingConsentInput!
}
input CustomerEmailMarketingConsentInput {
consentUpdatedAt: DateTime
marketingOptInLevel: CustomerMarketingOptInLevel
marketingState: CustomerEmailMarketingState!
}