How do I correctly add a tag when updating an order?

hi - i am updating(PUT) an order and adding a tag

tags: "ONLINE-EU",

however this fails unless it reads

tags: "ONLINEEU",

Does anyone have thoughts on how to do this correctly?

const updateShippingAddress = {
method: "PUT",
body: JSON.stringify({
    order: {
    id: order,
    shipping_address: {
        name: gb_name,                      
    },
    tags: "ONLINE-EU",                   
    }
})
};

api.request(
    `${api.endpoints.SHOPIFY_ORDER(order)}`,
    updateShippingAddress
)

What is the exact error you are seeing?

{"errors":{"order_tags":["is invalid"]}}

Looks like a bug to me, as there are no documented constraints on using dashes in tag names.

Log the actual request being made to verify it’s not being mangled by bad url encoding

Has there been any update to this? I am receiving the same problem over 3 years later.

Our business tag policy is hyphenated words.

My X-Request-Id : 6548bf5a-e0ea-49e4-b6a6-bf3447e41bee

Did you ever manage to resolve this?

I think you’ll find there’s an issue with mixed capitalisation.

The API allows you to set a tag with a capital, for example: Success.

If you attempt to update that same record with a tag in lower case (success) you will get the 422 error. My assumption here is that Shopify maintains a list of known tags and you cannot have two different tags of different capitalisation…i.e. this is a collation sequence issue.

The UI prevents this as you cannot create two tags with differing capitalisation.