Shopify GraphQL customerSmsMarketingConsentUpdate mutation not working

Topic summary

A developer is experiencing an issue with Shopify’s GraphQL customerSmsMarketingConsentUpdate mutation, though the examples provided show the customerEmailMarketingConsentUpdate mutation instead.

What’s Working:

  • The email marketing consent mutation executes successfully
  • Returns proper response with marketingState: UNSUBSCRIBED
  • No user errors are reported
  • Customer query by ID retrieves consent data correctly

The Problem:

  • Despite the title mentioning SMS consent updates, only email consent mutation code is shown
  • The post contains garbled/reversed text in several sections, making parts difficult to parse
  • No error messages or specific failure descriptions are provided

Status: The issue remains unresolved with no responses or solutions posted. It’s unclear whether the SMS mutation fails silently, returns errors, or if the wrong mutation was shared in the example.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.
mutation customerEmailMarketingConsentUpdate ($input: CustomerEmailMarketingConsentUpdateInput!) {
  customerEmailMarketingConsentUpdate(input: $input) {
    customer {
      id
      email
      emailMarketingConsent {
        marketingState
        consentUpdatedAt
        marketingOptInLevel
      }
    }
    userErrors {
      field
      message
    }
  }
}

{
"input": {
"customerId": "gid://shopify/Customer/**************",
"emailMarketingConsent": {
"marketingState": "UNSUBSCRIBED"
}
}
}
{
  "data": {
    "customerEmailMarketingConsentUpdate": {
      "customer": {
        "id": "gid://shopify/Customer/**************",
        "email": "**************@email.com",
        "emailMarketingConsent": {
          "marketingState": "UNSUBSCRIBED",
          "consentUpdatedAt": "2023-10-11T03:20:30Z",
          "marketingOptInLevel": "SINGLE_OPT_IN"
        }
      },
      "userErrors": []
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 11,
      "actualQueryCost": 11,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 989,
        "restoreRate": 50
      }
    }
  }
}

When query by customer id:

query ($id: ID!) {
  customer(id: $id) {
    id
    email
    emailMarketingConsent {
      consentUpdatedAt
      marketingState
      marketingOptInLevel
    }
  }
}

{
"id": "gid://shopify/Customer/**************"
}
{
  "data": {
    "customer": {
      "id": "gid://shopify/Customer/**************",
      "email": "**************@email.com",
      "emailMarketingConsent": {
        "consentUpdatedAt": "2023-10-11T03:20:33Z",
        "marketingState": "SUBSCRIBED",
        "marketingOptInLevel": "SINGLE_OPT_IN"
      }
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 2,
      "actualQueryCost": 2,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 998,
        "restoreRate": 50
      }
    }
  }
}