【问题标题】:Fetch shipment detail data for order from flipkart order api v2从 Flipkart 订单 api v2 获取订单的发货详细信息
【发布时间】:2020-02-08 23:35:05
【问题描述】:

我正在开发代码以从 Flipkart 订单 api 获取所有订单和订单相关信息。调用货件详细信息 url 时出现错误。下面是我试过的代码:

$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);//

输出是:

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

任何帮助将不胜感激!

【问题讨论】:

  • 现在解决了。
  • 您是否愿意分享解决方案,或者是错字,您想删除问题?

标签: php api flipkart-api


【解决方案1】:

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

这应该从 orderItemsIds 更改为 orderItemIds

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-20
    • 1970-01-01
    • 2017-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-10
    相关资源
    最近更新 更多