bhushankummar / amazon-mws

Amazon MWS NodeJS Wrapper
MIT License
197 stars 78 forks source link

GetReport response object has strange syntax #95

Closed TheCodeOne closed 5 years ago

TheCodeOne commented 5 years ago

Hello,

this is my request:

async function getReportData(id) {
  try {
    result = await amazonMws.reports.search({
      Version: '2009-01-01',
      Action: 'GetReport',
      SellerId: process.env.SellerId,
      MWSAuthToken: process.env.MWSAuthToken,
      ReportId: id,
    });
return result;
  } catch (error) {
    throw error;
  }
}

With one report of the _GET_FBA_FULFILLMENT_REMOVAL_ORDER_DETAIL_DATA_ type the object has a wrong syntax.

Expected result:

[
  {
    "cancelled-quantity": "0",
    "currency": "",
    "disposed-quantity": "0",
    "disposition": "Unsellable",
    "fnsku": "XXXXXX",
    "in-process-quantity": "1",
    "last-updated-date": "2019-07-04T15:40:33+00:00",
    "order-id": "XXXXXX",
    "order-status": "Pending",
    "order-type": "Disposal",
    "removal-fee": "",
    "request-date": "2019-07-04T15:40:33+00:00",
    "requested-quantity": "1",
    "service-speed": "-",
    "shipped-quantity": "",
    "sku": "XXXXXX"
  },
  ...
]

Actual result:

[
 {
  "request-date","order-id","order-type","service-speed","order-status","last-updated-date","sku","fnsku","disposition","requested-quantity","cancelled-quantity","disposed-quantity","shipped-quantity","in-process-quantity","removal-fee","currency": ""2019-06-07T13:36:26+00:00","XXXXXX","Return","Standard","Pending","2019-06-07T14:01:30+00:00","XXXXXX",XXXXXX","Unsellable","1","0",,"0","1",,"
 },
...
]

I can provide you with more informations and even send you the correct data I get from https://mws.amazonservices.de/scratchpad/index.html.

Cheers

TheCodeOne commented 5 years ago

Hi there,

i managed to find out what the problem is. A colleague of mine requested the report via the Amazon Seller Central and clicked on get CSV-File instead of TXT-File.