Can't set `buyer_accepts_marketing` field of a checkout

Excursionist
21 0 1

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
Excursionist
21 0 1

No one?

0 Likes
Excursionist
21 0 1

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

0 Likes
Community Manager
Community Manager
618 45 81

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
Excursionist
21 0 1

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
618 45 81

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
Tourist
4 0 1

Hi @Busfox we we're wondering if you could update that "buyer_accepts_marketing" field through a Storefront API GraphQl mutation on the Checkout object, but we couldn't find any that let us update that field (also, we can't retreive the field on the Checkout object, it's not there). Do you think that field and a mutation for it could be possible? Thanks!

 

Albert

0 Likes