-
Notifications
You must be signed in to change notification settings - Fork 726
/
sales.json
660 lines (660 loc) · 25.3 KB
/
sales.json
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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
{
"swagger": "2.0",
"info": {
"description": "The Selling Partner API for Sales provides APIs related to sales performance.",
"version": "v1",
"title": "Selling Partner API for Sales",
"contact": {
"name": "Selling Partner API Developer Support",
"url": "https://sellercentral.amazon.com/gp/mws/contactus.html"
},
"license": {
"name": "Apache License 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"host": "sellingpartnerapi-na.amazon.com",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/sales/v1/orderMetrics": {
"get": {
"tags": [
"sales"
],
"description": "Returns aggregated order metrics for given interval, broken down by granularity, for given buyer type.\n\n**Usage Plan:**\n\n| Rate (requests per second) | Burst |\n| ---- | ---- |\n| .5 | 15 |\n\nThe `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The table above indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput may see higher rate and burst values than those shown here. For more information, see [Usage Plans and Rate Limits in the Selling Partner API](doc:usage-plans-and-rate-limits-in-the-sp-api).",
"operationId": "getOrderMetrics",
"parameters": [
{
"name": "marketplaceIds",
"in": "query",
"description": "A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.\n\nFor example, ATVPDKIKX0DER indicates the US marketplace.",
"required": true,
"type": "array",
"items": {
"type": "string"
}
},
{
"name": "interval",
"in": "query",
"description": "A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone.",
"required": true,
"type": "string"
},
{
"name": "granularityTimeZone",
"in": "query",
"description": "An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. The granularityTimeZone value must align with the offset of the specified interval value. For example, if the interval value uses Z notation, then granularityTimeZone must be UTC. If the interval value uses an offset, then granularityTimeZone must be an IANA-compatible time zone that matches the offset. Example: US/Pacific to compute day boundaries, accounting for daylight time savings, for US/Pacific zone.",
"required": false,
"type": "string"
},
{
"name": "granularity",
"in": "query",
"description": "The granularity of the grouping of order metrics, based on a unit of time. Specifying granularity=Hour results in a successful request only if the interval specified is less than or equal to 30 days from now. For all other granularities, the interval specified must be less or equal to 2 years from now. Specifying granularity=Total results in order metrics that are aggregated over the entire interval that you specify. If the interval start and end date don’t align with the specified granularity, the head and tail end of the response interval will contain partial data. Example: Day to get a daily breakdown of the request interval, where the day boundary is defined by the granularityTimeZone.",
"required": true,
"type": "string",
"enum": [
"Hour",
"Day",
"Week",
"Month",
"Year",
"Total"
],
"x-docgen-enum-table-extension": [
{
"value": "Hour",
"description": "Hour"
},
{
"value": "Day",
"description": "Day"
},
{
"value": "Week",
"description": "Week"
},
{
"value": "Month",
"description": "Month"
},
{
"value": "Year",
"description": "Year"
},
{
"value": "Total",
"description": "Total"
}
]
},
{
"name": "buyerType",
"in": "query",
"description": "Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers.",
"required": false,
"type": "string",
"default": "All",
"enum": [
"B2B",
"B2C",
"All"
],
"x-docgen-enum-table-extension": [
{
"value": "B2B",
"description": "Business to business."
},
{
"value": "B2C",
"description": "Business to customer."
},
{
"value": "All",
"description": "Business to business and business to customer."
}
]
},
{
"name": "fulfillmentNetwork",
"in": "query",
"description": "Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network.",
"required": false,
"type": "string"
},
{
"name": "firstDayOfWeek",
"in": "query",
"description": "Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday.",
"required": false,
"type": "string",
"default": "Monday",
"enum": [
"Monday",
"Sunday"
],
"x-docgen-enum-table-extension": [
{
"value": "Monday",
"description": "Monday"
},
{
"value": "Sunday",
"description": "Sunday"
}
]
},
{
"name": "asin",
"in": "query",
"description": "Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN.",
"required": false,
"type": "string"
},
{
"name": "sku",
"in": "query",
"description": "Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU.",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "OrderMetric action taken on the resource OrderMetrics.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"examples": {
"payload": {
"dayGranularity": {
"metrics": [
{
"interval": "2018-05-01T00:00-07:00--2018-05-02T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
},
{
"interval": "2018-05-02T00:00-07:00--2018-05-03T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "2.05",
"currencyCode": "USD"
},
"totalSales": {
"amount": "2.05",
"currencyCode": "USD"
}
}
]
},
"totalGranularity": {
"metrics": [
{
"interval": "2018-05-01T00:00-07:00--2018-05-03T00:00-07:00",
"unitCount": 2,
"orderItemCount": 2,
"orderCount": 2,
"averageUnitPrice": {
"amount": "12.5",
"currencyCode": "USD"
},
"totalSales": {
"amount": "25",
"currencyCode": "USD"
}
}
]
},
"asinFilter": {
"metrics": [
{
"interval": "2018-05-01T00:00-07:00--2018-05-02T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
},
{
"interval": "2018-05-02T00:00-07:00--2018-05-03T00:00-07:00",
"unitCount": 0,
"orderItemCount": 0,
"orderCount": 0,
"averageUnitPrice": {
"amount": "0",
"currencyCode": "USD"
},
"totalSales": {
"amount": "0",
"currencyCode": "USD"
}
}
]
}
}
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.."
},
"x-amzn-RequestId": {
"type": "string",
"description": "unique request reference id."
}
},
"x-amzn-api-sandbox": {
"static": [
{
"request": {
"parameters": {
"granularity": {
"value": "Total"
}
}
},
"response": {
"payload": [
{
"interval": "2019-08-01T00:00-07:00--2018-08-03T00:00-07:00",
"unitCount": 2,
"orderItemCount": 2,
"orderCount": 2,
"averageUnitPrice": {
"amount": "12.5",
"currencyCode": "USD"
},
"totalSales": {
"amount": "25",
"currencyCode": "USD"
}
}
]
}
},
{
"request": {
"parameters": {
"granularity": {
"value": "Day"
}
}
},
"response": {
"payload": [
{
"interval": "2019-08-01T00:00-07:00--2018-08-02T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
},
{
"interval": "2019-08-02T00:00-07:00--2018-08-03T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "2.05",
"currencyCode": "USD"
},
"totalSales": {
"amount": "2.05",
"currencyCode": "USD"
}
}
]
}
},
{
"request": {
"parameters": {
"granularity": {
"value": "Total"
},
"asin": {
"value": "B008OLKVEW"
}
}
},
"response": {
"payload": [
{
"interval": "2018-05-01T00:00-07:00--2018-05-03T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
}
]
}
},
{
"request": {
"parameters": {
"granularity": {
"value": "Day"
},
"asin": {
"value": "B008OLKVEW"
}
}
},
"response": {
"payload": [
{
"interval": "2018-05-01T00:00-07:00--2018-05-02T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
},
{
"interval": "2018-05-02T00:00-07:00--2018-05-03T00:00-07:00",
"unitCount": 0,
"orderItemCount": 0,
"orderCount": 0,
"averageUnitPrice": {
"amount": "0",
"currencyCode": "USD"
},
"totalSales": {
"amount": "0",
"currencyCode": "USD"
}
}
]
}
}
]
}
},
"400": {
"description": "Request has missing or invalid parameters and cannot be parsed.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"403": {
"description": "403 can be caused for reasons like Access Denied, Unauthorized, Expired Token, Invalid Signature or Resource Not Found.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"404": {
"description": "The resource specified does not exist.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"413": {
"description": "The request size exceeded the maximum accepted size.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"415": {
"description": "The entity of the request is in a format not supported by the requested resource.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"429": {
"description": "The frequency of requests was greater than allowed.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"500": {
"description": "Encountered an unexpected condition which prevented the server from fulfilling the request.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
},
"503": {
"description": "Temporary overloading or maintenance of the server.",
"schema": {
"$ref": "#/definitions/GetOrderMetricsResponse"
},
"headers": {
"x-amzn-RateLimit-Limit": {
"type": "string",
"description": "Your rate limit (requests per second) for this operation.\n_Note:_ For this status code, the rate limit header is deprecated and no longer returned."
},
"x-amzn-RequestId": {
"type": "string",
"description": "Unique request reference id."
}
}
}
}
}
}
},
"definitions": {
"GetOrderMetricsResponse": {
"type": "object",
"properties": {
"payload": {
"description": "The payload for the getOrderMetrics operation.",
"$ref": "#/definitions/OrderMetricsList"
},
"errors": {
"description": "Encountered errors for the getOrderMetrics operation.",
"$ref": "#/definitions/ErrorList"
}
},
"description": "The response schema for the getOrderMetrics operation."
},
"OrderMetricsList": {
"type": "array",
"description": "A set of order metrics, each scoped to a particular time interval.",
"items": {
"$ref": "#/definitions/OrderMetricsInterval"
}
},
"OrderMetricsInterval": {
"type": "object",
"required": [
"averageUnitPrice",
"interval",
"orderCount",
"orderItemCount",
"totalSales",
"unitCount"
],
"properties": {
"interval": {
"type": "string",
"description": "The interval of time based on requested granularity (ex. Hour, Day, etc.) If this is the first or the last interval from the list, it might contain incomplete data if the requested interval doesn't align with the requested granularity (ex. request interval 2018-09-01T02:00:00Z--2018-09-04T19:00:00Z and granularity day will result in Sept 1st UTC day and Sept 4th UTC days having partial data)."
},
"unitCount": {
"type": "integer",
"description": "The number of units in orders based on the specified filters."
},
"orderItemCount": {
"type": "integer",
"description": "The number of order items based on the specified filters."
},
"orderCount": {
"type": "integer",
"description": "The number of orders based on the specified filters."
},
"averageUnitPrice": {
"description": "The average price for an item based on the specified filters. Formula is totalSales/unitCount.",
"$ref": "#/definitions/Money"
},
"totalSales": {
"description": "The total ordered product sales for all orders based on the specified filters.",
"$ref": "#/definitions/Money"
}
},
"description": "Contains order metrics."
},
"Error": {
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"description": "An error code that identifies the type of error that occured."
},
"message": {
"type": "string",
"description": "A message that describes the error condition in a human-readable form."
},
"details": {
"type": "string",
"description": "Additional details that can help the caller understand or fix the issue."
}
},
"description": "Error response returned when the request is unsuccessful."
},
"ErrorList": {
"type": "array",
"description": "A list of error responses returned when a request is unsuccessful.",
"items": {
"$ref": "#/definitions/Error"
}
},
"Money": {
"type": "object",
"required": [
"amount",
"currencyCode"
],
"properties": {
"currencyCode": {
"type": "string",
"description": "Three-digit currency code. In ISO 4217 format."
},
"amount": {
"description": "The currency amount.",
"$ref": "#/definitions/Decimal"
}
},
"description": "The currency type and the amount."
},
"Decimal": {
"type": "string",
"description": "A decimal number with no loss of precision. Useful when precision loss is unnaceptable, as with currencies. Follows RFC7159 for number representation."
}
}
}