这个
ebay API documentation
非常清楚如何执行查询:
如果您想获得一个特定的fullfilliment策略,那么您需要执行
GET
使用
/order/{orderId}
{orderId}
是真实的订单ID。
可以
/* Returns a JSON object containing an ebay order */
function getOrder($order_id, $auth_key){
$options = array(
'http' => array(
'method' => "GET",
'header' => "Authorization: Bearer ".$auth_key."\r\n" .
"Content-Type: application/json"
)
);
$context = stream_context_create($options);
$result = file_get_contents("https://api.ebay.com/sell/fulfillment/v1/order/".$order_id, false, $context);
return json_decode($result);
}
然后您可以调用上述方法并使用以下方法检索订单:
$order = getOrder("A REAL ORDER ID", "YOUR AUTH KEY");
$order
变量现在保存一个JSON对象。您可以使用:(本例打印与订单相关联的用户名)打印来自对象的信息
echo $order->buyer->username;
最后,请
笔记
直接引用
ebays documentation
“eBay创建并显示应用程序令牌。此令牌在有限的时间范围内有效。如果使用此令牌进行呼叫时出现无效令牌错误,只需创建一个新令牌并在呼叫中使用新令牌即可。“