Hi,
I would like to create a customer with tag using the Storefront API. It looks like it’s possible inside a theme but I couldn’t find the same info for headless.
Thank you.
Hi,
I would like to create a customer with tag using the Storefront API. It looks like it’s possible inside a theme but I couldn’t find the same info for headless.
Thank you.
Hi @aras - you’re correct here. At the moment, there’s not a specific way to automatically create a customer with a tag using the Storefront API.
You can create a customer using the customerCreate mutation: customerCreate - Storefront API, but after doing a bit of digging on my end here as well, even using the customerUpdate mutation in the Storefront API wouldn’t allow you to add a tag.
The simplest workaround I can think of would be to use Shopify Flow: https://help.shopify.com/en/manual/shopify-flow
You could set a trigger within a Flow that tracks when a customer is created and then automatically applies a specific tag to them. This would technically be using the Admin API, but would be fairly easy to set up.
The other option I’d look at which would give you more flexibility would be setting up a Webhook listening server that listens for the customers/create webhook: Webhooks
Then when a customer is created on the storefront, you could build an Admin API function that adds the tag as needed: customerUpdate - GraphQL Admin
The Admin Customer API does support adding tags using the customerUpdate mutation, so this would give you more ability to integrate into your code if you wanted to go that route too.
Hope this helps - let me know if I can clarify anything on my end here!