Can't set `buyer_accepts_marketing` field of a checkout

Tourist
20 0 0

I'm creating checkouts through the Sales Channel SDK via the REST Admin API. I successfully create the checkouts and I'm able to set all the necessary fields except for the `buyer_accepts_marketing` field. Even if I only specify that field in the update, it never updates that field. What could I be missing?

0 Likes
Tourist
20 0 0

No one?

0 Likes
Tourist
20 0 0

For a company that relies so heavily on 3rd party developers, the developer support is abysmal.

0 Likes
Community Manager
Community Manager
451 17 45

Hey @copleykj,

 

Can you share the call you're making to update the acceptsMarketing value on the customer object? If you can include the X-Request-ID header value, I can check our logs for your actual request and any associated errors.

 

Cheers,

0 Likes
Tourist
20 0 0

It's not on the customer, but rather on a checkout. The request is being made using shopify-api-node module. The code is as follows.

 

//client is an instantiated shopify client
client.checkout.update(checkoutToken, { buyer_accepts_marketing: true });

Maybe I just have a fundamental misunderstanding of how it supposed to work, and you're not supposed to set this field on a checkout and only a customer itself? The problem then I guess lies in the documentation since the buyer_accepts_marketing field definition at https://help.shopify.com/en/api/reference/sales-channels/checkout does not state that this is a read only field.

0 Likes
Highlighted
Community Manager
Community Manager
451 17 45

Hi again,

 

Apologies! I missed the fact that you were using the Admin API endpoints rather than the Storefront API. Have you completed a checkout after changing the buyer_accepts_marketing field? I tested it on my end, and see that the customer gets updated once the checkout is completed. This behaviour is in line with how the web checkout operates. 

 

 

0 Likes