Customer creation fires create webhook and update webhook

Solved
Highlighted
Tourist
12 1 1

Hi,

 

When I create `CUSTOMERS_CREATE` and `CUSTOMERS_UPDATE` webhook subscriptions both of the webhooks fire when a new user creates an account on our Shopify store. Does anyone know if this is intended?

 

I am using the `@shopify/koa-shopify-webhooks` npm package to register the webhook subscriptions. This package should send the status code of `200` to the API as it appears in the sourcecode that it does this.

 

The `update` webhook gets sent a second or two after the `create` webhook.

 

Thank you,

0 Likes

Success.

Shopify Staff
Shopify Staff
299 32 59

Hey Asjas,

 

This is indeed expected behaviour. When a new customer account is created for a shop, it's done so in two steps. The first creates the account with the values provided during setup, the second enables the `state` property of the customer.

 

This is why you're first seeing a `customers/create` webhook and then a `customers/update` webhook right after. If you were to compare webhook payloads, you would see the only difference would be the value of the `state` property.

1 Like
Tourist
12 1 1

Thanks for the great explanation! It makes sense now.

0 Likes