cancel
Showing results for 
Search instead for 
Did you mean: 

Why increment_id changed when update order state /status using rest api ?

Why increment_id changed when update order state /status using rest api ?

I want to update order status/state usging webapi 

here is my testing code :

$data = [
'entity' => [ 
    'entity_id'=>37,
    'state'=>'processing',
    'status'=>'payment_finished',    
]
];
$ch = curl_init();

$post = json_encode($data);
$site_path = $localurl."/index.php/rest/V1/orders';
$authorization = "Authorization: Bearer $token";
curl_setopt($ch, CURLOPT_URL, $site_path);

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization ));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

$result = curl_exec($ch);

and when this code runs, the state and status updated correctly , but the increment_id changed from previous to '00000001' . 

Can anyone help me with this problem?