in Education by
I want to update order status to complete using webapi here is my testing code : $data = array ( 'entity' => array ( 'entity_id' => $id, 'status' => 'complete', ), ); $this->generateApiToken(); $ch = curl_init("https://$this->link/rest/V1/orders/"); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( "Content-Type: application/json", "Authorization: Bearer " . json_decode($this->token) )); $cusJsonData = curl_exec($ch); and when this code runs, the status updated correctly , but the increment_id changed. Can anyone help me with this problem? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I've just had this on v2.2.5, and put it down to a bug in Magento's API. To get round this, you need to specify the original increment_id along with the entity_id when doing status updates. Your JSON should look similar to this: { "entity": { "entity_id":23, "increment_id":"0000000153", "state":"processing", "status":"processing" } } Also, not sure why state and status is required, I just chalk this up to Magento's awful API.

Related questions

0 votes
    I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I'm using the cacheCounter in CakePHP, which increments a counter for related fields. Example, I have a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    I am struggling to figure out how to specify a MOTO payment with Stripe API and PHP. I believe I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    I've following two path path1- test/hello/hello.php path2- test/hello1/hello1.php //notice the one ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I've following two path path1- test/hello/hello.php path2- test/hello1/hello1.php //notice the one ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked Jun 2, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 30, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I want to load Google fonts in the head-section of my page using a php-function. My -area looks like this: ... ... Now ... I do this, there will be a "1" displayed (because of the...
asked May 17, 2022 in Education by JackTerrance
0 votes
    What's the standard way of updating a QTableView when its database (MySQL) was changed (outside of the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    Can anyone tell me why the REST API is popular? Select the correct answer from above options...
asked Jan 18, 2022 in Education by JackTerrance
0 votes
    What HTTP Status Code 409 states in REST?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    I've try to do the following instruction of this document : LINK I used SAS authentication and added this ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 22, 2022 in Education by JackTerrance
0 votes
    I am very new to creating and consuming REST web services in C#. I have programmed the data I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 20, 2022 in Education by JackTerrance
0 votes
    I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 2, 2022 in Education by JackTerrance
...