Jump to content



Member Since 05 Mar 2015
Offline Last Active Mar 06 2015 04:31 AM

Posts I've Made

In Topic: How To Use Api

05 March 2015 - 06:45 AM


any one Could help me ,.

How can i update the Order details withe the help of 'PUT' Method,
This is my HTTP Request Code ;
string uri = "http://http://localh...api/orders/99";
WebRequest request = WebRequest.Create(uri);
request.Method = "PUT";
string Email = "gatewaycscart@gmail.com";
string ApiKey = "49W25R28wI813W3A38Z6v4IuE958InI4";
string credentials = Email + ":" + ApiKey;
request.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(credentials));
//request.ContentType = "application/json";
string data = "{'status':'P','shipping_cost':'1000'}";
var Object = JsonConvert.SerializeObject(data);

byte[] bytes = Encoding.UTF8.GetBytes(Object);
Stream reqstr = request.GetRequestStream();
reqstr.Write(bytes, 0, bytes.Length);

WebResponse response = request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string serverResponse = reader.ReadToEnd();

finally i am getting response with passing order id like ({'order_id':'99'}).

but in my admin store the details are not updating and the Order moving to incomplete mode how can i resole this issue can any one suggest me ?

And i followed the Documentation from this url also :http://docs.cs-cart.com/4.2.x/api/index.html

any one can help me

I am looking for your prompt actions