Solved

Can a new tag be appended to existing customer tags via API

JoeL68
Shopify Partner
12 1 2

Hello,

 

I am grabbing orders from a Shopify store via the API. In the order payload is a customer record. If the customer does not exist in our D365 ERP system I will insert the new customer record. D365 returns the new customer ID which I need to get into the Shopify store customer record via the API. 

 

Adding/updating a meta field to the Shopify customer record will not work because they are not included on the customer record when it is retrieved via the API. Tags are included in the customer record. I would like to APPEND a tag (externalID=123456 for example) to the customer tags via the API. Do you know if a tag can be APPENDED? So far my findings are you can only over write tags, not append.

 

Any ideas are apprecia

Accepted Solution (1)

Jason
Shopify Expert
11196 226 2287

This is an accepted solution.

Can a new tag be appended to existing customer tags via API

No.

 

If there's a chance the customer tags have changed outside of your integration then you'd need to pull the customer record first, grab the current tags, and the push your revised set back in.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★

View solution in original post

Replies 3 (3)

Jason
Shopify Expert
11196 226 2287

This is an accepted solution.

Can a new tag be appended to existing customer tags via API

No.

 

If there's a chance the customer tags have changed outside of your integration then you'd need to pull the customer record first, grab the current tags, and the push your revised set back in.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
JoeL68
Shopify Partner
12 1 2

Makes sense. Thanks Jason.

SteveDeveloper
Shopify Partner
1 0 0

What about this? We use on product tags and it can be used also for customer tags. GraphQL mutation 'tagsAdd'.

 

https://shopify.dev/docs/api/admin-graphql/unstable/mutations/tagsadd#examples-Add_tags_to_a_custome...