curl Update Order Error

martin_dev
New Member
2 0 0

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!

Replies 3 (3)
Jayvin
Shopify Partner
270 40 74

Hi,

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

martin_dev
New Member
2 0 0
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-inv...

L_J_K
Shopify Staff
363 54 65

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!

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!