@sp-api-sdk/orders-api-2026-01-01 0.0.0 → 1.1.0
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/LICENSE +21 -0
- package/README.md +105 -0
- package/dist/cjs/api-model/api/orders-api.js +266 -0
- package/dist/cjs/api-model/api.js +30 -0
- package/dist/cjs/api-model/base.js +52 -0
- package/dist/cjs/api-model/common.js +122 -0
- package/dist/cjs/api-model/configuration.js +98 -0
- package/dist/cjs/api-model/index.js +32 -0
- package/dist/cjs/api-model/models/address-extended-fields.js +15 -0
- package/dist/cjs/api-model/models/alias.js +15 -0
- package/dist/cjs/api-model/models/associated-order.js +15 -0
- package/dist/cjs/api-model/models/business-hour.js +25 -0
- package/dist/cjs/api-model/models/buyer.js +15 -0
- package/dist/cjs/api-model/models/constraint-type.js +22 -0
- package/dist/cjs/api-model/models/customer-address.js +15 -0
- package/dist/cjs/api-model/models/date-time-range.js +15 -0
- package/dist/cjs/api-model/models/delivery-preference.js +15 -0
- package/dist/cjs/api-model/models/error-list.js +15 -0
- package/dist/cjs/api-model/models/exception-date.js +20 -0
- package/dist/cjs/api-model/models/fulfillment-status.js +28 -0
- package/dist/cjs/api-model/models/get-order-response.js +15 -0
- package/dist/cjs/api-model/models/gift-option.js +15 -0
- package/dist/cjs/api-model/models/hour-minute.js +15 -0
- package/dist/cjs/api-model/models/index.js +70 -0
- package/dist/cjs/api-model/models/item-cancellation-request.js +15 -0
- package/dist/cjs/api-model/models/item-cancellation.js +15 -0
- package/dist/cjs/api-model/models/item-condition.js +15 -0
- package/dist/cjs/api-model/models/item-customization.js +15 -0
- package/dist/cjs/api-model/models/item-expense.js +15 -0
- package/dist/cjs/api-model/models/item-fulfillment.js +15 -0
- package/dist/cjs/api-model/models/item-international-shipping.js +15 -0
- package/dist/cjs/api-model/models/item-packing.js +15 -0
- package/dist/cjs/api-model/models/item-picking.js +15 -0
- package/dist/cjs/api-model/models/item-points-cost.js +15 -0
- package/dist/cjs/api-model/models/item-price.js +15 -0
- package/dist/cjs/api-model/models/item-proceeds-breakdown.js +15 -0
- package/dist/cjs/api-model/models/item-proceeds-detailed-breakdown.js +15 -0
- package/dist/cjs/api-model/models/item-proceeds.js +15 -0
- package/dist/cjs/api-model/models/item-product.js +15 -0
- package/dist/cjs/api-model/models/item-promotion-breakdown.js +15 -0
- package/dist/cjs/api-model/models/item-promotion.js +15 -0
- package/dist/cjs/api-model/models/item-shipping-constraints.js +15 -0
- package/dist/cjs/api-model/models/item-shipping.js +15 -0
- package/dist/cjs/api-model/models/item-substitution-option.js +15 -0
- package/dist/cjs/api-model/models/item-substitution-preference.js +21 -0
- package/dist/cjs/api-model/models/measurement.js +42 -0
- package/dist/cjs/api-model/models/merchant-address.js +15 -0
- package/dist/cjs/api-model/models/model-error.js +15 -0
- package/dist/cjs/api-model/models/money.js +15 -0
- package/dist/cjs/api-model/models/order-fulfillment.js +15 -0
- package/dist/cjs/api-model/models/order-item.js +15 -0
- package/dist/cjs/api-model/models/order-package.js +15 -0
- package/dist/cjs/api-model/models/order-proceeds.js +15 -0
- package/dist/cjs/api-model/models/order.js +15 -0
- package/dist/cjs/api-model/models/package-item.js +15 -0
- package/dist/cjs/api-model/models/package-status.js +24 -0
- package/dist/cjs/api-model/models/pagination.js +15 -0
- package/dist/cjs/api-model/models/points-granted.js +15 -0
- package/dist/cjs/api-model/models/preferred-delivery-time.js +15 -0
- package/dist/cjs/api-model/models/recipient.js +15 -0
- package/dist/cjs/api-model/models/sales-channel.js +15 -0
- package/dist/cjs/api-model/models/search-orders-response.js +15 -0
- package/dist/cjs/api-model/models/time-window.js +15 -0
- package/dist/cjs/client.js +13 -0
- package/dist/cjs/index.js +19 -0
- package/dist/es/api-model/api/orders-api.js +256 -0
- package/dist/es/api-model/api.js +14 -0
- package/dist/es/api-model/base.js +44 -0
- package/dist/es/api-model/common.js +109 -0
- package/dist/es/api-model/configuration.js +94 -0
- package/dist/es/api-model/index.js +16 -0
- package/dist/es/api-model/models/address-extended-fields.js +14 -0
- package/dist/es/api-model/models/alias.js +14 -0
- package/dist/es/api-model/models/associated-order.js +14 -0
- package/dist/es/api-model/models/business-hour.js +22 -0
- package/dist/es/api-model/models/buyer.js +14 -0
- package/dist/es/api-model/models/constraint-type.js +19 -0
- package/dist/es/api-model/models/customer-address.js +14 -0
- package/dist/es/api-model/models/date-time-range.js +14 -0
- package/dist/es/api-model/models/delivery-preference.js +14 -0
- package/dist/es/api-model/models/error-list.js +14 -0
- package/dist/es/api-model/models/exception-date.js +17 -0
- package/dist/es/api-model/models/fulfillment-status.js +25 -0
- package/dist/es/api-model/models/get-order-response.js +14 -0
- package/dist/es/api-model/models/gift-option.js +14 -0
- package/dist/es/api-model/models/hour-minute.js +14 -0
- package/dist/es/api-model/models/index.js +54 -0
- package/dist/es/api-model/models/item-cancellation-request.js +14 -0
- package/dist/es/api-model/models/item-cancellation.js +14 -0
- package/dist/es/api-model/models/item-condition.js +14 -0
- package/dist/es/api-model/models/item-customization.js +14 -0
- package/dist/es/api-model/models/item-expense.js +14 -0
- package/dist/es/api-model/models/item-fulfillment.js +14 -0
- package/dist/es/api-model/models/item-international-shipping.js +14 -0
- package/dist/es/api-model/models/item-packing.js +14 -0
- package/dist/es/api-model/models/item-picking.js +14 -0
- package/dist/es/api-model/models/item-points-cost.js +14 -0
- package/dist/es/api-model/models/item-price.js +14 -0
- package/dist/es/api-model/models/item-proceeds-breakdown.js +14 -0
- package/dist/es/api-model/models/item-proceeds-detailed-breakdown.js +14 -0
- package/dist/es/api-model/models/item-proceeds.js +14 -0
- package/dist/es/api-model/models/item-product.js +14 -0
- package/dist/es/api-model/models/item-promotion-breakdown.js +14 -0
- package/dist/es/api-model/models/item-promotion.js +14 -0
- package/dist/es/api-model/models/item-shipping-constraints.js +14 -0
- package/dist/es/api-model/models/item-shipping.js +14 -0
- package/dist/es/api-model/models/item-substitution-option.js +14 -0
- package/dist/es/api-model/models/item-substitution-preference.js +18 -0
- package/dist/es/api-model/models/measurement.js +39 -0
- package/dist/es/api-model/models/merchant-address.js +14 -0
- package/dist/es/api-model/models/model-error.js +14 -0
- package/dist/es/api-model/models/money.js +14 -0
- package/dist/es/api-model/models/order-fulfillment.js +14 -0
- package/dist/es/api-model/models/order-item.js +14 -0
- package/dist/es/api-model/models/order-package.js +14 -0
- package/dist/es/api-model/models/order-proceeds.js +14 -0
- package/dist/es/api-model/models/order.js +14 -0
- package/dist/es/api-model/models/package-item.js +14 -0
- package/dist/es/api-model/models/package-status.js +21 -0
- package/dist/es/api-model/models/pagination.js +14 -0
- package/dist/es/api-model/models/points-granted.js +14 -0
- package/dist/es/api-model/models/preferred-delivery-time.js +14 -0
- package/dist/es/api-model/models/recipient.js +14 -0
- package/dist/es/api-model/models/sales-channel.js +14 -0
- package/dist/es/api-model/models/search-orders-response.js +14 -0
- package/dist/es/api-model/models/time-window.js +14 -0
- package/dist/es/client.js +9 -0
- package/dist/es/index.js +3 -0
- package/dist/types/api-model/api/orders-api.d.ts +208 -0
- package/dist/types/api-model/api.d.ts +12 -0
- package/dist/types/api-model/base.d.ts +42 -0
- package/dist/types/api-model/common.d.ts +34 -0
- package/dist/types/api-model/configuration.d.ts +98 -0
- package/dist/types/api-model/index.d.ts +14 -0
- package/dist/types/api-model/models/address-extended-fields.d.ts +32 -0
- package/dist/types/api-model/models/alias.d.ts +24 -0
- package/dist/types/api-model/models/associated-order.d.ts +24 -0
- package/dist/types/api-model/models/business-hour.d.ts +35 -0
- package/dist/types/api-model/models/buyer.d.ts +32 -0
- package/dist/types/api-model/models/constraint-type.d.ts +18 -0
- package/dist/types/api-model/models/customer-address.d.ts +70 -0
- package/dist/types/api-model/models/date-time-range.d.ts +24 -0
- package/dist/types/api-model/models/delivery-preference.d.ts +30 -0
- package/dist/types/api-model/models/error-list.d.ts +20 -0
- package/dist/types/api-model/models/exception-date.d.ts +34 -0
- package/dist/types/api-model/models/fulfillment-status.d.ts +24 -0
- package/dist/types/api-model/models/get-order-response.d.ts +18 -0
- package/dist/types/api-model/models/gift-option.d.ts +24 -0
- package/dist/types/api-model/models/hour-minute.d.ts +24 -0
- package/dist/types/api-model/models/index.d.ts +54 -0
- package/dist/types/api-model/models/item-cancellation-request.d.ts +24 -0
- package/dist/types/api-model/models/item-cancellation.d.ts +18 -0
- package/dist/types/api-model/models/item-condition.d.ts +28 -0
- package/dist/types/api-model/models/item-customization.d.ts +20 -0
- package/dist/types/api-model/models/item-expense.d.ts +18 -0
- package/dist/types/api-model/models/item-fulfillment.d.ts +30 -0
- package/dist/types/api-model/models/item-international-shipping.d.ts +20 -0
- package/dist/types/api-model/models/item-packing.d.ts +18 -0
- package/dist/types/api-model/models/item-picking.d.ts +18 -0
- package/dist/types/api-model/models/item-points-cost.d.ts +18 -0
- package/dist/types/api-model/models/item-price.d.ts +22 -0
- package/dist/types/api-model/models/item-proceeds-breakdown.d.ts +27 -0
- package/dist/types/api-model/models/item-proceeds-detailed-breakdown.d.ts +22 -0
- package/dist/types/api-model/models/item-proceeds.d.ts +23 -0
- package/dist/types/api-model/models/item-product.d.ts +38 -0
- package/dist/types/api-model/models/item-promotion-breakdown.d.ts +20 -0
- package/dist/types/api-model/models/item-promotion.d.ts +21 -0
- package/dist/types/api-model/models/item-shipping-constraints.d.ts +22 -0
- package/dist/types/api-model/models/item-shipping.d.ts +22 -0
- package/dist/types/api-model/models/item-substitution-option.d.ts +34 -0
- package/dist/types/api-model/models/item-substitution-preference.d.ts +31 -0
- package/dist/types/api-model/models/measurement.d.ts +51 -0
- package/dist/types/api-model/models/merchant-address.d.ts +56 -0
- package/dist/types/api-model/models/model-error.d.ts +28 -0
- package/dist/types/api-model/models/money.d.ts +24 -0
- package/dist/types/api-model/models/order-fulfillment.d.ts +29 -0
- package/dist/types/api-model/models/order-item.d.ts +42 -0
- package/dist/types/api-model/models/order-package.d.ts +49 -0
- package/dist/types/api-model/models/order-proceeds.d.ts +18 -0
- package/dist/types/api-model/models/order.d.ts +62 -0
- package/dist/types/api-model/models/package-item.d.ts +28 -0
- package/dist/types/api-model/models/package-status.d.ts +33 -0
- package/dist/types/api-model/models/pagination.d.ts +20 -0
- package/dist/types/api-model/models/points-granted.d.ts +22 -0
- package/dist/types/api-model/models/preferred-delivery-time.d.ts +26 -0
- package/dist/types/api-model/models/recipient.d.ts +20 -0
- package/dist/types/api-model/models/sales-channel.d.ts +28 -0
- package/dist/types/api-model/models/search-orders-response.d.ts +31 -0
- package/dist/types/api-model/models/time-window.d.ts +19 -0
- package/dist/types/client.d.ts +6 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +32 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Bizon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# `orders-api-2026-01-01`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@sp-api-sdk/orders-api-2026-01-01)
|
|
4
|
+
[](https://github.com/xojs/xo)
|
|
5
|
+
|
|
6
|
+
The Selling Partner API for Orders returns orders information. This API supports the following types of orders:
|
|
7
|
+
|
|
8
|
+
- FBM (Fulfilled by Merchant)
|
|
9
|
+
- FBA (Fulfilled by Amazon) - read only
|
|
10
|
+
- Amazon Fresh
|
|
11
|
+
|
|
12
|
+
This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.
|
|
13
|
+
|
|
14
|
+
[<img src="https://files.bizon.solutions/images/logo/bizon-horizontal.png" alt="Bizon" width="250"/>](https://www.bizon.solutions?utm_source=github&utm_medium=readme&utm_campaign=selling-partner-api-sdk)
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
19
|
+
|
|
20
|
+
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp-api-sdk_orders-api-2026-01-01.html) for this API client.
|
|
21
|
+
|
|
22
|
+
## Installing
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npm install @sp-api-sdk/orders-api-2026-01-01
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Getting Started
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
32
|
+
import {OrdersApiClient} from '@sp-api-sdk/orders-api-2026-01-01'
|
|
33
|
+
|
|
34
|
+
const auth = new SellingPartnerApiAuth({
|
|
35
|
+
clientId: process.env.LWA_CLIENT_ID,
|
|
36
|
+
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
37
|
+
refreshToken: 'Atzr|…',
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
const client = new OrdersApiClient({
|
|
41
|
+
auth,
|
|
42
|
+
region: 'eu',
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Rate Limiting
|
|
47
|
+
|
|
48
|
+
In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
const client = new OrdersApiClient({
|
|
52
|
+
auth,
|
|
53
|
+
region: 'eu',
|
|
54
|
+
rateLimiting: {
|
|
55
|
+
retry: true,
|
|
56
|
+
// Optionally specify a callback that will be called on every retry.
|
|
57
|
+
onRetry: (retryInfo) => {
|
|
58
|
+
console.log(retryInfo)
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
65
|
+
|
|
66
|
+
## Logging
|
|
67
|
+
|
|
68
|
+
You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
const client = new OrdersApiClient({
|
|
72
|
+
auth,
|
|
73
|
+
region: 'eu',
|
|
74
|
+
logging: {
|
|
75
|
+
request: {
|
|
76
|
+
logger: console.debug
|
|
77
|
+
},
|
|
78
|
+
response: {
|
|
79
|
+
logger: console.debug
|
|
80
|
+
},
|
|
81
|
+
error: true,
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Specifying `true` will use the default options, specifying an object will allow you to override the default options.
|
|
87
|
+
This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
|
|
88
|
+
By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
|
94
|
+
|
|
95
|
+
## Miscellaneous
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
╚⊙ ⊙╝
|
|
99
|
+
╚═(███)═╝
|
|
100
|
+
╚═(███)═╝
|
|
101
|
+
╚═(███)═╝
|
|
102
|
+
╚═(███)═╝
|
|
103
|
+
╚═(███)═╝
|
|
104
|
+
╚═(███)═╝
|
|
105
|
+
```
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Orders
|
|
6
|
+
* The Selling Partner API for Orders returns orders information. This API supports the following types of orders: - FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.SearchOrdersIncludedDataEnum = exports.SearchOrdersFulfilledByEnum = exports.SearchOrdersFulfillmentStatusesEnum = exports.GetOrderIncludedDataEnum = exports.OrdersApi = exports.OrdersApiFactory = exports.OrdersApiFp = exports.OrdersApiAxiosParamCreator = void 0;
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
// Some imports not used depending on template conditions
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
const common_1 = require("../common");
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const base_1 = require("../base");
|
|
26
|
+
/**
|
|
27
|
+
* OrdersApi - axios parameter creator
|
|
28
|
+
*/
|
|
29
|
+
const OrdersApiAxiosParamCreator = function (configuration) {
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
* Returns the order that you specify.
|
|
33
|
+
* @param {string} orderId An Amazon-defined order identifier.
|
|
34
|
+
* @param {Array<GetOrderIncludedDataEnum>} [includedData] A list of datasets to include in the response.
|
|
35
|
+
* @param {*} [options] Override http request option.
|
|
36
|
+
* @throws {RequiredError}
|
|
37
|
+
*/
|
|
38
|
+
getOrder: async (orderId, includedData, options = {}) => {
|
|
39
|
+
// verify required parameter 'orderId' is not null or undefined
|
|
40
|
+
(0, common_1.assertParamExists)('getOrder', 'orderId', orderId);
|
|
41
|
+
const localVarPath = `/orders/2026-01-01/orders/{orderId}`
|
|
42
|
+
.replace(`{${"orderId"}}`, encodeURIComponent(String(orderId)));
|
|
43
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
44
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
45
|
+
let baseOptions;
|
|
46
|
+
if (configuration) {
|
|
47
|
+
baseOptions = configuration.baseOptions;
|
|
48
|
+
}
|
|
49
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
50
|
+
const localVarHeaderParameter = {};
|
|
51
|
+
const localVarQueryParameter = {};
|
|
52
|
+
if (includedData) {
|
|
53
|
+
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
|
|
54
|
+
}
|
|
55
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
56
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
57
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
58
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
59
|
+
return {
|
|
60
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
61
|
+
options: localVarRequestOptions,
|
|
62
|
+
};
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Returns orders that are created or updated during the time period that you specify. You can filter the response for specific types of orders.
|
|
66
|
+
* @param {string} [createdAfter] The response includes orders created at or after this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter` in your request. If `createdAfter` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided.
|
|
67
|
+
* @param {string} [createdBefore] The response includes orders created at or before this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `createdAfter` in the request, `createdBefore` is optional, and if provided must be equal to or after the `createdAfter` date and at least two minutes before the time of the request. If `createdBefore` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided.
|
|
68
|
+
* @param {string} [lastUpdatedAfter] The response includes orders updated at or after this time. An update is defined as any change made by Amazon or by the seller, including an update to the order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter`. If `lastUpdatedAfter` is provided, neither `createdAfter` nor `createdBefore` may be provided.
|
|
69
|
+
* @param {string} [lastUpdatedBefore] The response includes orders updated at or before this time. An update is defined as any change made by Amazon or by the seller, including an update to the order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `lastUpdatedAfter` in the request, `lastUpdatedBefore` is optional, and if provided must be equal to or after the `lastUpdatedAfter` date and at least two minutes before the time of the request. If `lastUpdatedBefore` is provided, neither `createdAfter` nor `createdBefore` may be provided.
|
|
70
|
+
* @param {Array<SearchOrdersFulfillmentStatusesEnum>} [fulfillmentStatuses] A list of `FulfillmentStatus` values you can use to filter the results.
|
|
71
|
+
* @param {Array<string>} [marketplaceIds] The response includes orders that were placed in marketplaces you include in this list. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values.
|
|
72
|
+
* @param {Array<SearchOrdersFulfilledByEnum>} [fulfilledBy] The response includes orders that are fulfilled by the parties that you include in this list.
|
|
73
|
+
* @param {number} [maxResultsPerPage] The maximum number of orders that can be returned per page. The value must be between 1 and 100. **Default:** 100.
|
|
74
|
+
* @param {string} [paginationToken] Pagination occurs when a request produces a response that exceeds the `maxResultsPerPage`. This means that the response is divided into individual pages. To retrieve the next page, you must pass the `nextToken` value as the `paginationToken` query parameter in the next request. You will not receive a `nextToken` value on the last page.
|
|
75
|
+
* @param {Array<SearchOrdersIncludedDataEnum>} [includedData] A list of datasets to include in the response.
|
|
76
|
+
* @param {*} [options] Override http request option.
|
|
77
|
+
* @throws {RequiredError}
|
|
78
|
+
*/
|
|
79
|
+
searchOrders: async (createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, fulfillmentStatuses, marketplaceIds, fulfilledBy, maxResultsPerPage, paginationToken, includedData, options = {}) => {
|
|
80
|
+
const localVarPath = `/orders/2026-01-01/orders`;
|
|
81
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
82
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
83
|
+
let baseOptions;
|
|
84
|
+
if (configuration) {
|
|
85
|
+
baseOptions = configuration.baseOptions;
|
|
86
|
+
}
|
|
87
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
88
|
+
const localVarHeaderParameter = {};
|
|
89
|
+
const localVarQueryParameter = {};
|
|
90
|
+
if (createdAfter !== undefined) {
|
|
91
|
+
localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
|
|
92
|
+
createdAfter.toISOString() :
|
|
93
|
+
createdAfter;
|
|
94
|
+
}
|
|
95
|
+
if (createdBefore !== undefined) {
|
|
96
|
+
localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
|
|
97
|
+
createdBefore.toISOString() :
|
|
98
|
+
createdBefore;
|
|
99
|
+
}
|
|
100
|
+
if (lastUpdatedAfter !== undefined) {
|
|
101
|
+
localVarQueryParameter['lastUpdatedAfter'] = (lastUpdatedAfter instanceof Date) ?
|
|
102
|
+
lastUpdatedAfter.toISOString() :
|
|
103
|
+
lastUpdatedAfter;
|
|
104
|
+
}
|
|
105
|
+
if (lastUpdatedBefore !== undefined) {
|
|
106
|
+
localVarQueryParameter['lastUpdatedBefore'] = (lastUpdatedBefore instanceof Date) ?
|
|
107
|
+
lastUpdatedBefore.toISOString() :
|
|
108
|
+
lastUpdatedBefore;
|
|
109
|
+
}
|
|
110
|
+
if (fulfillmentStatuses) {
|
|
111
|
+
localVarQueryParameter['fulfillmentStatuses'] = fulfillmentStatuses.join(base_1.COLLECTION_FORMATS.csv);
|
|
112
|
+
}
|
|
113
|
+
if (marketplaceIds) {
|
|
114
|
+
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
|
|
115
|
+
}
|
|
116
|
+
if (fulfilledBy) {
|
|
117
|
+
localVarQueryParameter['fulfilledBy'] = fulfilledBy.join(base_1.COLLECTION_FORMATS.csv);
|
|
118
|
+
}
|
|
119
|
+
if (maxResultsPerPage !== undefined) {
|
|
120
|
+
localVarQueryParameter['maxResultsPerPage'] = maxResultsPerPage;
|
|
121
|
+
}
|
|
122
|
+
if (paginationToken !== undefined) {
|
|
123
|
+
localVarQueryParameter['paginationToken'] = paginationToken;
|
|
124
|
+
}
|
|
125
|
+
if (includedData) {
|
|
126
|
+
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
|
|
127
|
+
}
|
|
128
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
129
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
130
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
131
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
132
|
+
return {
|
|
133
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
134
|
+
options: localVarRequestOptions,
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
exports.OrdersApiAxiosParamCreator = OrdersApiAxiosParamCreator;
|
|
140
|
+
/**
|
|
141
|
+
* OrdersApi - functional programming interface
|
|
142
|
+
*/
|
|
143
|
+
const OrdersApiFp = function (configuration) {
|
|
144
|
+
const localVarAxiosParamCreator = (0, exports.OrdersApiAxiosParamCreator)(configuration);
|
|
145
|
+
return {
|
|
146
|
+
/**
|
|
147
|
+
* Returns the order that you specify.
|
|
148
|
+
* @param {string} orderId An Amazon-defined order identifier.
|
|
149
|
+
* @param {Array<GetOrderIncludedDataEnum>} [includedData] A list of datasets to include in the response.
|
|
150
|
+
* @param {*} [options] Override http request option.
|
|
151
|
+
* @throws {RequiredError}
|
|
152
|
+
*/
|
|
153
|
+
async getOrder(orderId, includedData, options) {
|
|
154
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getOrder(orderId, includedData, options);
|
|
155
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
156
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['OrdersApi.getOrder']?.[localVarOperationServerIndex]?.url;
|
|
157
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Returns orders that are created or updated during the time period that you specify. You can filter the response for specific types of orders.
|
|
161
|
+
* @param {string} [createdAfter] The response includes orders created at or after this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter` in your request. If `createdAfter` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided.
|
|
162
|
+
* @param {string} [createdBefore] The response includes orders created at or before this time. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `createdAfter` in the request, `createdBefore` is optional, and if provided must be equal to or after the `createdAfter` date and at least two minutes before the time of the request. If `createdBefore` is provided, neither `lastUpdatedAfter` nor `lastUpdatedBefore` may be provided.
|
|
163
|
+
* @param {string} [lastUpdatedAfter] The response includes orders updated at or after this time. An update is defined as any change made by Amazon or by the seller, including an update to the order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: You must provide exactly one of `createdAfter` and `lastUpdatedAfter`. If `lastUpdatedAfter` is provided, neither `createdAfter` nor `createdBefore` may be provided.
|
|
164
|
+
* @param {string} [lastUpdatedBefore] The response includes orders updated at or before this time. An update is defined as any change made by Amazon or by the seller, including an update to the order status. The date must be in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) format. **Note**: If you include `lastUpdatedAfter` in the request, `lastUpdatedBefore` is optional, and if provided must be equal to or after the `lastUpdatedAfter` date and at least two minutes before the time of the request. If `lastUpdatedBefore` is provided, neither `createdAfter` nor `createdBefore` may be provided.
|
|
165
|
+
* @param {Array<SearchOrdersFulfillmentStatusesEnum>} [fulfillmentStatuses] A list of `FulfillmentStatus` values you can use to filter the results.
|
|
166
|
+
* @param {Array<string>} [marketplaceIds] The response includes orders that were placed in marketplaces you include in this list. Refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids) for a complete list of `marketplaceId` values.
|
|
167
|
+
* @param {Array<SearchOrdersFulfilledByEnum>} [fulfilledBy] The response includes orders that are fulfilled by the parties that you include in this list.
|
|
168
|
+
* @param {number} [maxResultsPerPage] The maximum number of orders that can be returned per page. The value must be between 1 and 100. **Default:** 100.
|
|
169
|
+
* @param {string} [paginationToken] Pagination occurs when a request produces a response that exceeds the `maxResultsPerPage`. This means that the response is divided into individual pages. To retrieve the next page, you must pass the `nextToken` value as the `paginationToken` query parameter in the next request. You will not receive a `nextToken` value on the last page.
|
|
170
|
+
* @param {Array<SearchOrdersIncludedDataEnum>} [includedData] A list of datasets to include in the response.
|
|
171
|
+
* @param {*} [options] Override http request option.
|
|
172
|
+
* @throws {RequiredError}
|
|
173
|
+
*/
|
|
174
|
+
async searchOrders(createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, fulfillmentStatuses, marketplaceIds, fulfilledBy, maxResultsPerPage, paginationToken, includedData, options) {
|
|
175
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.searchOrders(createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, fulfillmentStatuses, marketplaceIds, fulfilledBy, maxResultsPerPage, paginationToken, includedData, options);
|
|
176
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
177
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['OrdersApi.searchOrders']?.[localVarOperationServerIndex]?.url;
|
|
178
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
exports.OrdersApiFp = OrdersApiFp;
|
|
183
|
+
/**
|
|
184
|
+
* OrdersApi - factory interface
|
|
185
|
+
*/
|
|
186
|
+
const OrdersApiFactory = function (configuration, basePath, axios) {
|
|
187
|
+
const localVarFp = (0, exports.OrdersApiFp)(configuration);
|
|
188
|
+
return {
|
|
189
|
+
/**
|
|
190
|
+
* Returns the order that you specify.
|
|
191
|
+
* @param {OrdersApiGetOrderRequest} requestParameters Request parameters.
|
|
192
|
+
* @param {*} [options] Override http request option.
|
|
193
|
+
* @throws {RequiredError}
|
|
194
|
+
*/
|
|
195
|
+
getOrder(requestParameters, options) {
|
|
196
|
+
return localVarFp.getOrder(requestParameters.orderId, requestParameters.includedData, options).then((request) => request(axios, basePath));
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* Returns orders that are created or updated during the time period that you specify. You can filter the response for specific types of orders.
|
|
200
|
+
* @param {OrdersApiSearchOrdersRequest} requestParameters Request parameters.
|
|
201
|
+
* @param {*} [options] Override http request option.
|
|
202
|
+
* @throws {RequiredError}
|
|
203
|
+
*/
|
|
204
|
+
searchOrders(requestParameters = {}, options) {
|
|
205
|
+
return localVarFp.searchOrders(requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.fulfillmentStatuses, requestParameters.marketplaceIds, requestParameters.fulfilledBy, requestParameters.maxResultsPerPage, requestParameters.paginationToken, requestParameters.includedData, options).then((request) => request(axios, basePath));
|
|
206
|
+
},
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
exports.OrdersApiFactory = OrdersApiFactory;
|
|
210
|
+
/**
|
|
211
|
+
* OrdersApi - object-oriented interface
|
|
212
|
+
*/
|
|
213
|
+
class OrdersApi extends base_1.BaseAPI {
|
|
214
|
+
/**
|
|
215
|
+
* Returns the order that you specify.
|
|
216
|
+
* @param {OrdersApiGetOrderRequest} requestParameters Request parameters.
|
|
217
|
+
* @param {*} [options] Override http request option.
|
|
218
|
+
* @throws {RequiredError}
|
|
219
|
+
*/
|
|
220
|
+
getOrder(requestParameters, options) {
|
|
221
|
+
return (0, exports.OrdersApiFp)(this.configuration).getOrder(requestParameters.orderId, requestParameters.includedData, options).then((request) => request(this.axios, this.basePath));
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Returns orders that are created or updated during the time period that you specify. You can filter the response for specific types of orders.
|
|
225
|
+
* @param {OrdersApiSearchOrdersRequest} requestParameters Request parameters.
|
|
226
|
+
* @param {*} [options] Override http request option.
|
|
227
|
+
* @throws {RequiredError}
|
|
228
|
+
*/
|
|
229
|
+
searchOrders(requestParameters = {}, options) {
|
|
230
|
+
return (0, exports.OrdersApiFp)(this.configuration).searchOrders(requestParameters.createdAfter, requestParameters.createdBefore, requestParameters.lastUpdatedAfter, requestParameters.lastUpdatedBefore, requestParameters.fulfillmentStatuses, requestParameters.marketplaceIds, requestParameters.fulfilledBy, requestParameters.maxResultsPerPage, requestParameters.paginationToken, requestParameters.includedData, options).then((request) => request(this.axios, this.basePath));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
exports.OrdersApi = OrdersApi;
|
|
234
|
+
exports.GetOrderIncludedDataEnum = {
|
|
235
|
+
Buyer: 'BUYER',
|
|
236
|
+
Recipient: 'RECIPIENT',
|
|
237
|
+
Proceeds: 'PROCEEDS',
|
|
238
|
+
Expense: 'EXPENSE',
|
|
239
|
+
Promotion: 'PROMOTION',
|
|
240
|
+
Cancellation: 'CANCELLATION',
|
|
241
|
+
Fulfillment: 'FULFILLMENT',
|
|
242
|
+
Packages: 'PACKAGES'
|
|
243
|
+
};
|
|
244
|
+
exports.SearchOrdersFulfillmentStatusesEnum = {
|
|
245
|
+
PendingAvailability: 'PENDING_AVAILABILITY',
|
|
246
|
+
Pending: 'PENDING',
|
|
247
|
+
Unshipped: 'UNSHIPPED',
|
|
248
|
+
PartiallyShipped: 'PARTIALLY_SHIPPED',
|
|
249
|
+
Shipped: 'SHIPPED',
|
|
250
|
+
Cancelled: 'CANCELLED',
|
|
251
|
+
Unfulfillable: 'UNFULFILLABLE'
|
|
252
|
+
};
|
|
253
|
+
exports.SearchOrdersFulfilledByEnum = {
|
|
254
|
+
Merchant: 'MERCHANT',
|
|
255
|
+
Amazon: 'AMAZON'
|
|
256
|
+
};
|
|
257
|
+
exports.SearchOrdersIncludedDataEnum = {
|
|
258
|
+
Buyer: 'BUYER',
|
|
259
|
+
Recipient: 'RECIPIENT',
|
|
260
|
+
Proceeds: 'PROCEEDS',
|
|
261
|
+
Expense: 'EXPENSE',
|
|
262
|
+
Promotion: 'PROMOTION',
|
|
263
|
+
Cancellation: 'CANCELLATION',
|
|
264
|
+
Fulfillment: 'FULFILLMENT',
|
|
265
|
+
Packages: 'PACKAGES'
|
|
266
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Orders
|
|
6
|
+
* The Selling Partner API for Orders returns orders information. This API supports the following types of orders: - FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
__exportStar(require("./api/orders-api"), exports);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Orders
|
|
6
|
+
* The Selling Partner API for Orders returns orders information. This API supports the following types of orders: - FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
22
|
+
exports.COLLECTION_FORMATS = {
|
|
23
|
+
csv: ",",
|
|
24
|
+
ssv: " ",
|
|
25
|
+
tsv: "\t",
|
|
26
|
+
pipes: "|",
|
|
27
|
+
};
|
|
28
|
+
class BaseAPI {
|
|
29
|
+
basePath;
|
|
30
|
+
axios;
|
|
31
|
+
configuration;
|
|
32
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
33
|
+
this.basePath = basePath;
|
|
34
|
+
this.axios = axios;
|
|
35
|
+
if (configuration) {
|
|
36
|
+
this.configuration = configuration;
|
|
37
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.BaseAPI = BaseAPI;
|
|
42
|
+
;
|
|
43
|
+
class RequiredError extends Error {
|
|
44
|
+
field;
|
|
45
|
+
constructor(field, msg) {
|
|
46
|
+
super(msg);
|
|
47
|
+
this.field = field;
|
|
48
|
+
this.name = "RequiredError";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.RequiredError = RequiredError;
|
|
52
|
+
exports.operationServerMap = {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Orders
|
|
6
|
+
* The Selling Partner API for Orders returns orders information. This API supports the following types of orders: - FBM (Fulfilled by Merchant) - FBA (Fulfilled by Amazon) - read only - Amazon Fresh This API does not display order data that is more than two years old, except in the JP, AU, and SG marketplaces, for which data from 2016 and after is available.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2026-01-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.replaceWithSerializableTypeIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
|
+
const base_1 = require("./base");
|
|
18
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @throws {RequiredError}
|
|
22
|
+
*/
|
|
23
|
+
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
24
|
+
if (paramValue === null || paramValue === undefined) {
|
|
25
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.assertParamExists = assertParamExists;
|
|
29
|
+
const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
30
|
+
if (configuration && configuration.apiKey) {
|
|
31
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
32
|
+
? await configuration.apiKey(keyParamName)
|
|
33
|
+
: await configuration.apiKey;
|
|
34
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.setApiKeyToObject = setApiKeyToObject;
|
|
38
|
+
const setBasicAuthToObject = function (object, configuration) {
|
|
39
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
40
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
44
|
+
const setBearerAuthToObject = async function (object, configuration) {
|
|
45
|
+
if (configuration && configuration.accessToken) {
|
|
46
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
47
|
+
? await configuration.accessToken()
|
|
48
|
+
: await configuration.accessToken;
|
|
49
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
53
|
+
const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
54
|
+
if (configuration && configuration.accessToken) {
|
|
55
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
56
|
+
? await configuration.accessToken(name, scopes)
|
|
57
|
+
: await configuration.accessToken;
|
|
58
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
exports.setOAuthToObject = setOAuthToObject;
|
|
62
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
63
|
+
if (parameter == null)
|
|
64
|
+
return;
|
|
65
|
+
if (typeof parameter === "object") {
|
|
66
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
67
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (urlSearchParams.has(key)) {
|
|
75
|
+
urlSearchParams.append(key, parameter);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
urlSearchParams.set(key, parameter);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const setSearchParams = function (url, ...objects) {
|
|
83
|
+
const searchParams = new URLSearchParams(url.search);
|
|
84
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
85
|
+
url.search = searchParams.toString();
|
|
86
|
+
};
|
|
87
|
+
exports.setSearchParams = setSearchParams;
|
|
88
|
+
/**
|
|
89
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
90
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
91
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
92
|
+
*/
|
|
93
|
+
const replaceWithSerializableTypeIfNeeded = function (key, value) {
|
|
94
|
+
if (value instanceof Set) {
|
|
95
|
+
return Array.from(value);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
exports.replaceWithSerializableTypeIfNeeded = replaceWithSerializableTypeIfNeeded;
|
|
102
|
+
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
103
|
+
const nonString = typeof value !== 'string';
|
|
104
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
105
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
106
|
+
: nonString;
|
|
107
|
+
return needsSerialization
|
|
108
|
+
? JSON.stringify(value !== undefined ? value : {}, exports.replaceWithSerializableTypeIfNeeded)
|
|
109
|
+
: (value || "");
|
|
110
|
+
};
|
|
111
|
+
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
112
|
+
const toPathString = function (url) {
|
|
113
|
+
return url.pathname + url.search + url.hash;
|
|
114
|
+
};
|
|
115
|
+
exports.toPathString = toPathString;
|
|
116
|
+
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
117
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
118
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
119
|
+
return axios.request(axiosRequestArgs);
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
exports.createRequestFunction = createRequestFunction;
|