Solved

Shopify customer webhook on customer pre checkout

tzookbc
Shopify Partner
2 0 1

When a customer starts the checkout process he has to fill his email address, shipping address and then click "continue".

Plus he has a checkbox to "subscribe to updates and deals"

 

now after this step, Shopify will send a webhook for new customer created.

Just to note the problem is in case the user doesn't complete the checkout.

 

Now the problem:

- the user checked the "accepts marketing" checkbox

- the user submits to the next step

- user doesn't complete the full checkout

- Shopify send a customer webhook with the email and address

- BUT

- the user object on the webhook has "accepts_marketing" as FALSE even though the customer checked it as he accepts marketing.

 

Is there a reason for that? or its a bug on Shopify?

 

Thanks!

Accepted Solution (1)

Kevin_A
Shopify Staff
318 42 61

This is an accepted solution.

Hey @tzookbc 

I believe this is to be expected. When they begin the order, the customer creation is completed and the webhook is fired off with accepts_marketing false. If the customer completes the order, this will be updated to a truthy state, otherwise it will stay as false. 

Kevin_A | Solutions Engineer @ 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

View solution in original post

Reply 1 (1)

Kevin_A
Shopify Staff
318 42 61

This is an accepted solution.

Hey @tzookbc 

I believe this is to be expected. When they begin the order, the customer creation is completed and the webhook is fired off with accepts_marketing false. If the customer completes the order, this will be updated to a truthy state, otherwise it will stay as false. 

Kevin_A | Solutions Engineer @ 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