Reports

Here is a very simple example of how to retrieve a report from Amazon (assuming you already have a report ID from a different request, or from seller central) using the python-amazon-mws wrapper.

from mws import mws

access_key = 'accesskey' #replace with your access key
merchant_id = 'merchantid' #replace with your merchant id
secret_key = 'secretkey' #replace with your secret key

reportid = '123456' #replace with report id

x = mws.Reports(access_key=access_key, secret_key=secret_key, account_id=merchant_id)
report = x.get_report(report_id=reportid)
response_data = report.original
print response_data
class pymazonian.Reports(access_key, secret_key, account_id, region='US', domain='', uri='', version='', auth_token='')

#Amazon MWS Reports API#

get_report(report_id)

Returns the contents of a report and the Content-MD5 header for the returned report body.

Parameters:report_id (str) – A unique identifier of the report to download, obtained from the GetReportList operation or the GeneratedReportId of a ReportRequest.
Returns:DictWrapper
get_report_count(report_types=(), acknowledged=None, from_date=None, to_date=None)

Returns a count of the reports, created in the previous 90 days, with a status of _DONE_ and that are available for download.

Parameters:
  • report_types (list of str) – A structured list of ReportType enumeration values.
  • acknowledged (bool) – A Boolean value that indicates if an order report has been acknowledged by a prior call to UpdateReportAcknowledgements. Set to true to list order reports that have been acknowledged; set to false to list order reports that have not been acknowledged. This filter is valid only with order reports; it does not work with listing reports.
  • from_date – The earliest date you are looking for, in ISO 8601 date time format.
  • to_date – The most recent date you are looking for, in ISO 8601 date time format.
Returns:

DictWrapper

get_report_list(request_ids=(), max_count=None, types=(), acknowledged=None, from_date=None, to_date=None)

Returns a list of reports that were created in the previous 90 days.

Parameters:
  • request_ids (list of str) – A structured list of ReportRequestId values. If you pass in ReportRequestId values, other query conditions are ignored.
  • max_count (int) – A non-negative integer that represents the maximum number of report requests to return. If you specify a number greater than 100, the request is rejected.
  • types (list of str) – A structured list of ReportType enumeration values.
  • acknowledged (bool) – A Boolean value that indicates if an order report has been acknowledged by a prior call to UpdateReportAcknowledgements. Set to true to list order reports that have been acknowledged; set to false to list order reports that have not been acknowledged. This filter is valid only with order reports; it does not work with listing reports.
  • from_date – The earliest date you are looking for, in ISO 8601 date time format.
  • to_date – The most recent date you are looking for, in ISO 8601 date time format.
Returns:

DictWrapper

get_report_list_by_next_token(token)
Parameters:token (str) – A string token returned in a previous call. Use the NextToken to call the operation again if the return value of HasNext is true.
Returns:DictWrapper
get_report_request_count(report_types=(), processing_statuses=(), from_date=None, to_date=None)
Parameters:
  • report_types
  • processing_statuses
  • from_date
  • to_date
Returns:

DictWrapper

get_report_request_list(request_ids=(), types=(), processing_statuses=(), max_count=None, from_date=None, to_date=None)
Parameters:
  • request_ids
  • types
  • processing_statuses
  • max_count
  • from_date
  • to_date
Returns:

DictWrapper

get_report_request_list_by_next_token(token)
Parameters:token
Returns:DictWrapper
get_report_schedule_count(types=())
Parameters:types
Returns:DictWrapper
get_report_schedule_list(types=())
Parameters:types
Returns:DictWrapper
request_report(report_type, start_date=None, end_date=None, marketplace_ids=())
Parameters:
  • report_type
  • start_date
  • end_date
  • marketplace_ids
Returns:

DictWrapper