Magento – Magento 2: Update order status using rest API

magento2ordersrest

Guys I want to update order status using API. I am using this api to change the order status but it's not working:

http://dev-jawed.com/index.php/rest/V1/orders

{
"status" : "Out-for-delivery",
"entity" : 1,
"items": {
        "order_id" : 1
  }
}

Any help will be appreciated.

Best Answer

If you look at the swagger api documents (either on your local machine at /swagger or at the devdocs). You should find the API V1/orders. If you are using your local version you will also have the button to try to calls direct from swagger which is nice for debugging. From looking through the documents you should be able to post something like the following to the api.

{
  "entity": {
    "entity_id": 0,
    "status": "string"
  }
}

Remember to replace the entity_id with the correct order id and the status with the status you would like to change to.