Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Api Updating An Order Status Rate Topic   - - - - -

 
  • iamlili
  • Member
  • Members
  • Join Date: 19-Jul 12
  • 34 posts

Posted 25 March 2015 - 04:52 AM #1

Hi,
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);



 

Posted 25 March 2015 - 02:20 PM #2

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

 
  • iamlili
  • Member
  • Members
  • Join Date: 19-Jul 12
  • 34 posts

Posted 29 March 2015 - 09:28 PM #3

Thanks,
I worked it out, using a different way

 

Posted 30 March 2015 - 07:32 AM #4

what was the reason?

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22832 posts

Posted 30 March 2015 - 09:12 AM #5

Thanks,
I worked it out, using a different way


Yes, please share your experience

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • iamlili
  • Member
  • Members
  • Join Date: 19-Jul 12
  • 34 posts

Posted 31 March 2015 - 05:06 AM #6

I just got the idea from reading this post
http://forum.cs-cart...min-here-it-is/

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22832 posts

Posted 31 March 2015 - 10:43 AM #7

I just got the idea from reading this post
http://forum.cs-cart...min-here-it-is/


Thank you

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 1210     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 4025     CS-Cart + YOUPI      USD 1459      Multi-Vendor Ultimate       USD 7500 (6000)


 
  • Joachim
  • Advanced Member
  • Members
  • Join Date: 05-Oct 11
  • 69 posts

Posted 20 May 2015 - 07:33 AM #8

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.
<p>4.4.2 Ultimate (6 storefronts)