Closed jakeleventhal closed 4 years ago
@jakeleventhal Which MWS CAll are you using?
mws.finances.search({
Action: 'ListFinancialEvents',
MWSAuthToken: mwsAuthToken,
PostedAfter: moment(startDate).toISOString(),
PostedBefore: endDate && moment(endDate).toISOString(),
SellerId: sellerId,
Version: '2015-05-01'
});
Also, perhaps this library should allow moment.js dates to be used (automatically convert them to iso strings).
It would also be cool if all calls were parametrized like:
mws.finances.listFinancialEvents(sellerId, mwsAuthToken, postedBefore, postedAfter, nextToken);
Things like Action
can be just function names and things like Version
are static and shouldn't have to be included in every call by the user.
@jakeleventhal Thank you for the comments. However, I will keep it noted for future discussion.
I have code to parse different financial events returned from the list financial events api. Here is one of my functions for the network commingling transaction event list:
I have many similar functions for different financial event types but there are two issues that my code has to account for:
castArray
function since data that is supposed to get returned as an array gets returned as an object if there is only one item in the array.I think it makes sense the amazon-mws library would take care of these things for the user instead of the other way around.