Yahoo JP, also relatively small platform, the company is also used to clear inventory, but the order is more and more large, is also the time to integrate, but little online data, almost no, the official API is Japan, is really a pit, walked a long time to come out.
We discuss only the most basic order acquisition, first of all, in addition to the need to go to the アプリケーションの Management application basic information key, on the acquisition of orders, but also need to apply separately to use the order API, inside the IP address to fill the correct, otherwise not get data, this is the first pit.
The website has PHP SDK, get token, update token is no problem, but other orders get no SDK, only follow the document slowly groping.
Yahoo's return and its unfriendly, pay attention to UTF8, otherwise it will not return any data
Here's a function to get the order
/* Get order list key from require $SellerId MAKUROEC, $OrderTimeFrom 20160714000000 $key token/function orderlist ($SellerId, $Or
Dertimefrom, $OrderTimeTo = ', $key) {$api = ' https://circus.shopping.yahooapis.jp/ShoppingWebService/V1/orderList ';
if ($OrderTimeTo!= ') $OrderTimeTo = "<OrderTimeTo> $OrderTimeTo </OrderTimeTo>"; $xml =<<<xml <Req> <SellerId> $SellerId </SellerId> <Search> <field>orderid </Field> <Result>2000</Result> <Condition> <OrderTimeFrom> $OrderTimeFrom </
ordertimefrom> $OrderTimeTo </Condition> </Search> </Req> XML;
$ch = Curl_init ($API);
$headr = Array ("Authorization:bearer". $key);
curl_setopt ($ch, curlopt_ssl_verifypeer,true); curl_setopt ($ch, Curlopt_cainfo,dirname (__file__).
/cacert.pem ');
curl_setopt ($ch, Curlopt_post, true);
curl_setopt ($ch, Curlopt_returntransfer, true);
curl_setopt ($ch, Curlopt_httpheader, $headr); curl_setopt ($ch, Curlopt_postfields, $xml);
$result = curl_exec ($ch);
Curl_close ($ch);
$orderList = Json_decode (Json_encode (simplexml_load_string ($result)), TRUE);
return $orderList; }
If you don't understand, you can ask me below.