function updateSalesOrderWithShippingCharges($sales_order_id,$customer_id,$sales_order_number ,$shipping_charges)
{
$json='{
"customer_id":'.$customer_id.',
"salesorder_number":'.$sales_order_number.',
"shipping_charge":'.$shipping_charges.',
"salesorder_id":'.sales_order_id.'
}';
echo $url;
$query="authtoken=xxx&organization_id=xxx&JSONString=".$json;
$ch = curl_init();
/* set url to send post request */
curl_setopt($ch, CURLOPT_URL, $url);
/* allow redirects */
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
/* return a response into a variable */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
/* times out after 30s */
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
/* set POST method */
curl_setopt($ch, CURLOPT_POST, 1);
/* add POST fields parameters */
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);// Set the request as a POST FIELD for curl.
//Execute cUrl session
$response = curl_exec($ch);
curl_close($ch);
echo $response;
}
updateSalesOrderWithShippingCharges('605322000000176079','605322000000142223','SO-00055',30);
I got the following errors;
{"code":37,"message":"The HTTP method POST is not allowed for the requested resource"}
Pleas help me where is the problem?