我想使用 API 更新我在 Sears 市场中的库存。
"库存管理: 此 API 调用使用 PUT 方法来管理您的项目的库存水平。为避免错误,库存更新应该只对已成功处理的项目进行。注意:库存不会自动减少,因此重要的是您在您接收和处理订单时更新库存。”
放置网址:https://seller.marketplace.sears.com/SellerPortal/api/inventory/fbm-lmp/v6?email={emailaddress}&password={password}
我创建了以下脚本但无法正常工作:
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<store-inventory
xmlns="http://seller.marketplace.sears.com/catalog/v2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://seller.marketplace.sears.com/SellerPortal/s/schema/rest/inventory/import/v2/store-inventory.xsd">
<item item-id="10">
<locations>
<location location-id="21">
<quantity>20</quantity>
<pick-up-now-eligible>false</pick-up-now-eligible>
</location>
</locations>
</item>
</store-inventory>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_URL, "https://seller.marketplace.sears.com/SellerPortal/api/inventory/fbm-lmp/v6?email={email}&password={pass}");
curl_setopt($ch, CURLOPT_PORT, 443);
curl_setopt($ch, CURLOPT_PUT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,array($xml));
$http_result = curl_exec($ch);
if($http_result){
echo $http_result;
}else{
echo curl_error($ch);
}
curl_close($ch);
卷曲错误:
连接到 Seller.marketplace.sears.com:443 的未知 SSL 协议错误
我哪里错了?