我使用的是亚马逊API超过2年,我对此非常熟悉。我正在尝试请求并订购此" _GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA _"来自亚马逊的报告使用报告' API,它生成了ReportRequestID,但从未生成任何报告,我在过去3天内请求。 它的状态一直在提交,但从未更新为已完成状态。我也尝试过亚马逊ScratchPad。
我正在使用相同的报告API请求许多其他报告,它们非常完美。 如果有人遇到同样的问题,请告诉我。
这是我用来请求报告的代码:
$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");
$AWS_ACCESS_KEY_ID = $pos['azn_access_key'];
$AWS_SECRET_ACCESS_KEY = $pos['azn_secret_access_key'];
$APPLICATION_NAME = $pos['azn_app_name'];
$APPLICATION_VERSION = $pos['azn_app_version'];
$MERCHANT_ID = $pos['azn_merchant_id'];
$MARKETPLACE_ID = $pos['azn_marketplace_id'];
$MERCHANT_TOKEN = $pos['azn_merchant_token'];
$pos_name = $pos['nickname'];
$pos_id = $pos['id'];
$serviceURL = $pos['azn_service_url'];
$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);
$marketplaceIdArray = array("Id" => array($MARKETPLACE_ID));
//Sends Report Request
$parameters = array(
'Merchant' => $MERCHANT_ID,
'MarketplaceIdList' => $marketplaceIdArray,
'ReportType' => '_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_',
'ReportOptions' => 'ShowSalesChannel=true',
'StartDate' => new DateTime($startdate, new DateTimeZone('UTC')),
'EndDate' => new DateTime($enddate, new DateTimeZone('UTC')),
);
$request = new MarketplaceWebService_Model_RequestReportRequest($parameters);
$request = new MarketplaceWebService_Model_RequestReportRequest();
$request->setMarketplaceIdList($marketplaceIdArray);
$request->setMerchant($MERCHANT_ID);
$request->setReportType('_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_');
$request->setReportOptions('ShowSalesChannel=true');
$request->setStartDate(new DateTime($startdate, new DateTimeZone('UTC')));
$request->setEndDate(new DateTime($enddate, new DateTimeZone('UTC')));
$report_requestID = invokeRequestReport($service, $request);
答案 0 :(得分:3)
无法通过API请求此报告。在请求报告时,< Scheduled>标签会告诉您它是否会被处理。对于GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_报告,您将始终获得< Scheduled> false< / Scheduled>。
另一种方法是使用用户界面安排报告,但这使您只能选择月度报告,而不是自定义日期范围报告。