Track order2018-05-15T11:32:46+00:00

$curlurl = ‘http://test.delhivery.com/api/cmu/create.json’;
$credentials = “xxxx-xxxxxxxx-xxxxxxx”; //my token code
$method = ‘POST’;
$body = ‘ { \

“seller_tin”: “sellertin”, \
“sales_tax_form_ack_no”: “ackno.”, \
“tax_value”: “taxvalue”, \
“shipment_width”: “shipmentwidth”, \
“pin”: 325007, \
“quantity”: “quantity”, \
“waybill”: “waybillno.(trackingid)”, \
“consignee_tin”: “consigneetin”, \
“weight”: “weight(gms)”, \
“phone”: 1234567890, \
“payment_mode”: “Prepaid/COD/Pickup/REPL”, \
“order_date”: “2017-05-20 12:00:00”, \
“total_amount”: 21840, \
“return_add”: “returnaddress”, \
“city”: “Kota”, \
“commodity_value”: “commodityvalue”, \
“return_name”: “name”, \
“seller_cst”: “sellercst”, \
“name”: “nameofconsignee”, \
“seller_name”: “sellername”, \
“return_city”: “returncity”, \
“return_state”: “returnstate”, \
“products_desc”: “productdescription”, \
“seller_add”: “selleradd”, \
“return_pin”: “returnpin”, \
“state”: “Rajasthan”, \
“return_phone”: “returnphone”, \
“seller_inv”: “sellerinv”, \
“extra_parameters”: { \
“return_reason”: “string” \
}, \
“add”: “M25,NelsonMarg”, \
“client”: “clientnameasregistered”, \
“country”: “India”, \
“category_of_goods”: “categoryofgoods”, \
“cod_amount”: 2125, \
“order”: “orderid”, \
“return_country”: “returncountry” \
} \
], \
“pickup_location”: [ \
{ \
“city”: “city”, \
“name”: “UseClientWarehousename”, \
“pin”: “pin-code”, \
“country”: “country”, \
“phone”: “phoneno.”, \
“add”: “addressofwarehouse” \
} \
] \
}’;

$headers = array(
//”POST “.$json_url.” HTTP/1.0″,
“Content-type: application/json;charset=\”utf-8\””,
“Accept: application/json”,
“Cache-Control: no-cache”,
“Pragma: no-cache”,
“Content-length: “.strlen($body),
“Authorization: ” . $credentials
);

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_URL => $curlurl,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $body,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_FOLLOWLOCATION => true

));

$response = curl_exec($curl);
$err = curl_error($curl);
$errmsg = curl_error($curl) ;
curl_close($curl);
print_r($response);
echo $errmsg;

if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}