Admin API - Order not updated with 200 PUT request

Highlighted
New Member
2 0 0

I'm trying to update some order info after an order is created. I'm able to successfully authenticate with the API, but a PUT request doesn't update the fields like I'd expect. For example, trying to update the note field, the response is a 200 status code, but the response body does not contain the updated information: 

PUT /admin/api/2020-04/orders/2146398797903.json

body

{
    "order": {
        "id": 2146398797903,
        "note": "foo"
    }
}

 

response

{
    "order": {
        "id": 2146398797903,
        "closed_at": null,
        "created_at": "2020-03-31T11:59:55-05:00",
        "updated_at": "2020-04-03T12:58:29-05:00",
        "note": null,
        //...
    }
}

 

I'm testing the API using Postman. Trying to authenticate using the "Authorization: Basic [base64 encoded username:password]" was unsuccessful. I have authenticated using the "X-Shopify-Access-Token" header, as explained here.

I suspect I'm missing a critical piece to be able to successfully update orders - any advice or resources to check out?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
582 70 127

Hey @surefootme,

It's strange that you're getting a 200 response if the order isn't actually being updated. Can you try sending the request with the auth credentials in the URL? Like https://{{api_key}}:{{api_secret}}@shop.myshopify.com/admin/api...

Also please provide the X-Request-ID value from the response headers of your call, and I'll check our logs for more information.

JB | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
Shopify Partner
520 38 109

Using Postman, are you adding Content-Type: application/json as a header? And the body is defined as raw: JSON?

0 Likes
Highlighted
New Member
2 0 0

Thanks for the reply, I figured it out! I was using the full domain of the site to hit the API endpoint, rather than shop.myshopify.com as the domain. Things are working as expected now!

0 Likes
Highlighted
New Member
1 0 0

you need a print provider api

0 Likes