Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Customer 'sms_marketing_consent' field from REST API is missing in GraphQL

locomojo
Shopify Partner
8 0 2

This is question directed towards Shopify staff. I'm running into issues with some of the REST fields missing in GraphQL. 

 

The REST API for "Customers" has a "sms_marketing_consent" field, but it's missing in the GraphQL version. 

 

REST version ('sms_marketing_consent' is here): 

https://shopify.dev/api/admin-rest/2023-01/resources/customer 

 

'sms_marketing_consent' is missing in GraphQL:

https://shopify.dev/api/admin-graphql/2023-01/queries/customer

 

GraphQL only has 'acceptsMarketing' field is in GraphQL but it's not SMS marketing so doesn't help.GraphQL only has 'acceptsMarketing' field is in GraphQL but it's not SMS marketing so doesn't help.

 

Is there any chance we could get this added to GraphQL API? I'm simply trying to get a list of all customers that accept SMS marketing, and want to do it with GraphQL so I can do pagination and maybe even bulk queries since a lot of stores have more than 250 customers. I'm working with lists larger than 250 and don't want to build my own throttle using the REST API if I don't have to with GraphQL. Help?

 

REST version has 'sms_marketing_consent' which is missing in GraphQLREST version has 'sms_marketing_consent' which is missing in GraphQL 

 

 

 

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1244 201 440

Hi @locomojo 👋

 

In GraphQL, we can use the `Customer.smsMarketingConsent` field.

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog