I want to trace records of all the completed orders which has been received from my Magento store to my ERP store through Rest API. I have created custom column through SQL query in sales_order so that I can get all those orders whose custom order value is set to 0 (default value).

I am using this API


to get all the records of matching custom column value which is working perfect. However I need an API through which I can update the custom column value to 1 once I receive that order.

Is there any API available through which I can able to update the custom column value by order id?

  • I came to know there is this API with PUT method index.php/rest/V1/orders/1 through which i can update the column data by passing entity[custom-attribute] = 0 but its throughing the unknown setter and getter error even after i have created the set and get method for this attribute in both controller and Model of OrderrepositoryInterface and orderInterface Commented Jan 23, 2017 at 16:13
  • Now its throwing this exception even after creating custom order attribute setter and getter method on orderinterface { "message": "Class 0 does not exist", "code": -1, "trace": "#0 /var/www/html/vangsgaards/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php(148): ReflectionClass->__construct('0') #1 /var/www/html/vangsgaards/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php(322): Magento\Framework\Webapi\ServiceInputProcessor->_createFromArray('0', Array) #2 /var/www/html/vangsgaards/lib/internal/Magento/Framework/Webapi/ServiceInputProcessor.php(175) Commented Jan 23, 2017 at 16:20

1 Answer 1


Never mind just found out the answer by myself. Magento2 Update Order attributes API index.php/rest/V1/orders/:orderid does not allow to update custom order attributes. So i have created my own custom API to cater my requirement

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.