Development discussions around Shopify APIs
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!
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!
Thanks to all Community members that participated in our inaugural 2 week AMA on the new E...
By Jacqui Mar 10, 2023Upskill and stand out with the new Shopify Foundations Certification program
By SarahF_Shopify Mar 6, 2023One of the key components to running a successful online business is having clear and co...
By Ollie Mar 6, 2023