@sp-api-sdk/orders-api-v0 1.8.6 → 1.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools.
|
|
4
4
|
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Learn more about this Selling Partner API by visiting the [official documentation](https://github.com/amzn/selling-partner-api-docs/tree/main/references/orders-api/ordersV0.md).
|
|
8
|
+
|
|
9
|
+
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_orders_api_v0.html) for this API client.
|
|
10
|
+
|
|
5
11
|
## Installing
|
|
6
12
|
|
|
7
13
|
```sh
|
|
@@ -19,26 +25,25 @@ import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
|
19
25
|
import {OrdersApiClient} from '@sp-api-sdk/orders-api-v0'
|
|
20
26
|
|
|
21
27
|
const auth = new SellingPartnerApiAuth({
|
|
22
|
-
clientId:
|
|
23
|
-
clientSecret:
|
|
24
|
-
refreshToken: '',
|
|
25
|
-
secretAccessKey: '',
|
|
28
|
+
clientId: process.env.LWA_CLIENT_ID,
|
|
29
|
+
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
30
|
+
refreshToken: 'Atzr|…',
|
|
26
31
|
accessKeyId: '',
|
|
27
|
-
|
|
32
|
+
secretAccessKey: '',
|
|
28
33
|
role: {
|
|
29
|
-
arn: '',
|
|
30
|
-
}
|
|
34
|
+
arn: 'arn:aws:iam::…',
|
|
35
|
+
},
|
|
31
36
|
})
|
|
32
37
|
|
|
33
38
|
const client = new OrdersApiClient({
|
|
34
39
|
auth,
|
|
35
|
-
region: 'eu'
|
|
40
|
+
region: 'eu',
|
|
36
41
|
})
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
##
|
|
44
|
+
## Rate Limiting
|
|
40
45
|
|
|
41
|
-
|
|
46
|
+
In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
|
|
42
47
|
|
|
43
48
|
```javascript
|
|
44
49
|
const client = new OrdersApiClient({
|
|
@@ -46,13 +51,28 @@ const client = new OrdersApiClient({
|
|
|
46
51
|
region: 'eu',
|
|
47
52
|
rateLimiting: {
|
|
48
53
|
retry: true,
|
|
49
|
-
|
|
50
|
-
|
|
54
|
+
// Optionally specify a callback that will be called on every retry.
|
|
55
|
+
onRetry: (retryInfo) => {
|
|
56
|
+
console.log(retryInfo)
|
|
57
|
+
},
|
|
58
|
+
},
|
|
51
59
|
})
|
|
52
60
|
```
|
|
53
61
|
|
|
54
|
-
The
|
|
62
|
+
The rate limits used for each route are specified in the [API documentation]((https://github.com/amzn/selling-partner-api-docs/tree/main/references/orders-api/ordersV0.md)).
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
MIT
|
|
55
67
|
|
|
56
|
-
##
|
|
68
|
+
## Miscellaneous
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
```
|
|
71
|
+
╚⊙ ⊙╝
|
|
72
|
+
╚═(███)═╝
|
|
73
|
+
╚═(███)═╝
|
|
74
|
+
╚═(███)═╝
|
|
75
|
+
╚═(███)═╝
|
|
76
|
+
╚═(███)═╝
|
|
77
|
+
╚═(███)═╝
|
|
78
|
+
```
|
|
@@ -416,7 +416,7 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
416
416
|
* @throws {RequiredError}
|
|
417
417
|
* @memberof OrdersV0Api
|
|
418
418
|
*/
|
|
419
|
-
getOrder(requestParameters: OrdersV0ApiGetOrderRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderResponse>>;
|
|
419
|
+
getOrder(requestParameters: OrdersV0ApiGetOrderRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderResponse, any>>;
|
|
420
420
|
/**
|
|
421
421
|
* Returns the shipping address for the specified order. **Important.** We recommend using the getOrders operation to get shipping address information for an order, as the getOrderAddress operation is scheduled for deprecation on January 12, 2022. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/tokens-api-use-case-guide/tokens-API-use-case-guide-2021-03-01.md). **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 0.0055 | 20 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
422
422
|
* @param {OrdersV0ApiGetOrderAddressRequest} requestParameters Request parameters.
|
|
@@ -424,7 +424,7 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
424
424
|
* @throws {RequiredError}
|
|
425
425
|
* @memberof OrdersV0Api
|
|
426
426
|
*/
|
|
427
|
-
getOrderAddress(requestParameters: OrdersV0ApiGetOrderAddressRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderAddressResponse>>;
|
|
427
|
+
getOrderAddress(requestParameters: OrdersV0ApiGetOrderAddressRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderAddressResponse, any>>;
|
|
428
428
|
/**
|
|
429
429
|
* Returns buyer information for the specified order. **Important.** We recommend using the getOrders operation to get buyer information for an order, as the getOrderBuyerInfo operation is scheduled for deprecation on January 12, 2022. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/tokens-api-use-case-guide/tokens-API-use-case-guide-2021-03-01.md). **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 0.0055 | 20 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
430
430
|
* @param {OrdersV0ApiGetOrderBuyerInfoRequest} requestParameters Request parameters.
|
|
@@ -432,7 +432,7 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
432
432
|
* @throws {RequiredError}
|
|
433
433
|
* @memberof OrdersV0Api
|
|
434
434
|
*/
|
|
435
|
-
getOrderBuyerInfo(requestParameters: OrdersV0ApiGetOrderBuyerInfoRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderBuyerInfoResponse>>;
|
|
435
|
+
getOrderBuyerInfo(requestParameters: OrdersV0ApiGetOrderBuyerInfoRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderBuyerInfoResponse, any>>;
|
|
436
436
|
/**
|
|
437
437
|
* Returns detailed order item information for the order indicated by the specified order ID. If NextToken is provided, it\'s used to retrieve the next page of order items. Note: When an order is in the Pending state (the order has been placed but payment has not been authorized), the getOrderItems operation does not return information about pricing, taxes, shipping charges, gift status or promotions for the order items in the order. After an order leaves the Pending state (this occurs when payment has been authorized) and enters the Unshipped, Partially Shipped, or Shipped state, the getOrderItems operation returns information about pricing, taxes, shipping charges, gift status and promotions for the order items in the order. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 0.0055 | 20 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
438
438
|
* @param {OrdersV0ApiGetOrderItemsRequest} requestParameters Request parameters.
|
|
@@ -440,7 +440,7 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
440
440
|
* @throws {RequiredError}
|
|
441
441
|
* @memberof OrdersV0Api
|
|
442
442
|
*/
|
|
443
|
-
getOrderItems(requestParameters: OrdersV0ApiGetOrderItemsRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderItemsResponse>>;
|
|
443
|
+
getOrderItems(requestParameters: OrdersV0ApiGetOrderItemsRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderItemsResponse, any>>;
|
|
444
444
|
/**
|
|
445
445
|
* Returns buyer information for the order items in the specified order. **Important.** We recommend using the getOrderItems operation to get buyer information for the order items in an order, as the getOrderItemsBuyerInfo operation is scheduled for deprecation on January 12, 2022. For more information, see the [Tokens API Use Case Guide](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/tokens-api-use-case-guide/tokens-API-use-case-guide-2021-03-01.md). **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 0.0055 | 20 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
446
446
|
* @param {OrdersV0ApiGetOrderItemsBuyerInfoRequest} requestParameters Request parameters.
|
|
@@ -448,7 +448,7 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
448
448
|
* @throws {RequiredError}
|
|
449
449
|
* @memberof OrdersV0Api
|
|
450
450
|
*/
|
|
451
|
-
getOrderItemsBuyerInfo(requestParameters: OrdersV0ApiGetOrderItemsBuyerInfoRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderItemsBuyerInfoResponse>>;
|
|
451
|
+
getOrderItemsBuyerInfo(requestParameters: OrdersV0ApiGetOrderItemsBuyerInfoRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrderItemsBuyerInfoResponse, any>>;
|
|
452
452
|
/**
|
|
453
453
|
* Returns orders created or updated during the time frame indicated by the specified parameters. You can also apply a range of filtering criteria to narrow the list of orders returned. If NextToken is present, that will be used to retrieve the orders instead of other criteria. **Usage Plans:** | Plan type | Rate (requests per second) | Burst | | ---- | ---- | ---- | |Default| 0.0055 | 20 | |Selling partner specific| Variable | Variable | The x-amzn-RateLimit-Limit response header returns the usage plan rate limits that were applied to the requested operation. Rate limits for some selling partners will vary from the default rate and burst shown in the table above. For more information, see \"Usage Plans and Rate Limits\" in the Selling Partner API documentation.
|
|
454
454
|
* @param {OrdersV0ApiGetOrdersRequest} requestParameters Request parameters.
|
|
@@ -456,5 +456,5 @@ export declare class OrdersV0Api extends BaseAPI {
|
|
|
456
456
|
* @throws {RequiredError}
|
|
457
457
|
* @memberof OrdersV0Api
|
|
458
458
|
*/
|
|
459
|
-
getOrders(requestParameters: OrdersV0ApiGetOrdersRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrdersResponse>>;
|
|
459
|
+
getOrders(requestParameters: OrdersV0ApiGetOrdersRequest, options?: any): Promise<import("axios").AxiosResponse<GetOrdersResponse, any>>;
|
|
460
460
|
}
|
|
@@ -62,4 +62,4 @@ export declare const toPathString: (url: URL) => string;
|
|
|
62
62
|
*
|
|
63
63
|
* @export
|
|
64
64
|
*/
|
|
65
|
-
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any>>;
|
|
65
|
+
export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration | undefined) => (axios?: AxiosInstance, basePath?: string) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { ClientConfiguration, RateLimit } from '@sp-api-sdk/common';
|
|
1
|
+
import type { ClientConfiguration, RateLimit, OnRetryHandler } from '@sp-api-sdk/common';
|
|
3
2
|
import { OrdersV0Api } from './api-model';
|
|
4
3
|
export declare const RATE_LIMITS: RateLimit[];
|
|
5
4
|
export interface ClientParameters extends Omit<ClientConfiguration, 'rateLimits' | 'onRetry'> {
|
|
6
5
|
rateLimiting?: {
|
|
7
6
|
retry: boolean;
|
|
8
|
-
onRetry?:
|
|
7
|
+
onRetry?: OnRetryHandler;
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
10
|
export declare class OrdersApiClient extends OrdersV0Api {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sp-api-sdk/orders-api-v0",
|
|
3
3
|
"author": "Vincent Mesquita <vincent.mesquita@bizon.solutions>",
|
|
4
4
|
"description": "The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools.",
|
|
5
|
-
"version": "1.8.
|
|
5
|
+
"version": "1.8.10",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
7
7
|
"module": "dist/es/index.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"test": "NODE_ENV='test' yarn jest"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@sp-api-sdk/auth": "^1.9.
|
|
29
|
-
"@sp-api-sdk/common": "^1.7.
|
|
30
|
-
"axios": "^0.
|
|
28
|
+
"@sp-api-sdk/auth": "^1.9.5",
|
|
29
|
+
"@sp-api-sdk/common": "^1.7.7",
|
|
30
|
+
"axios": "^0.24.0"
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"sp sdk",
|
|
49
49
|
"orders api"
|
|
50
50
|
],
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e8c21d7d481263e8a6663ee11f6708d4dc6968b6"
|
|
52
52
|
}
|