How to set Marketing Opt In via Admin GraphQL API

How to set Marketing Opt In via Admin GraphQL API

kyleshepherd
Visitor
1 0 1

Hi,

 

I'm working on a FE ecommerce app using the Shopify Admin + Storefront GraphQL API.

 

 We allow users to sign up to a newsletter and want to control the whole flow via our frontend app. We use the Admin API to set that customer to `acceptMarketing`, but I can't find a way to set them to be opted in via the API.

 

There is a `CustomerMarketingOptInLevel` field on the customer which can be updated, but this doesn't reflect the customer's actual opt in status shown on the Shopify Admin area.

 

Is there a way to do this currently, and if not please can it be considered? It's really frustrating to have to boot users to a Shopify site just to redirect them back to our frontend in scenarios like this.

Replies 0 (0)