0

I am developing code to get all orders and order related information from the flipkart orders api. I am getting an error when calling shipment detail url. Below is the code I tried:

$url  = "https://api.flipkart.net/sellers/v2/orders/shipments?orderItemsIds=1xxx68xxxx06xxxx";

$headers = array();
$headers[] = 'content-type: application/json';
$headers[] = 'Authorization:Bearer '.$access_token;//token value from above

$curl = curl_init(); 

curl_setopt($curl, CURLOPT_URL,$url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);//try to make it as true. making ssl verifyer as false will lead to security issues 

$response = curl_exec($curl);

$http = curl_getinfo($curl, CURLINFO_HTTP_CODE); // Response Code: 200 => Successful call
if (curl_errno($curl)) {
    echo 'Error:' . curl_error($curl);
}

$result = json_decode($response, true);

print_r($http);// get 400 here

print_r($result);//

Output is:

    Array
    (
        [0] => Array
            (
                [type] => 
                [code] => INVALID_ITEM_IDS
                [message] => Mandatory parameter orderItemIds missing
                [params] => Array
                    (
                    )
            )
    )

Any help would be appreciated!

theduck
  • 2,589
  • 13
  • 17
  • 23
Sachin
  • 397
  • 4
  • 13

1 Answers1

0

$url = "https://api.flipkart.net/sellers/v2/orders/shipments?orderItemsIds=1xxx68xxxx06xxxx";

This should change from orderItemsIds to orderItemIds

Sachin
  • 397
  • 4
  • 13