无法从亚马逊MWS Reports API请求_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_报告

时间:2018-03-07 17:55:46

标签: php amazon amazon-mws

我正在寻求帮助,使用亚马逊MWS API通过PHP请求报告。 实际上通过以下代码我无法提出报告请求。谁能告诉我什么是错的?

任何帮助都将不胜感激。

<?php
include_once ('.config.inc.php'); 

// Italy
$serviceUrl = "https://mws.amazonservices.it";

$config = array (
  'ServiceURL' => $serviceUrl,
  'ProxyHost' => null,
  'ProxyPort' => -1,
  'MaxErrorRetry' => 3,
);

$service = new MarketplaceWebService_Client(
    AWS_ACCESS_KEY_ID, 
    AWS_SECRET_ACCESS_KEY, 
    $config,
    APPLICATION_NAME,
    APPLICATION_VERSION
);

$service = new MarketplaceWebService_Mock();

$marketplaceIdArray = array("Id" => array('xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx', 'xxxxxxxxxxxxxx'));

$request = new MarketplaceWebService_Model_RequestReportRequest();
$request->setMarketplaceIdList($marketplaceIdArray);
$request->setMerchant(MERCHANT_ID);
$request->setReportType('_GET_AMAZON_FULFILLED_SHIPMENTS_DATA_');

$sdate = new DateTime('-7 days', new DateTimeZone('UTC'));
$startdate = $sdate->format("Y-m-d\T00:00:00P");
$edate = new DateTime('-1 days', new DateTimeZone('UTC'));
$enddate = $edate->format("Y-m-d\T23:59:59P");

$request->setStartDate($startdate);
$request->setEndDate($enddate);

$id = invokeRequestReport($service, $request);
?>

1 个答案:

答案 0 :(得分:0)

开始日期 2008-09-28T18:49:45Z

结束日期 2014-09-18T16:18:33Z

不确定这是否符合您的要求,但是6年对于单个请求而言可能太长。尝试仅提交一两天的数据请求,看看是否可行。