App reviews, troubleshooting, and recommendations
Hi, I am using shopify order rest api put request to update order tag but when I run the PUT request it removes the previous order tags. I want to keep the old tags and add the new tags in order.
Same happen with order notes.
Is there any solution ?
Link: https://shopify.dev/api/admin/rest/reference/orders/order#update-2021-07
Update an order's tags
PUT /admin/api/2021-07/orders/450789469.json
{
"order": {
"id": 450789469,
"tags": "External, Inbound, Outbound"
}
}
Dear hexonsoft,
with the REST API, I think it is not possible to keep the old tags while performing a PUT request. However I noticed, that it is possible by using the GraphQL API. There is a mutation to add tags: https://shopify.dev/api/admin-graphql/2021-10/mutations/tagsAdd and it kept the previous tags, when I execute it.
For example:
mutation tagsAdd {
tagsAdd(id: "gid://shopify/Order/<your_order_id>", tags: "Test") {
node {
id
}
userErrors {
field
message
}
}
}
Greetings, Tom
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023