简体   繁体   中英

How do I set report type for Amazon MWS report api

I have ordered this Transaction report from Amazon seller central because one can't request from Report's API. Now I am trying to download this report using report api which is working fine, But now I am trying to set the report type to "_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_" so that I get requested report list for only this type of report. I am using the code below but it's giving me this error

"Fatal error: Call to a member function getType() on a non-object in /AmazonAPI/ReportsAPIClass/src/MarketplaceWebService/Client.php on line 1605"

$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);

        //===========================GETS REPORT ID     
        $request_report_list = new MarketplaceWebService_Model_GetReportListRequest();
        $request_report_list->setMerchant($MERCHANT_ID);
        $request_report_list->setAcknowledged(false);
        $request_report_list->setMarketplace($MARKETPLACE_ID);
        $request_report_list->setReportTypeList(array("TypeList" => "_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_"));

you have to create a class of type typelist and send as parameter

$TypeList = new MarketplaceWebService_Model_TypeList();
$TypeList->setType('_GET_DATE_RANGE_FINANCIAL_TRANSACTION_DATA_');
$request_report_list->setReportTypeList($TypeList);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM