Anchor to section titled 'undefined'

customerEmailMarketingConsentUpdate
mutation

Requires write_customers access scope. Also: User needs customers permission.

Update a customer's email marketing information information.


Specifies the input fields to update a customer's email marketing consent information.


Was this section helpful?

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation customerEmailMarketingConsentUpdate($input: CustomerEmailMarketingConsentUpdateInput!) {
  customerEmailMarketingConsentUpdate(input: $input) {
    customer {
      # Customer fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "input": {
    "customerId": "gid://shopify/<objectName>/10079785100",
    "emailMarketingConsent": {
      "consentUpdatedAt": "2019-09-07T15:50:00Z",
      "marketingOptInLevel": "CONFIRMED_OPT_IN",
      "marketingState": "INVALID"
    }
  }
}
input CustomerEmailMarketingConsentUpdateInput {
  customerId: ID!
  emailMarketingConsent: CustomerEmailMarketingConsentInput!
}

input CustomerEmailMarketingConsentInput {
  consentUpdatedAt: DateTime
  marketingOptInLevel: CustomerMarketingOptInLevel
  marketingState: CustomerEmailMarketingState!
}