2016-01-09 90 views
0
$app_id='*********************************'; 
$app_secret='*******************************'; 
$scope = 'Seller_Api'; 

$base_url = "https://api.flipkart.net/sellers/v2/orders/?" 

$url_params = 
    array( 

      'access_token' =>"********************", 
      //'orderItemIds'=>'*************', 
      'client_id' => $app_id, 
      'client_secret' => $app_secret, 

     //'reresh_token' =>"************************************" 

); 


     // $url_params['Timestamp'] = gmdate("Y-m-d\TH:i:s\Z"); 
      $url_parts = array(); 
      foreach(array_keys($url_params) as $key) 
      $url_parts[] = $key."=".$url_params[$key]; 
      //sort($url_parts); 



      // var_dump($url_parts);die; 
      $url_string = implode("&",$url_parts); 
      // var_dump($url_string);die; 
      $url = $base_url.$url_string; 

      //print_r($url);die; 

      $response=file_get_contents($url); 

      print_r($response);die; 

?> 

我的問題是我需要打通flipkart賣家API次序名單的細節,但我不能讓所有的訂單細節,但我只得到orderitemid通過獲取數據。所以我想通過獲取賣家flipkart API的所有訂單的詳細信息產生錯誤....如何通過flipkart賣家API獲得orderlist細節在PHP

強制性參數orderItemIds失蹤......

我需要一個orderlist的細節,這樣我能做些什麼?

回答

2

本文here

做一個POST請求請前往以下網址

https://api.flipkart.net/sellers/v2/orders/search 

使用這些可選的參數來搜索訂單。您可以使用orderDate存儲參數來搜索訂單發生在特定的一天

orderDate: 
    fromDate 
    toDate 

String Optional Filter based on orders placed within the selected date range, where the date strings are in ISO format 

dispatchAfterDate: 
    fromDate 
    toDate 

String Optional Filter based on orders to be processed within the selected date range, where the date strings are in ISO format 

dispatchByDate: 
    fromDate 
    toDate 

String Optional Filter based on orders to be dispatched within the selected date range, where the date strings are in ISO format 

modifiedDate: 
    fromDate 
    toDate 

String Optional Filter for orders that were modified within the selected date range, where the date strings are in ISO format 

指出基於有效訂單狀態的逗號分隔的列表上列出可選的過濾器訂單。現在不支持基於處理狀態的過濾。可能的值:批准,PACKED,READY_TO_DISPATCH,並取消基於一個逗號分隔的賣方名單上 SKU列表可選的過濾器訂單的SKU

使用此示例代碼

$url = "https://sandbox-api.flipkart.net/sellers/v2/orders/search"; 
$curl = curl_init(); 
$searchData = '{ 
      "filter": { 
      "orderDate": { 
       "fromDate": "2015-11-05T08:15:30Z", //refer ISO formate date 
       "toDate": "2015-12-05T08:15:30Z" 
      } 
      } 
     }'; 
curl_setopt($curl, CURLOPT_URL,$url); 

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST"); 
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($curl, CURLOPT_POSTFIELDS, $searchData); 
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);//try to make it as true. making ssl verifyer as false will lead to secruty issues 
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type:application/json', 
'Authorization:Bearer '.$tokan['access_token'], 
'' 
)); 
$response = curl_exec($curl); 
echo $response 
+0

感謝@Jinu PC。它的工作原理 – Urvashi

+1

你」歡迎@Urvashi :) –

相關問題