jlevers / selling-partner-api

A PHP client library for Amazon's Selling Partner API
BSD 3-Clause "New" or "Revised" License
403 stars 190 forks source link

The generation of reports GET_PROMOTION_PERFORMANCE_REPORT and GET_COUPON_PERFORMANCE_REPORT always results in a FATAL error #801

Closed liuliangqwer closed 4 minutes ago

liuliangqwer commented 2 hours ago

Problem description:

The generation of reports GET_PROMOTION_PERFORMANCE_REPORT and GET_COUPON_PERFORMANCE_REPORT always results in a FATAL error

Error:

array(10) { ["reportType"]=> string(32) "GET_PROMOTION_PERFORMANCE_REPORT" ["processingEndTime"]=> string(25) "2024-10-30T06:07:24+00:00" ["processingStatus"]=> string(5) "FATAL" ["marketplaceIds"]=> array(1) { [0]=> string(13) "ATVPDKIKX0DER" } ["reportDocumentId"]=> string(76) "amzn1.spdoc.1.4.na.f93920e1-9cb4-4cff-a75e-43e6343896fb.T3GJKS13MV4D3U.71300" ["reportId"]=> string(12) "467033020026" ["dataEndTime"]=> string(25) "2024-07-01T23:59:59+00:00" ["createdTime"]=> string(25) "2024-10-30T06:07:06+00:00" ["processingStartTime"]=> string(25) "2024-10-30T06:07:14+00:00" ["dataStartTime"]=> string(25) "2024-06-01T00:00:00+00:00" }

$marketplace_ids = ['ATVPDKIKX0DER']; $start_time = "2024-06-01T00:00:00Z"; $end_time = "2024-06-31T23:59:59Z"; $start_data = new \DateTime(date( "Y-m-d\TH:i:s\Z",strtotime($start_time))); $end_date = new \DateTime(date( "Y-m-d\TH:i:s\Z",strtotime($end_time))); $reportType = "GET_PROMOTION_PERFORMANCE_REPORT"; $reportOptions = [ 'promotionStartDateFrom' => $start_time, 'promotionStartDateTo' => $end_time ];

    $connector = getConnector();
    $reportApi                 = $connector->reportsV20210630();
    $createReportSpecification = new ReportsDto\CreateReportSpecification($reportType, $marketplace_ids, $reportOptions, $start_data, $end_date);
    $result                    = $reportApi->createReport($createReportSpecification);
    $resultDto                 = $result->dto();
    $requestId                 = $resultDto->reportId;
    var_dump($result->body());
liuliangqwer commented 2 hours ago

I didn't make frequent repeated requests