Curl Update Order Error

Hi all,

I’m trying to update an order’s note using cURL and I’m constantly getting an error, although I can’t see what’s wrong.

This is the call I do:

curl -X PUT https://KEY:SECRET@URL/admin/api/2021-07/orders/ORDERID.json -H ‘Content-Type: application/json’ -d {“order”:{“id”:ORDERID,“note”:“Test”}}

This is the message I get:

“errors” : {“order” : “Required parameter missing or invalid”}}

Does anybody know what could be the issue?

Thanks!

Hi,

Can you follow the cURL example mentioned here and see if it works.

Thanks for your answer. Yes, I also tried it and got same result. It’s basically the same one but in a different order. The one I put in my original post was inspired in this other article: https://community.shopify.com/c/shopify-apis-and-sdks/another-quot-required-parameter-missing-or-invalid-quot-thread/td-p/540553

Hey @martin_dev

Thanks for getting in touch. Taking a look at the Curl example from our docs here It looks like the example is missing the content header “Content-Type: application/json” - mine works ok when I add that to the given example.

So if I try something like this :

curl -d '{"order":{"id":1234567891011,"note":"Customer contacted us about a custom engraving on this iPod"}}' \
-H "Content-Type: application/json" \
-X PUT "https://coolteststore.myshopify.com/admin/api/2021-07/orders/1234567891011.json" \
-H "X-Shopify-Access-Token: putyouraccesstokenhere"

I’m able to PUT my note ok to my order via my Curl client. We’ll look into the docs. Hope that helps!