SKU の製品の利用可能な在庫を取得しようとしています。私はそれを検索しました-それらのどれもが私のために働いていないいくつかのpdfがたくさん見つかりました。私は何をすべきか頭を悩ませています。誰かが私を助けてくれますか?それ以上に感謝します. 私もこのコードを試しました、
$skus = new FBAInventoryServiceMWS_Model_SellerSkuList();
$skus->setmember( 'sku-111' );
invokeListInventorySupply($service, $request->withSellerSkus( $skus ) );
しかし、返されたのは InStockSupplyQuantity is 0 です。このリンクで確認できます
これは私が使用しているコードの完全なバージョンです。
<?php
include_once ('.config.inc.php');
$config = array (
'ServiceURL' => MWS_ENDPOINT_URL,
'ProxyHost' => null,
'ProxyPort' => -1,
'MaxErrorRetry' => 3
);
$service = new FBAInventoryServiceMWS_Client(
ACCESS_KEY_ID,
SECRET_ACCESS_KEY,
$config,
APPLICATION_NAME,
APPLICATION_VERSION);
$request = new FBAInventoryServiceMWS_Model_ListInventorySupplyRequest();
$request->setSellerId(SELLER_ID);
$skus = new FBAInventoryServiceMWS_Model_SellerSkuList();
$skus->setmember( 'sku-111' );
invokeListInventorySupply($service, $request->withSellerSkus( $skus ) );
function invokeListInventorySupply(FBAInventoryServiceMWS_Interface $service, $request)
{
try {
$response = $service->listInventorySupply($request);
echo ("Service Response<br />");
echo ("=============================================================================<br />");
echo(" ListInventorySupplyResponse<br />");
if ($response->isSetListInventorySupplyResult()) {
echo(" ListInventorySupplyResult<br />");
$listInventorySupplyResult = $response->getListInventorySupplyResult();
if ($listInventorySupplyResult->isSetInventorySupplyList()) {
echo(" InventorySupplyList<br />");
$inventorySupplyList = $listInventorySupplyResult->getInventorySupplyList();
$memberList = $inventorySupplyList->getmember();
foreach ($memberList as $member) {
echo(" member<br />");
echo ("=============================================================================<br />");
if ($member->isSetSellerSKU())
{
echo(" SellerSKU<br />");
echo(" " . $member->getSellerSKU() . "<br /><br />");
}
if ($member->isSetFNSKU())
{
echo(" FNSKU<br />");
echo(" " . $member->getFNSKU() . "<br /><br />");
}
if ($member->isSetASIN())
{
echo(" ASIN<br />");
echo(" " . $member->getASIN() . "<br /><br />");
}
if ($member->isSetCondition())
{
echo(" Condition<br />");
echo(" " . $member->getCondition() . "<br /><br />");
}
if ($member->isSetTotalSupplyQuantity())
{
echo(" TotalSupplyQuantity<br />");
echo(" " . $member->getTotalSupplyQuantity() . "<br /><br />");
}
if ($member->isSetInStockSupplyQuantity())
{
echo(" InStockSupplyQuantity<br />");
echo(" " . $member->getInStockSupplyQuantity() . "<br /><br />");
}
if ($member->isSetEarliestAvailability()) {
echo(" EarliestAvailability<br />");
$earliestAvailability = $member->getEarliestAvailability();
if ($earliestAvailability->isSetTimepointType())
{
echo(" TimepointType<br />");
echo(" " . $earliestAvailability->getTimepointType() . "<br /><br />");
}
if ($earliestAvailability->isSetDateTime())
{
echo(" DateTime<br />");
echo(" " . $earliestAvailability->getDateTime() . "<br /><br />");
}
}
if ($member->isSetSupplyDetail()) {
echo(" SupplyDetail<br />");
$supplyDetail = $member->getSupplyDetail();
$member1List = $supplyDetail->getmember();
foreach ($member1List as $member1) {
echo(" member<br />");
if ($member1->isSetQuantity())
{
echo(" Quantity<br />");
echo(" " . $member1->getQuantity() . "<br /><br />");
}
if ($member1->isSetSupplyType())
{
echo(" SupplyType<br />");
echo(" " . $member1->getSupplyType() . "<br /><br />");
}
if ($member1->isSetEarliestAvailableToPick()) {
echo(" EarliestAvailableToPick<br />");
$earliestAvailableToPick = $member1->getEarliestAvailableToPick();
if ($earliestAvailableToPick->isSetTimepointType())
{
echo(" TimepointType<br />");
echo(" " . $earliestAvailableToPick->getTimepointType() . "<br /><br />");
}
if ($earliestAvailableToPick->isSetDateTime())
{
echo(" DateTime<br />");
echo(" " . $earliestAvailableToPick->getDateTime() . "<br /><br />");
}
}
if ($member1->isSetLatestAvailableToPick()) {
echo(" LatestAvailableToPick<br />");
$latestAvailableToPick = $member1->getLatestAvailableToPick();
if ($latestAvailableToPick->isSetTimepointType())
{
echo(" TimepointType<br />");
echo(" " . $latestAvailableToPick->getTimepointType() . "<br /><br />");
}
if ($latestAvailableToPick->isSetDateTime())
{
echo(" DateTime<br />");
echo(" " . $latestAvailableToPick->getDateTime() . "<br /><br />");
}
}
}
}
}
}
if ($listInventorySupplyResult->isSetNextToken())
{
echo(" NextToken<br />");
echo(" " . $listInventorySupplyResult->getNextToken() . "<br /><br />");
}
}
if ($response->isSetResponseMetadata()) {
echo(" ResponseMetadata<br />");
$responseMetadata = $response->getResponseMetadata();
if ($responseMetadata->isSetRequestId())
{
echo(" RequestId<br />");
echo(" " . $responseMetadata->getRequestId() . "<br /><br />");
}
}
} catch (FBAInventoryServiceMWS_Exception $ex) {
echo("Caught Exception: " . $ex->getMessage() . "<br /><br />");
echo("Response Status Code: " . $ex->getStatusCode() . "<br /><br />");
echo("Error Code: " . $ex->getErrorCode() . "<br /><br />");
echo("Error Type: " . $ex->getErrorType() . "<br /><br />");
echo("Request ID: " . $ex->getRequestId() . "<br /><br />");
echo("XML: " . $ex->getXML() . "<br /><br />");
}
}