chengkun
2025-09-05 4822304b63e1bd6327860af7f3db0133cecf167f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<?php
/**
* This class is autogenerated by the Spapi class generator
* Date of generation: 2022-05-26
* Specification: https://github.com/amzn/selling-partner-api-models/blob/main/models/reports-api-model/reports_2021-06-30.json
* Source MD5 signature: 7c73f3a324cad408ef57b0b24c657e6f
*
*
* Selling Partner API for Reports
* The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
*/
namespace DoubleBreak\Spapi\Api;
use DoubleBreak\Spapi\Client;
 
class Reports extends Client {
 
  /**
  * Operation getReports
  *
  * @param array $queryParams
  *    - *reportTypes* array - A list of report types used to filter reports. 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* array - A list of processing statuses used to filter reports.
  *    - *marketplaceIds* array - A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify.
  *    - *pageSize* integer - The maximum number of reports to return in a single call.
  *    - *createdSince* string - The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days.
  *    - *createdUntil* string - The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now.
  *    - *nextToken* string - 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.
  *
  */
  public function getReports($queryParams = [])
  {
    return $this->send("/reports/2021-06-30/reports", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function getReportsAsync($queryParams = [])
  {
    return $this->sendAsync("/reports/2021-06-30/reports", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation createReport
  *
  */
  public function createReport($body = [])
  {
    return $this->send("/reports/2021-06-30/reports", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  public function createReportAsync($body = [])
  {
    return $this->sendAsync("/reports/2021-06-30/reports", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  /**
  * Operation cancelReport
  *
  * @param string $reportId The identifier for the report. This identifier is unique only in combination with a seller ID.
  *
  */
  public function cancelReport($reportId)
  {
    return $this->send("/reports/2021-06-30/reports/{$reportId}", [
      'method' => 'DELETE',
    ]);
  }
 
  public function cancelReportAsync($reportId)
  {
    return $this->sendAsync("/reports/2021-06-30/reports/{$reportId}", [
      'method' => 'DELETE',
    ]);
  }
 
  /**
  * Operation getReport
  *
  * @param string $reportId The identifier for the report. This identifier is unique only in combination with a seller ID.
  *
  */
  public function getReport($reportId)
  {
    return $this->send("/reports/2021-06-30/reports/{$reportId}", [
      'method' => 'GET',
    ]);
  }
 
  public function getReportAsync($reportId)
  {
    return $this->sendAsync("/reports/2021-06-30/reports/{$reportId}", [
      'method' => 'GET',
    ]);
  }
 
  /**
  * Operation getReportSchedules
  *
  * @param array $queryParams
  *    - *reportTypes* array - A list of report types used to filter report schedules.
  *
  */
  public function getReportSchedules($queryParams = [])
  {
    return $this->send("/reports/2021-06-30/schedules", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  public function getReportSchedulesAsync($queryParams = [])
  {
    return $this->sendAsync("/reports/2021-06-30/schedules", [
      'method' => 'GET',
      'query' => $queryParams,
    ]);
  }
 
  /**
  * Operation createReportSchedule
  *
  */
  public function createReportSchedule($body = [])
  {
    return $this->send("/reports/2021-06-30/schedules", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  public function createReportScheduleAsync($body = [])
  {
    return $this->sendAsync("/reports/2021-06-30/schedules", [
      'method' => 'POST',
      'json' => $body
    ]);
  }
 
  /**
  * Operation cancelReportSchedule
  *
  * @param string $reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
  *
  */
  public function cancelReportSchedule($reportScheduleId)
  {
    return $this->send("/reports/2021-06-30/schedules/{$reportScheduleId}", [
      'method' => 'DELETE',
    ]);
  }
 
  public function cancelReportScheduleAsync($reportScheduleId)
  {
    return $this->sendAsync("/reports/2021-06-30/schedules/{$reportScheduleId}", [
      'method' => 'DELETE',
    ]);
  }
 
  /**
  * Operation getReportSchedule
  *
  * @param string $reportScheduleId The identifier for the report schedule. This identifier is unique only in combination with a seller ID.
  *
  */
  public function getReportSchedule($reportScheduleId)
  {
    return $this->send("/reports/2021-06-30/schedules/{$reportScheduleId}", [
      'method' => 'GET',
    ]);
  }
 
  public function getReportScheduleAsync($reportScheduleId)
  {
    return $this->sendAsync("/reports/2021-06-30/schedules/{$reportScheduleId}", [
      'method' => 'GET',
    ]);
  }
 
  /**
  * Operation getReportDocument
  *
  * @param string $reportDocumentId The identifier for the report document.
  *
  */
  public function getReportDocument($reportDocumentId)
  {
    return $this->send("/reports/2021-06-30/documents/{$reportDocumentId}", [
      'method' => 'GET',
    ]);
  }
 
  public function getReportDocumentAsync($reportDocumentId)
  {
    return $this->sendAsync("/reports/2021-06-30/documents/{$reportDocumentId}", [
      'method' => 'GET',
    ]);
  }
}