Api Updating An Order Status


I'm using the api to extract order data, then I want to Update the order Status to something else eg. Status = Complete.

I only want to update the status, without affecting the rest of the order data. Is this possible?

My code is below, however weird things are happening to the order, missing products, extra products.

I'm new to the api and curl. Have I done something wrong in my code? is it even possible to do?

$query_string = "/orders/".$order['order_id'];

$order_data = json_encode(array('status' => 'C') );

$ch = curl_init();

curl_setopt($ch, CURLOPT_USERPWD, $email . ":" . $api_key);
curl_setopt($ch, CURLOPT_URL, $myUrl.$query_string);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS,$order_data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($order_data))

$update = curl_exec($ch);

our specialists can consult you on this and assist with script development so please don't hesitate to contact us


I worked it out, using a different way

what was the reason?

[quote name='iamlili' timestamp='1427664527' post='209458']


I worked it out, using a different way


Yes, please share your experience

I just got the idea from reading this post

[quote name='iamlili' timestamp='1427778409' post='209638']

I just got the idea from reading this post



Thank you

We use API to change the status on an order from “shipped” to “completed”, but I think it only changes the status ID on the order. I think this excludes some “functionality” that happens when we do a manual status change. For example, The customer return request form under “MY PAGE” only shows up when we manually “completes” the order. When API changes the status, that link is not visible.

We also have the same problem with regard to stock change. When we change stock manually from 0 → 10, it automatically sends out e-mail to subscribers that have “send me a notification when product is back in stock”. When we change stock from 0 → 10 via API that does not happen.

If anyone have some ideas around this topic, that would be very appreciated.