关于亚马逊mws报道api的FBA费用

时间:2016-04-07 17:26:21

标签: node.js amazon-mws fba

我正在制作关于FBA费用的功能。

参考此链接。 How to get FBA Fee and commission using Amazon MWS

我正在使用node.js 我必须在getReportList函数上输入2个参数,但我不能。

这是我的代码:

function mws_RequestReportForFee (req, res, i, data, io) {  
var report1 = '_GET_FLAT_FILE_PAYMENT_SETTLEMENT_DATA_';    
var report2 = '_GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_';  

//var paramsdata2 = {'ReportTypeList.Type.1' : report1, 'ReportTypeList.Type.2' : report2};
//var paramsdata2 = {'ReportTypes' : {'ReportTypeList.Type.1': report1, 'ReportTypeList.Type.2' : report2}};    

console.log("2222222222222222222222222222222222"+paramsdata2);
}
console.log('----------------------config==================\n',config); 
mws.reports.GetReportList(config, paramsdata2, true, function (err, result1) {
console.log("333333333333333333333333333"+result1);
to_json(result1,function(err,data1){
if (!err) {...........  

然后是当前结果:

333333333333333333333333333<?xml version="1.0"?>
<GetReportListResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<GetReportListResult>
<HasNext>true</HasNext>
<NextToken>blah blah</NextToken>
<ReportInfo>
<ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType> 
<Acknowledged>false</Acknowledged>
<ReportId>1234123412341234</ReportId>
<ReportRequestId>123412341234</ReportRequestId>
<AvailableDate>2016-04-06T00:38:32+00:00</AvailableDate>
</ReportInfo>
<ReportInfo>
<ReportType>_GET_MERCHANT_LISTINGS_DATA_</ReportType>
<Acknowledged>false</Acknowledged>
<ReportId>1234123412341234</ReportId>
<ReportRequestId>1234123412341234</ReportRequestId>
<AvailableDate>2016-04-06T00:31:57+00:00</AvailableDate>
</ReportInfo>    
.........

当我使用2个参数尝试暂存器时:

<?xml version="1.0"?>
<GetReportListResponse xmlns="http://mws.amazonaws.com/doc/2009-01-01/">
<GetReportListResult>
<HasNext>false</HasNext>
<ReportInfo>
<ReportType>_GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_</ReportType>
<Acknowledged>false</Acknowledged>
<ReportId>123412341234</ReportId>
<ReportRequestId>12341234</ReportRequestId>
<AvailableDate>2016-03-30T01:48:38+00:00</AvailableDate>
</ReportInfo>
<ReportInfo>
<ReportType>_GET_V2_SETTLEMENT_REPORT_DATA_FLAT_FILE_</ReportType>
<Acknowledged>false</Acknowledged>
<ReportId>123412341234</ReportId>
<ReportRequestId>12341234</ReportRequestId>
<AvailableDate>2016-03-16T01:40:03+00:00</AvailableDate>
</ReportInfo>

我想让结果看起来像一个暂存器。 如何获取该报告类型。 如何输入“paramsdata2”。

谢谢。

1 个答案:

答案 0 :(得分:2)

我不确定使用Reports,但我使用ListFinancialEvents api调用来获取信息。您可以简单地传递订单ID,并从收集的金额和亚马逊取出的所有费用中提取oder上的所有信息。