Magento 2.2.2 error when setting order status with APICall to a member function dispatch() on null MagentoFrameworkModelAbstractModel.php on line 562Data migration from non-magento DB about sales_order tablesMagento 2 Sending emails triggered by observerMagento2 (v2.2) Error Login Admin + FrontendUnable to create order from admin in magento 2Incompatible argument type error in Magento 2.2.2Magento 2.2.2 REST API - I need to change the customer password using REST APIAdd to cart button freezes and nothing is put in basketHow to set additional data to quote_item table from controller in Magento 2?Magento 2.2.3 CE unable to add/remove item from wishlist?

What if you don't bring your credit card or debit for incidentals?

Does it cost a spell slot to cast a spell from a Ring of Spell Storing?

Sucuri detects malware on wordpress but I can't find the malicious code

Is the capacitor drawn or wired wrongly?

Chopin: marche funèbre bar 15 impossible place

Show sparse matrices like chessboards

Unorthodox way of solving Einstein field equations

Incremental Ranges!

What happens if you do emergency landing on a US base in middle of the ocean?

Restoring order in a deck of playing cards (II)

Is having a hidden directory under /etc safe?

Credit card offering 0.5 miles for every cent rounded up. Too good to be true?

NTP rollover-safe design with ESP8266 (Curiosity)

Short story written from alien perspective with this line: "It's too bright to look at, so they don't"

Responsibility for visa checking

Initialize an array of doubles at compile time

How to detach yourself from a character you're going to kill?

Do marked cards or loaded dice have any mechanical benefit?

How to decline physical affection from a child whose parents are pressuring them?

Strange math syntax in old basic listing

Rotated Position of Integers

Hygienic footwear for prehensile feet?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Is the decompression of compressed and encrypted data without decryption also theoretically impossible?



Magento 2.2.2 error when setting order status with API


Call to a member function dispatch() on null MagentoFrameworkModelAbstractModel.php on line 562Data migration from non-magento DB about sales_order tablesMagento 2 Sending emails triggered by observerMagento2 (v2.2) Error Login Admin + FrontendUnable to create order from admin in magento 2Incompatible argument type error in Magento 2.2.2Magento 2.2.2 REST API - I need to change the customer password using REST APIAdd to cart button freezes and nothing is put in basketHow to set additional data to quote_item table from controller in Magento 2?Magento 2.2.3 CE unable to add/remove item from wishlist?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data?



This is the url I am calling




https://localhost/rest/V1/orders




This is the data I am sending




"entity": "entity_id": 10000001, "status": "Complete"




This is the error I am getting




"Fatal Error: 'Uncaught Error: Call to a member function
getMethodInstance() on null in
/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24



Stack trace:



0 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): MagentoPaymentObserverSalesOrderBeforeSaveObserver->execute(Object(MagentoFrameworkEventObserver))



1 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(MagentoPaymentObserverSalesOrderBeforeSaveObserver),



Object(MagentoFrameworkEventObserver))



2 /vendor/magento/module-staging/Model/Event/Manager.php(97): MagentoFrameworkEventInvokerInvokerDefault->dispatch(Array,



Object(MagentoFrameworkEventObserver))



3 /generated/code/Magento/Stag' in '/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php'



on line 24"











share|improve this question






















  • Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

    – Ramkishan Suthar
    May 26 at 11:19


















1















I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data?



This is the url I am calling




https://localhost/rest/V1/orders




This is the data I am sending




"entity": "entity_id": 10000001, "status": "Complete"




This is the error I am getting




"Fatal Error: 'Uncaught Error: Call to a member function
getMethodInstance() on null in
/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24



Stack trace:



0 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): MagentoPaymentObserverSalesOrderBeforeSaveObserver->execute(Object(MagentoFrameworkEventObserver))



1 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(MagentoPaymentObserverSalesOrderBeforeSaveObserver),



Object(MagentoFrameworkEventObserver))



2 /vendor/magento/module-staging/Model/Event/Manager.php(97): MagentoFrameworkEventInvokerInvokerDefault->dispatch(Array,



Object(MagentoFrameworkEventObserver))



3 /generated/code/Magento/Stag' in '/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php'



on line 24"











share|improve this question






















  • Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

    – Ramkishan Suthar
    May 26 at 11:19














1












1








1








I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data?



This is the url I am calling




https://localhost/rest/V1/orders




This is the data I am sending




"entity": "entity_id": 10000001, "status": "Complete"




This is the error I am getting




"Fatal Error: 'Uncaught Error: Call to a member function
getMethodInstance() on null in
/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24



Stack trace:



0 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): MagentoPaymentObserverSalesOrderBeforeSaveObserver->execute(Object(MagentoFrameworkEventObserver))



1 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(MagentoPaymentObserverSalesOrderBeforeSaveObserver),



Object(MagentoFrameworkEventObserver))



2 /vendor/magento/module-staging/Model/Event/Manager.php(97): MagentoFrameworkEventInvokerInvokerDefault->dispatch(Array,



Object(MagentoFrameworkEventObserver))



3 /generated/code/Magento/Stag' in '/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php'



on line 24"











share|improve this question














I am trying to set the order status of orders to "Complete" using the API. I am running Magento Enterprise 2.2.2. Am I missing something in the data?



This is the url I am calling




https://localhost/rest/V1/orders




This is the data I am sending




"entity": "entity_id": 10000001, "status": "Complete"




This is the error I am getting




"Fatal Error: 'Uncaught Error: Call to a member function
getMethodInstance() on null in
/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php:24



Stack trace:



0 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(72): MagentoPaymentObserverSalesOrderBeforeSaveObserver->execute(Object(MagentoFrameworkEventObserver))



1 /vendor/magento/framework/Event/Invoker/InvokerDefault.php(60): MagentoFrameworkEventInvokerInvokerDefault->_callObserverMethod(Object(MagentoPaymentObserverSalesOrderBeforeSaveObserver),



Object(MagentoFrameworkEventObserver))



2 /vendor/magento/module-staging/Model/Event/Manager.php(97): MagentoFrameworkEventInvokerInvokerDefault->dispatch(Array,



Object(MagentoFrameworkEventObserver))



3 /generated/code/Magento/Stag' in '/vendor/magento/module-payment/Observer/SalesOrderBeforeSaveObserver.php'



on line 24"








magento2 rest-api order-status






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 25 at 15:46









Trevor OrrTrevor Orr

1527




1527












  • Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

    – Ramkishan Suthar
    May 26 at 11:19


















  • Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

    – Ramkishan Suthar
    May 26 at 11:19

















Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

– Ramkishan Suthar
May 26 at 11:19






Hi There, Is this increment id or order id (primary key of sales_order table) because if this is increment id then you need to replace it with order id, I am sure this is the issue in your case.

– Ramkishan Suthar
May 26 at 11:19











1 Answer
1






active

oldest

votes


















1














You are sending order increment id as order id (primary key of sales order table). Thats why this error pops up. You need to send actual order id.



Let me know if this doesn't fix your issue.






share|improve this answer























  • That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

    – Trevor Orr
    May 26 at 16:36











  • If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

    – Trevor Orr
    May 26 at 18:13











  • Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

    – Ramkishan Suthar
    May 27 at 4:46












  • Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

    – Trevor Orr
    May 27 at 5:04











  • Great @TrevorOrr, Happy coding :)

    – Ramkishan Suthar
    May 27 at 5:05











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f276108%2fmagento-2-2-2-error-when-setting-order-status-with-api%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You are sending order increment id as order id (primary key of sales order table). Thats why this error pops up. You need to send actual order id.



Let me know if this doesn't fix your issue.






share|improve this answer























  • That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

    – Trevor Orr
    May 26 at 16:36











  • If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

    – Trevor Orr
    May 26 at 18:13











  • Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

    – Ramkishan Suthar
    May 27 at 4:46












  • Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

    – Trevor Orr
    May 27 at 5:04











  • Great @TrevorOrr, Happy coding :)

    – Ramkishan Suthar
    May 27 at 5:05















1














You are sending order increment id as order id (primary key of sales order table). Thats why this error pops up. You need to send actual order id.



Let me know if this doesn't fix your issue.






share|improve this answer























  • That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

    – Trevor Orr
    May 26 at 16:36











  • If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

    – Trevor Orr
    May 26 at 18:13











  • Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

    – Ramkishan Suthar
    May 27 at 4:46












  • Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

    – Trevor Orr
    May 27 at 5:04











  • Great @TrevorOrr, Happy coding :)

    – Ramkishan Suthar
    May 27 at 5:05













1












1








1







You are sending order increment id as order id (primary key of sales order table). Thats why this error pops up. You need to send actual order id.



Let me know if this doesn't fix your issue.






share|improve this answer













You are sending order increment id as order id (primary key of sales order table). Thats why this error pops up. You need to send actual order id.



Let me know if this doesn't fix your issue.







share|improve this answer












share|improve this answer



share|improve this answer










answered May 26 at 11:25









Ramkishan SutharRamkishan Suthar

2,34421435




2,34421435












  • That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

    – Trevor Orr
    May 26 at 16:36











  • If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

    – Trevor Orr
    May 26 at 18:13











  • Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

    – Ramkishan Suthar
    May 27 at 4:46












  • Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

    – Trevor Orr
    May 27 at 5:04











  • Great @TrevorOrr, Happy coding :)

    – Ramkishan Suthar
    May 27 at 5:05

















  • That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

    – Trevor Orr
    May 26 at 16:36











  • If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

    – Trevor Orr
    May 26 at 18:13











  • Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

    – Ramkishan Suthar
    May 27 at 4:46












  • Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

    – Trevor Orr
    May 27 at 5:04











  • Great @TrevorOrr, Happy coding :)

    – Ramkishan Suthar
    May 27 at 5:05
















That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

– Trevor Orr
May 26 at 16:36





That gets rid of the error but still does not change the status of the order but your comment is correct in fixing the error.

– Trevor Orr
May 26 at 16:36













If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

– Trevor Orr
May 26 at 18:13





If I just have the increment id would I need to do a get to retrieve the order details and then use the order id from that returned data to then do a post to set the order status? Which I found out that I had to use lowercase "complete" for the status to set correctly.

– Trevor Orr
May 26 at 18:13













Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

– Ramkishan Suthar
May 27 at 4:46






Yes exactly @TrevorOrr, I think you need to create new API for this as I think there is no default API which returns order data from increment id.

– Ramkishan Suthar
May 27 at 4:46














Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

– Trevor Orr
May 27 at 5:04





Actually I did find a way to get the order id from the increment id from another post here. Multiple steps to set the status but at least it works

– Trevor Orr
May 27 at 5:04













Great @TrevorOrr, Happy coding :)

– Ramkishan Suthar
May 27 at 5:05





Great @TrevorOrr, Happy coding :)

– Ramkishan Suthar
May 27 at 5:05

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f276108%2fmagento-2-2-2-error-when-setting-order-status-with-api%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?