accepts_marketing vs buyer_accepts_marketing

dcteam
New Member
1 0 0

I have a question regarding response data for customers and orders endpoints.

In customers response there are two columns: accepts_marketing and accepts_marketing_updated_at

In orders response there is one column: buyer_accepts_marketing (and apparently not a timestamp)

In the customer response, accepts_marketing may be False, although buyer_accepts_marketing is True in the orders response.

My question what is the difference between accepts_marketing in the customers response and the buyer_accepts_marketing in the orders response?

Reply 1 (1)
GrahamS
Shopify Staff
156 25 32

Hey @dcteam ,

Those two fields represent the same thing, however one represents a historical value and the other represents a real-time value. If you query the "customer" endpoint, you will receive the information about that customer as it is in our database right now. If you query an Order, you will receiver the information about the customer as it was at the time of order, which can be a completely different set of values than the current data, including their marketing status.

So to clarify, your customer currently does not accept marketing, however at the time of that specific order, they did, which is why that data is stored in the order.

Best,

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me 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