Issue while updating tags for specific order

Hi, I am trying to update tags for a specific order, this is the curl I am using to do so:


curl --location --request PUT 'https://<my_domain>/admin/api/2021-07/orders/123456789.json' \
--header 'X-Shopify-Access-Token: <my_token>' \
--header 'Content-Type: application/json' \
--header 'Cookie: request_method=PUT' \
--data-raw '{
"order": {
"id": 123456789,
"tags": "my-custom-tag"
}
}'

I am getting this error in response:

{"errors":{"order":"Required parameter missing or invalid"}}%

Followed this docs: https://shopify.dev/docs/api/admin-rest/2023-10/resources/order#put-orders-order-id

But exact same thing works on postman. Any tips or solution for what is happening wrong?

Hello @manishchat360 ,

Please try the script below to update the tags.

curl --location --request PUT 'https://

Hi @Huptech-Web I tried by removing the id but still the error is there, the tags doesn’t get updated, and i get the same {"errors":{"order":"Required parameter missing or invalid"}} as response

Hello @manishchat360 ,

Can you please try the below code to update the order tags:

order_id="123456789"
new_tag="my-custom-tag"

shopify_store="your-shopify-store"
api_key="your-api-key"
password="your-password"

# Shopify API endpoint URL
api_url="https://${shopify_store}.myshopify.com/admin/api/2021-07/orders/${order_id}.json"

# cURL command to update the order tags
curl -X PUT $api_url \
     -u "${api_key}:${password}" \
     -H "Content-Type: application/json" \
     -d "{\"order\": {\"id\": ${order_id}, \"tags\": \"${new_tag}\"}}"