Reports#
- class sp_api.api.Reports(marketplace: ~sp_api.base.marketplaces.Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None, proxies=None, verify=True, timeout=None, version=None, credential_providers=None, auth_token_client_class=<class 'sp_api.auth.access_token_client.AccessTokenClient'>)#
Reports SP-API Client :link:
The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
- get_reports(self, **kwargs) ApiResponse#
Returns report details for the reports that match the filters that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().get_reports()
- Parameters:
reportTypes (key) – object | A list of report types used to filter reports. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required.
processingStatuses (key) – object | A list of processing statuses used to filter reports.
marketplaceIds (key) – object | A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify.
pageSize (key) – object | The maximum number of reports to return in a single call.
createdSince (key) – object | The earliest report creation date and time for reports to include in the response, in <a href=’https://developer-docs.amazon.com/sp-api/docs/iso-8601’>ISO 8601</a> date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.
createdUntil (key) – object | The latest report creation date and time for reports to include in the response, in <a href=’https://developer-docs.amazon.com/sp-api/docs/iso-8601’>ISO 8601</a> date time format. The default is now.
nextToken (key) – object | A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail.
- Returns:
ApiResponse
- create_report(self, **kwargs) ApiResponse#
Creates a report.
Usage Plan:
Rate (requests per second)
Burst
0.0167
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().create_report()
- Parameters:
body – CreateReportSpecification | required Information required to create the report.
- Returns:
ApiResponse
- cancel_report(self, reportId, **kwargs) ApiResponse#
Cancels the report that you specify. Only reports with processingStatus=IN_QUEUE can be cancelled. Cancelled reports are returned in subsequent calls to the getReport and getReports operations.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().cancel_report("value")
- Parameters:
reportId – object | required The identifier for the report. This identifier is unique only in combination with a seller ID.
- Returns:
ApiResponse
- get_report(self, reportId, **kwargs) ApiResponse#
Returns report details (including the reportDocumentId, if available) for the report that you specify.
Usage Plan:
Rate (requests per second)
Burst
2
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().get_report("value")
- Parameters:
reportId – object | required The identifier for the report. This identifier is unique only in combination with a seller ID.
- Returns:
ApiResponse
- get_report_schedules(self, **kwargs) ApiResponse#
Returns report schedule details that match the filters that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().get_report_schedules()
- Parameters:
reportTypes (key) – object | required A list of report types used to filter report schedules. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information.
- Returns:
ApiResponse
- create_report_schedule(self, **kwargs) ApiResponse#
Creates a report schedule. If a report schedule with the same report type and marketplace IDs already exists, it will be cancelled and replaced with this one.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().create_report_schedule()
- Parameters:
body – CreateReportScheduleSpecification | required Information required to create the report schedule.
- Returns:
ApiResponse
- cancel_report_schedule(self, reportScheduleId, **kwargs) ApiResponse#
Cancels the report schedule that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().cancel_report_schedule("value")
- Parameters:
reportScheduleId – object | required The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
- Returns:
ApiResponse
- delete_report_schedule(self, reportScheduleId, **kwargs) ApiResponse#
- cancel_report_schedule(self, reportScheduleId, **kwargs) -> ApiResponse
Cancels the report schedule that you specify.
Examples
literal blocks:
Reports().delete_report_schedule("value")
- Parameters:
reportScheduleId –
required**kwargs
- Returns:
ApiResponse
- get_report_schedule(self, reportScheduleId, **kwargs) ApiResponse#
Returns report schedule details for the report schedule that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.0222
10
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().get_report_schedule("value")
- Parameters:
reportScheduleId – object | required The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
- Returns:
ApiResponse
- get_report_document(self, reportDocumentId, download, file, character_code, stream, timeout, **kwargs) ApiResponse#
Returns the information required for retrieving a report document’s contents.
Usage Plan:
Rate (requests per second)
Burst
0.0167
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
Reports().get_report_document("value", "value", "value", "value", "value", "value")
- Parameters:
reportDocumentId – object | required The identifier for the report document.
- Returns:
ApiResponse