@sp-api-sdk/easy-ship-api-2022-03-23 4.3.11 → 5.0.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/README.md +4 -4
- package/dist/index.cjs +642 -0
- package/dist/index.cjs.map +1 -0
- package/dist/{types/api-model/api/easy-ship-api.d.ts → index.d.cts} +819 -26
- package/dist/index.d.ts +1027 -0
- package/dist/index.js +594 -0
- package/dist/index.js.map +1 -0
- package/package.json +23 -12
- package/dist/cjs/api-model/api/easy-ship-api.js +0 -361
- package/dist/cjs/api-model/api.js +0 -30
- package/dist/cjs/api-model/base.js +0 -52
- package/dist/cjs/api-model/common.js +0 -123
- package/dist/cjs/api-model/configuration.js +0 -98
- package/dist/cjs/api-model/index.js +0 -32
- package/dist/cjs/api-model/models/code.js +0 -32
- package/dist/cjs/api-model/models/create-scheduled-package-request.js +0 -15
- package/dist/cjs/api-model/models/create-scheduled-packages-request.js +0 -15
- package/dist/cjs/api-model/models/create-scheduled-packages-response.js +0 -15
- package/dist/cjs/api-model/models/dimensions.js +0 -15
- package/dist/cjs/api-model/models/error-list.js +0 -15
- package/dist/cjs/api-model/models/handover-method.js +0 -23
- package/dist/cjs/api-model/models/index.js +0 -43
- package/dist/cjs/api-model/models/invoice-data.js +0 -15
- package/dist/cjs/api-model/models/item.js +0 -15
- package/dist/cjs/api-model/models/label-format.js +0 -23
- package/dist/cjs/api-model/models/list-handover-slots-request.js +0 -15
- package/dist/cjs/api-model/models/list-handover-slots-response.js +0 -15
- package/dist/cjs/api-model/models/model-error.js +0 -15
- package/dist/cjs/api-model/models/order-schedule-details.js +0 -15
- package/dist/cjs/api-model/models/package-details.js +0 -15
- package/dist/cjs/api-model/models/package-status.js +0 -33
- package/dist/cjs/api-model/models/package.js +0 -15
- package/dist/cjs/api-model/models/packages.js +0 -15
- package/dist/cjs/api-model/models/rejected-order.js +0 -15
- package/dist/cjs/api-model/models/scheduled-package-id.js +0 -15
- package/dist/cjs/api-model/models/time-slot.js +0 -15
- package/dist/cjs/api-model/models/tracking-details.js +0 -15
- package/dist/cjs/api-model/models/unit-of-length.js +0 -22
- package/dist/cjs/api-model/models/unit-of-weight.js +0 -23
- package/dist/cjs/api-model/models/update-package-details.js +0 -15
- package/dist/cjs/api-model/models/update-scheduled-packages-request.js +0 -15
- package/dist/cjs/api-model/models/weight.js +0 -15
- package/dist/cjs/client.js +0 -49
- package/dist/cjs/index.js +0 -19
- package/dist/es/api-model/api/easy-ship-api.js +0 -351
- package/dist/es/api-model/api.js +0 -14
- package/dist/es/api-model/base.js +0 -44
- package/dist/es/api-model/common.js +0 -110
- package/dist/es/api-model/configuration.js +0 -94
- package/dist/es/api-model/index.js +0 -16
- package/dist/es/api-model/models/code.js +0 -29
- package/dist/es/api-model/models/create-scheduled-package-request.js +0 -14
- package/dist/es/api-model/models/create-scheduled-packages-request.js +0 -14
- package/dist/es/api-model/models/create-scheduled-packages-response.js +0 -14
- package/dist/es/api-model/models/dimensions.js +0 -14
- package/dist/es/api-model/models/error-list.js +0 -14
- package/dist/es/api-model/models/handover-method.js +0 -20
- package/dist/es/api-model/models/index.js +0 -27
- package/dist/es/api-model/models/invoice-data.js +0 -14
- package/dist/es/api-model/models/item.js +0 -14
- package/dist/es/api-model/models/label-format.js +0 -20
- package/dist/es/api-model/models/list-handover-slots-request.js +0 -14
- package/dist/es/api-model/models/list-handover-slots-response.js +0 -14
- package/dist/es/api-model/models/model-error.js +0 -14
- package/dist/es/api-model/models/order-schedule-details.js +0 -14
- package/dist/es/api-model/models/package-details.js +0 -14
- package/dist/es/api-model/models/package-status.js +0 -30
- package/dist/es/api-model/models/package.js +0 -14
- package/dist/es/api-model/models/packages.js +0 -14
- package/dist/es/api-model/models/rejected-order.js +0 -14
- package/dist/es/api-model/models/scheduled-package-id.js +0 -14
- package/dist/es/api-model/models/time-slot.js +0 -14
- package/dist/es/api-model/models/tracking-details.js +0 -14
- package/dist/es/api-model/models/unit-of-length.js +0 -19
- package/dist/es/api-model/models/unit-of-weight.js +0 -20
- package/dist/es/api-model/models/update-package-details.js +0 -14
- package/dist/es/api-model/models/update-scheduled-packages-request.js +0 -14
- package/dist/es/api-model/models/weight.js +0 -14
- package/dist/es/client.js +0 -45
- package/dist/es/index.js +0 -3
- package/dist/types/api-model/api.d.ts +0 -12
- package/dist/types/api-model/base.d.ts +0 -42
- package/dist/types/api-model/common.d.ts +0 -34
- package/dist/types/api-model/configuration.d.ts +0 -98
- package/dist/types/api-model/index.d.ts +0 -14
- package/dist/types/api-model/models/code.d.ts +0 -28
- package/dist/types/api-model/models/create-scheduled-package-request.d.ts +0 -26
- package/dist/types/api-model/models/create-scheduled-packages-request.d.ts +0 -27
- package/dist/types/api-model/models/create-scheduled-packages-response.d.ts +0 -30
- package/dist/types/api-model/models/dimensions.d.ts +0 -34
- package/dist/types/api-model/models/error-list.d.ts +0 -20
- package/dist/types/api-model/models/handover-method.d.ts +0 -19
- package/dist/types/api-model/models/index.d.ts +0 -27
- package/dist/types/api-model/models/invoice-data.d.ts +0 -24
- package/dist/types/api-model/models/item.d.ts +0 -24
- package/dist/types/api-model/models/label-format.d.ts +0 -19
- package/dist/types/api-model/models/list-handover-slots-request.d.ts +0 -28
- package/dist/types/api-model/models/list-handover-slots-response.d.ts +0 -25
- package/dist/types/api-model/models/model-error.d.ts +0 -28
- package/dist/types/api-model/models/order-schedule-details.d.ts +0 -22
- package/dist/types/api-model/models/package-details.d.ts +0 -27
- package/dist/types/api-model/models/package-status.d.ts +0 -29
- package/dist/types/api-model/models/package.d.ts +0 -39
- package/dist/types/api-model/models/packages.d.ts +0 -21
- package/dist/types/api-model/models/rejected-order.d.ts +0 -21
- package/dist/types/api-model/models/scheduled-package-id.d.ts +0 -24
- package/dist/types/api-model/models/time-slot.d.ts +0 -30
- package/dist/types/api-model/models/tracking-details.d.ts +0 -20
- package/dist/types/api-model/models/unit-of-length.d.ts +0 -18
- package/dist/types/api-model/models/unit-of-weight.d.ts +0 -19
- package/dist/types/api-model/models/update-package-details.d.ts +0 -20
- package/dist/types/api-model/models/update-scheduled-packages-request.d.ts +0 -25
- package/dist/types/api-model/models/weight.d.ts +0 -22
- package/dist/types/client.d.ts +0 -6
- package/dist/types/index.d.ts +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
// src/client.ts
|
|
2
|
+
import { createAxiosInstance } from "@sp-api-sdk/common";
|
|
3
|
+
|
|
4
|
+
// src/api-model/api/easy-ship-api.ts
|
|
5
|
+
import globalAxios2 from "axios";
|
|
6
|
+
|
|
7
|
+
// src/api-model/base.ts
|
|
8
|
+
import globalAxios from "axios";
|
|
9
|
+
var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
10
|
+
var BaseAPI = class {
|
|
11
|
+
constructor(configuration, basePath = BASE_PATH, axios = globalAxios) {
|
|
12
|
+
this.basePath = basePath;
|
|
13
|
+
this.axios = axios;
|
|
14
|
+
if (configuration) {
|
|
15
|
+
this.configuration = configuration;
|
|
16
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
basePath;
|
|
20
|
+
axios;
|
|
21
|
+
configuration;
|
|
22
|
+
};
|
|
23
|
+
var RequiredError = class extends Error {
|
|
24
|
+
constructor(field, msg) {
|
|
25
|
+
super(msg);
|
|
26
|
+
this.field = field;
|
|
27
|
+
this.name = "RequiredError";
|
|
28
|
+
}
|
|
29
|
+
field;
|
|
30
|
+
};
|
|
31
|
+
var operationServerMap = {};
|
|
32
|
+
|
|
33
|
+
// src/api-model/common.ts
|
|
34
|
+
var DUMMY_BASE_URL = "https://example.com";
|
|
35
|
+
var assertParamExists = function(functionName, paramName, paramValue) {
|
|
36
|
+
if (paramValue === null || paramValue === void 0) {
|
|
37
|
+
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
41
|
+
if (parameter == null) return;
|
|
42
|
+
if (typeof parameter === "object") {
|
|
43
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
44
|
+
parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
45
|
+
} else {
|
|
46
|
+
Object.keys(parameter).forEach(
|
|
47
|
+
(currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`)
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
if (urlSearchParams.has(key)) {
|
|
52
|
+
urlSearchParams.append(key, parameter);
|
|
53
|
+
} else {
|
|
54
|
+
urlSearchParams.set(key, parameter);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
var setSearchParams = function(url, ...objects) {
|
|
59
|
+
const searchParams = new URLSearchParams(url.search);
|
|
60
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
61
|
+
url.search = searchParams.toString();
|
|
62
|
+
};
|
|
63
|
+
var replaceWithSerializableTypeIfNeeded = function(key, value) {
|
|
64
|
+
if (value instanceof Set) {
|
|
65
|
+
return Array.from(value);
|
|
66
|
+
} else {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var serializeDataIfNeeded = function(value, requestOptions, configuration) {
|
|
71
|
+
const nonString = typeof value !== "string";
|
|
72
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString;
|
|
73
|
+
return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || "";
|
|
74
|
+
};
|
|
75
|
+
var toPathString = function(url) {
|
|
76
|
+
return url.pathname + url.search + url.hash;
|
|
77
|
+
};
|
|
78
|
+
var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) {
|
|
79
|
+
return (axios = globalAxios3, basePath = BASE_PATH2) => {
|
|
80
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
81
|
+
return axios.request(axiosRequestArgs);
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
// src/api-model/api/easy-ship-api.ts
|
|
86
|
+
var EasyShipApiAxiosParamCreator = function(configuration) {
|
|
87
|
+
return {
|
|
88
|
+
/**
|
|
89
|
+
* Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
90
|
+
* @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
|
|
91
|
+
* @param {*} [options] Override http request option.
|
|
92
|
+
* @throws {RequiredError}
|
|
93
|
+
*/
|
|
94
|
+
createScheduledPackage: async (createScheduledPackageRequest, options = {}) => {
|
|
95
|
+
assertParamExists("createScheduledPackage", "createScheduledPackageRequest", createScheduledPackageRequest);
|
|
96
|
+
const localVarPath = `/easyShip/2022-03-23/package`;
|
|
97
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
98
|
+
let baseOptions;
|
|
99
|
+
if (configuration) {
|
|
100
|
+
baseOptions = configuration.baseOptions;
|
|
101
|
+
}
|
|
102
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
103
|
+
const localVarHeaderParameter = {};
|
|
104
|
+
const localVarQueryParameter = {};
|
|
105
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
106
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
107
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
108
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
109
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
110
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackageRequest, localVarRequestOptions, configuration);
|
|
111
|
+
return {
|
|
112
|
+
url: toPathString(localVarUrlObj),
|
|
113
|
+
options: localVarRequestOptions
|
|
114
|
+
};
|
|
115
|
+
},
|
|
116
|
+
/**
|
|
117
|
+
* This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
118
|
+
* @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
|
|
119
|
+
* @param {*} [options] Override http request option.
|
|
120
|
+
* @throws {RequiredError}
|
|
121
|
+
*/
|
|
122
|
+
createScheduledPackageBulk: async (createScheduledPackagesRequest, options = {}) => {
|
|
123
|
+
assertParamExists("createScheduledPackageBulk", "createScheduledPackagesRequest", createScheduledPackagesRequest);
|
|
124
|
+
const localVarPath = `/easyShip/2022-03-23/packages/bulk`;
|
|
125
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
126
|
+
let baseOptions;
|
|
127
|
+
if (configuration) {
|
|
128
|
+
baseOptions = configuration.baseOptions;
|
|
129
|
+
}
|
|
130
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
131
|
+
const localVarHeaderParameter = {};
|
|
132
|
+
const localVarQueryParameter = {};
|
|
133
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
134
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
135
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
136
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
137
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
138
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createScheduledPackagesRequest, localVarRequestOptions, configuration);
|
|
139
|
+
return {
|
|
140
|
+
url: toPathString(localVarUrlObj),
|
|
141
|
+
options: localVarRequestOptions
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
/**
|
|
145
|
+
* Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
146
|
+
* @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
|
|
147
|
+
* @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
|
|
148
|
+
* @param {*} [options] Override http request option.
|
|
149
|
+
* @throws {RequiredError}
|
|
150
|
+
*/
|
|
151
|
+
getScheduledPackage: async (amazonOrderId, marketplaceId, options = {}) => {
|
|
152
|
+
assertParamExists("getScheduledPackage", "amazonOrderId", amazonOrderId);
|
|
153
|
+
assertParamExists("getScheduledPackage", "marketplaceId", marketplaceId);
|
|
154
|
+
const localVarPath = `/easyShip/2022-03-23/package`;
|
|
155
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
156
|
+
let baseOptions;
|
|
157
|
+
if (configuration) {
|
|
158
|
+
baseOptions = configuration.baseOptions;
|
|
159
|
+
}
|
|
160
|
+
const localVarRequestOptions = { method: "GET", ...baseOptions, ...options };
|
|
161
|
+
const localVarHeaderParameter = {};
|
|
162
|
+
const localVarQueryParameter = {};
|
|
163
|
+
if (amazonOrderId !== void 0) {
|
|
164
|
+
localVarQueryParameter["amazonOrderId"] = amazonOrderId;
|
|
165
|
+
}
|
|
166
|
+
if (marketplaceId !== void 0) {
|
|
167
|
+
localVarQueryParameter["marketplaceId"] = marketplaceId;
|
|
168
|
+
}
|
|
169
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
170
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
171
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
172
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
173
|
+
return {
|
|
174
|
+
url: toPathString(localVarUrlObj),
|
|
175
|
+
options: localVarRequestOptions
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
180
|
+
* @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
|
|
181
|
+
* @param {*} [options] Override http request option.
|
|
182
|
+
* @throws {RequiredError}
|
|
183
|
+
*/
|
|
184
|
+
listHandoverSlots: async (listHandoverSlotsRequest, options = {}) => {
|
|
185
|
+
const localVarPath = `/easyShip/2022-03-23/timeSlot`;
|
|
186
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
187
|
+
let baseOptions;
|
|
188
|
+
if (configuration) {
|
|
189
|
+
baseOptions = configuration.baseOptions;
|
|
190
|
+
}
|
|
191
|
+
const localVarRequestOptions = { method: "POST", ...baseOptions, ...options };
|
|
192
|
+
const localVarHeaderParameter = {};
|
|
193
|
+
const localVarQueryParameter = {};
|
|
194
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
195
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
196
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
197
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
198
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
199
|
+
localVarRequestOptions.data = serializeDataIfNeeded(listHandoverSlotsRequest, localVarRequestOptions, configuration);
|
|
200
|
+
return {
|
|
201
|
+
url: toPathString(localVarUrlObj),
|
|
202
|
+
options: localVarRequestOptions
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
/**
|
|
206
|
+
* Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
207
|
+
* @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
|
|
208
|
+
* @param {*} [options] Override http request option.
|
|
209
|
+
* @throws {RequiredError}
|
|
210
|
+
*/
|
|
211
|
+
updateScheduledPackages: async (updateScheduledPackagesRequest, options = {}) => {
|
|
212
|
+
const localVarPath = `/easyShip/2022-03-23/package`;
|
|
213
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
214
|
+
let baseOptions;
|
|
215
|
+
if (configuration) {
|
|
216
|
+
baseOptions = configuration.baseOptions;
|
|
217
|
+
}
|
|
218
|
+
const localVarRequestOptions = { method: "PATCH", ...baseOptions, ...options };
|
|
219
|
+
const localVarHeaderParameter = {};
|
|
220
|
+
const localVarQueryParameter = {};
|
|
221
|
+
localVarHeaderParameter["Content-Type"] = "application/json";
|
|
222
|
+
localVarHeaderParameter["Accept"] = "application/json";
|
|
223
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
224
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
225
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
226
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateScheduledPackagesRequest, localVarRequestOptions, configuration);
|
|
227
|
+
return {
|
|
228
|
+
url: toPathString(localVarUrlObj),
|
|
229
|
+
options: localVarRequestOptions
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
var EasyShipApiFp = function(configuration) {
|
|
235
|
+
const localVarAxiosParamCreator = EasyShipApiAxiosParamCreator(configuration);
|
|
236
|
+
return {
|
|
237
|
+
/**
|
|
238
|
+
* Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
239
|
+
* @param {CreateScheduledPackageRequest} createScheduledPackageRequest The request schema for the `createScheduledPackage` operation.
|
|
240
|
+
* @param {*} [options] Override http request option.
|
|
241
|
+
* @throws {RequiredError}
|
|
242
|
+
*/
|
|
243
|
+
async createScheduledPackage(createScheduledPackageRequest, options) {
|
|
244
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackage(createScheduledPackageRequest, options);
|
|
245
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
246
|
+
const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackage"]?.[localVarOperationServerIndex]?.url;
|
|
247
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
251
|
+
* @param {CreateScheduledPackagesRequest} createScheduledPackagesRequest The request schema for the `createScheduledPackageBulk` operation.
|
|
252
|
+
* @param {*} [options] Override http request option.
|
|
253
|
+
* @throws {RequiredError}
|
|
254
|
+
*/
|
|
255
|
+
async createScheduledPackageBulk(createScheduledPackagesRequest, options) {
|
|
256
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createScheduledPackageBulk(createScheduledPackagesRequest, options);
|
|
257
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
258
|
+
const localVarOperationServerBasePath = operationServerMap["EasyShipApi.createScheduledPackageBulk"]?.[localVarOperationServerIndex]?.url;
|
|
259
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
260
|
+
},
|
|
261
|
+
/**
|
|
262
|
+
* Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
263
|
+
* @param {string} amazonOrderId An Amazon-defined order identifier. Identifies the order that the seller wants to deliver using Amazon Easy Ship.
|
|
264
|
+
* @param {string} marketplaceId An identifier for the marketplace in which the seller is selling.
|
|
265
|
+
* @param {*} [options] Override http request option.
|
|
266
|
+
* @throws {RequiredError}
|
|
267
|
+
*/
|
|
268
|
+
async getScheduledPackage(amazonOrderId, marketplaceId, options) {
|
|
269
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getScheduledPackage(amazonOrderId, marketplaceId, options);
|
|
270
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
271
|
+
const localVarOperationServerBasePath = operationServerMap["EasyShipApi.getScheduledPackage"]?.[localVarOperationServerIndex]?.url;
|
|
272
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
273
|
+
},
|
|
274
|
+
/**
|
|
275
|
+
* Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
276
|
+
* @param {ListHandoverSlotsRequest} [listHandoverSlotsRequest] The request schema for the `listHandoverSlots` operation.
|
|
277
|
+
* @param {*} [options] Override http request option.
|
|
278
|
+
* @throws {RequiredError}
|
|
279
|
+
*/
|
|
280
|
+
async listHandoverSlots(listHandoverSlotsRequest, options) {
|
|
281
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listHandoverSlots(listHandoverSlotsRequest, options);
|
|
282
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
283
|
+
const localVarOperationServerBasePath = operationServerMap["EasyShipApi.listHandoverSlots"]?.[localVarOperationServerIndex]?.url;
|
|
284
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
288
|
+
* @param {UpdateScheduledPackagesRequest} [updateScheduledPackagesRequest] The request schema for the `updateScheduledPackages` operation.
|
|
289
|
+
* @param {*} [options] Override http request option.
|
|
290
|
+
* @throws {RequiredError}
|
|
291
|
+
*/
|
|
292
|
+
async updateScheduledPackages(updateScheduledPackagesRequest, options) {
|
|
293
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.updateScheduledPackages(updateScheduledPackagesRequest, options);
|
|
294
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
295
|
+
const localVarOperationServerBasePath = operationServerMap["EasyShipApi.updateScheduledPackages"]?.[localVarOperationServerIndex]?.url;
|
|
296
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios2, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
var EasyShipApiFactory = function(configuration, basePath, axios) {
|
|
301
|
+
const localVarFp = EasyShipApiFp(configuration);
|
|
302
|
+
return {
|
|
303
|
+
/**
|
|
304
|
+
* Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
305
|
+
* @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
|
|
306
|
+
* @param {*} [options] Override http request option.
|
|
307
|
+
* @throws {RequiredError}
|
|
308
|
+
*/
|
|
309
|
+
createScheduledPackage(requestParameters, options) {
|
|
310
|
+
return localVarFp.createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(axios, basePath));
|
|
311
|
+
},
|
|
312
|
+
/**
|
|
313
|
+
* This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
314
|
+
* @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
|
|
315
|
+
* @param {*} [options] Override http request option.
|
|
316
|
+
* @throws {RequiredError}
|
|
317
|
+
*/
|
|
318
|
+
createScheduledPackageBulk(requestParameters, options) {
|
|
319
|
+
return localVarFp.createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(axios, basePath));
|
|
320
|
+
},
|
|
321
|
+
/**
|
|
322
|
+
* Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
323
|
+
* @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
|
|
324
|
+
* @param {*} [options] Override http request option.
|
|
325
|
+
* @throws {RequiredError}
|
|
326
|
+
*/
|
|
327
|
+
getScheduledPackage(requestParameters, options) {
|
|
328
|
+
return localVarFp.getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(axios, basePath));
|
|
329
|
+
},
|
|
330
|
+
/**
|
|
331
|
+
* Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
332
|
+
* @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
|
|
333
|
+
* @param {*} [options] Override http request option.
|
|
334
|
+
* @throws {RequiredError}
|
|
335
|
+
*/
|
|
336
|
+
listHandoverSlots(requestParameters = {}, options) {
|
|
337
|
+
return localVarFp.listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(axios, basePath));
|
|
338
|
+
},
|
|
339
|
+
/**
|
|
340
|
+
* Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
341
|
+
* @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
|
|
342
|
+
* @param {*} [options] Override http request option.
|
|
343
|
+
* @throws {RequiredError}
|
|
344
|
+
*/
|
|
345
|
+
updateScheduledPackages(requestParameters = {}, options) {
|
|
346
|
+
return localVarFp.updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(axios, basePath));
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
var EasyShipApi = class extends BaseAPI {
|
|
351
|
+
/**
|
|
352
|
+
* Schedules an Easy Ship order and returns the scheduled package information. This operation does the following: * Specifies the time slot and handover method for the order to be scheduled for delivery. * Updates the Easy Ship order status. * Generates a shipping label and an invoice. Calling `createScheduledPackage` also generates a warranty document if you specify a `SerialNumber` value. To get these documents, see [How to get invoice, shipping label, and warranty documents](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide). * Shows the status of Easy Ship orders when you call the `getOrders` operation of the Selling Partner API for Orders and examine the `EasyShipShipmentStatus` property in the response body. See the **Shipping Label**, **Invoice**, and **Warranty** columns in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which documents are supported in each marketplace. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
353
|
+
* @param {EasyShipApiCreateScheduledPackageRequest} requestParameters Request parameters.
|
|
354
|
+
* @param {*} [options] Override http request option.
|
|
355
|
+
* @throws {RequiredError}
|
|
356
|
+
*/
|
|
357
|
+
createScheduledPackage(requestParameters, options) {
|
|
358
|
+
return EasyShipApiFp(this.configuration).createScheduledPackage(requestParameters.createScheduledPackageRequest, options).then((request) => request(this.axios, this.basePath));
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* This operation automatically schedules a time slot for all the `amazonOrderId`s given as input, generating the associated shipping labels, along with other compliance documents according to the marketplace (refer to the [marketplace document support table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table)). Developers calling this operation may optionally assign a `packageDetails` object, allowing them to input a preferred time slot for each order in ther request. In this case, Amazon will try to schedule the respective packages using their optional settings. On the other hand, *i.e.*, if the time slot is not provided, Amazon will then pick the earliest time slot possible. Regarding the shipping label\'s file format, external developers are able to choose between PDF or ZPL, and Amazon will create the label accordingly. This operation returns an array composed of the scheduled packages, and a short-lived URL pointing to a zip file containing the generated shipping labels and the other documents enabled for your marketplace. If at least an order couldn\'t be scheduled, then Amazon adds the `rejectedOrders` list into the response, which contains an entry for each order we couldn\'t process. Each entry is composed of an error message describing the reason of the failure, so that sellers can take action. The table below displays the supported request and burst maximum rates: **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
362
|
+
* @param {EasyShipApiCreateScheduledPackageBulkRequest} requestParameters Request parameters.
|
|
363
|
+
* @param {*} [options] Override http request option.
|
|
364
|
+
* @throws {RequiredError}
|
|
365
|
+
*/
|
|
366
|
+
createScheduledPackageBulk(requestParameters, options) {
|
|
367
|
+
return EasyShipApiFp(this.configuration).createScheduledPackageBulk(requestParameters.createScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Returns information about a package, including dimensions, weight, time slot information for handover, invoice and item information, and status. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
371
|
+
* @param {EasyShipApiGetScheduledPackageRequest} requestParameters Request parameters.
|
|
372
|
+
* @param {*} [options] Override http request option.
|
|
373
|
+
* @throws {RequiredError}
|
|
374
|
+
*/
|
|
375
|
+
getScheduledPackage(requestParameters, options) {
|
|
376
|
+
return EasyShipApiFp(this.configuration).getScheduledPackage(requestParameters.amazonOrderId, requestParameters.marketplaceId, options).then((request) => request(this.axios, this.basePath));
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Returns time slots available for Easy Ship orders to be scheduled based on the package weight and dimensions that the seller specifies. This operation is available for scheduled and unscheduled orders based on marketplace support. See **Get Time Slots** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). This operation can return time slots that have either pickup or drop-off handover methods - see **Supported Handover Methods** in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
380
|
+
* @param {EasyShipApiListHandoverSlotsRequest} requestParameters Request parameters.
|
|
381
|
+
* @param {*} [options] Override http request option.
|
|
382
|
+
* @throws {RequiredError}
|
|
383
|
+
*/
|
|
384
|
+
listHandoverSlots(requestParameters = {}, options) {
|
|
385
|
+
return EasyShipApiFp(this.configuration).listHandoverSlots(requestParameters.listHandoverSlotsRequest, options).then((request) => request(this.axios, this.basePath));
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Updates the time slot for handing over the package indicated by the specified `scheduledPackageId`. You can get the new `slotId` value for the time slot by calling the `listHandoverSlots` operation before making another `patch` call. See the **Update Package** column in the [Marketplace Support Table](https://developer-docs.amazon.com/sp-api/docs/easyship-api-v2022-03-23-use-case-guide#marketplace-support-table) to see which marketplaces this operation is supported in. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 5 | The `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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
|
|
389
|
+
* @param {EasyShipApiUpdateScheduledPackagesRequest} requestParameters Request parameters.
|
|
390
|
+
* @param {*} [options] Override http request option.
|
|
391
|
+
* @throws {RequiredError}
|
|
392
|
+
*/
|
|
393
|
+
updateScheduledPackages(requestParameters = {}, options) {
|
|
394
|
+
return EasyShipApiFp(this.configuration).updateScheduledPackages(requestParameters.updateScheduledPackagesRequest, options).then((request) => request(this.axios, this.basePath));
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
// src/api-model/configuration.ts
|
|
399
|
+
var Configuration = class {
|
|
400
|
+
/**
|
|
401
|
+
* parameter for apiKey security
|
|
402
|
+
* @param name security name
|
|
403
|
+
*/
|
|
404
|
+
apiKey;
|
|
405
|
+
/**
|
|
406
|
+
* parameter for basic security
|
|
407
|
+
*/
|
|
408
|
+
username;
|
|
409
|
+
/**
|
|
410
|
+
* parameter for basic security
|
|
411
|
+
*/
|
|
412
|
+
password;
|
|
413
|
+
/**
|
|
414
|
+
* parameter for oauth2 security
|
|
415
|
+
* @param name security name
|
|
416
|
+
* @param scopes oauth2 scope
|
|
417
|
+
*/
|
|
418
|
+
accessToken;
|
|
419
|
+
/**
|
|
420
|
+
* parameter for aws4 signature security
|
|
421
|
+
* @param {Object} AWS4Signature - AWS4 Signature security
|
|
422
|
+
* @param {string} options.region - aws region
|
|
423
|
+
* @param {string} options.service - name of the service.
|
|
424
|
+
* @param {string} credentials.accessKeyId - aws access key id
|
|
425
|
+
* @param {string} credentials.secretAccessKey - aws access key
|
|
426
|
+
* @param {string} credentials.sessionToken - aws session token
|
|
427
|
+
* @memberof Configuration
|
|
428
|
+
*/
|
|
429
|
+
awsv4;
|
|
430
|
+
/**
|
|
431
|
+
* override base path
|
|
432
|
+
*/
|
|
433
|
+
basePath;
|
|
434
|
+
/**
|
|
435
|
+
* override server index
|
|
436
|
+
*/
|
|
437
|
+
serverIndex;
|
|
438
|
+
/**
|
|
439
|
+
* base options for axios calls
|
|
440
|
+
*/
|
|
441
|
+
baseOptions;
|
|
442
|
+
/**
|
|
443
|
+
* The FormData constructor that will be used to create multipart form data
|
|
444
|
+
* requests. You can inject this here so that execution environments that
|
|
445
|
+
* do not support the FormData class can still run the generated client.
|
|
446
|
+
*
|
|
447
|
+
* @type {new () => FormData}
|
|
448
|
+
*/
|
|
449
|
+
formDataCtor;
|
|
450
|
+
constructor(param = {}) {
|
|
451
|
+
this.apiKey = param.apiKey;
|
|
452
|
+
this.username = param.username;
|
|
453
|
+
this.password = param.password;
|
|
454
|
+
this.accessToken = param.accessToken;
|
|
455
|
+
this.awsv4 = param.awsv4;
|
|
456
|
+
this.basePath = param.basePath;
|
|
457
|
+
this.serverIndex = param.serverIndex;
|
|
458
|
+
this.baseOptions = {
|
|
459
|
+
...param.baseOptions,
|
|
460
|
+
headers: {
|
|
461
|
+
...param.baseOptions?.headers
|
|
462
|
+
}
|
|
463
|
+
};
|
|
464
|
+
this.formDataCtor = param.formDataCtor;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Check if the given MIME is a JSON MIME.
|
|
468
|
+
* JSON MIME examples:
|
|
469
|
+
* application/json
|
|
470
|
+
* application/json; charset=UTF8
|
|
471
|
+
* APPLICATION/JSON
|
|
472
|
+
* application/vnd.company+json
|
|
473
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
474
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
475
|
+
*/
|
|
476
|
+
isJsonMime(mime) {
|
|
477
|
+
const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
|
|
478
|
+
return mime !== null && jsonMime.test(mime);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
// src/api-model/models/code.ts
|
|
483
|
+
var Code = {
|
|
484
|
+
InvalidInput: "InvalidInput",
|
|
485
|
+
InvalidTimeSlotId: "InvalidTimeSlotId",
|
|
486
|
+
ScheduledPackageAlreadyExists: "ScheduledPackageAlreadyExists",
|
|
487
|
+
ScheduleWindowExpired: "ScheduleWindowExpired",
|
|
488
|
+
RetryableAfterGettingNewSlots: "RetryableAfterGettingNewSlots",
|
|
489
|
+
TimeSlotNotAvailable: "TimeSlotNotAvailable",
|
|
490
|
+
ResourceNotFound: "ResourceNotFound",
|
|
491
|
+
InvalidOrderState: "InvalidOrderState",
|
|
492
|
+
RegionNotSupported: "RegionNotSupported",
|
|
493
|
+
OrderNotEligibleForRescheduling: "OrderNotEligibleForRescheduling",
|
|
494
|
+
InternalServerError: "InternalServerError"
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
// src/api-model/models/handover-method.ts
|
|
498
|
+
var HandoverMethod = {
|
|
499
|
+
Pickup: "PICKUP",
|
|
500
|
+
Dropoff: "DROPOFF"
|
|
501
|
+
};
|
|
502
|
+
|
|
503
|
+
// src/api-model/models/label-format.ts
|
|
504
|
+
var LabelFormat = {
|
|
505
|
+
Pdf: "PDF",
|
|
506
|
+
Zpl: "ZPL"
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
// src/api-model/models/package-status.ts
|
|
510
|
+
var PackageStatus = {
|
|
511
|
+
ReadyForPickup: "ReadyForPickup",
|
|
512
|
+
PickedUp: "PickedUp",
|
|
513
|
+
AtOriginFc: "AtOriginFC",
|
|
514
|
+
AtDestinationFc: "AtDestinationFC",
|
|
515
|
+
Delivered: "Delivered",
|
|
516
|
+
Rejected: "Rejected",
|
|
517
|
+
Undeliverable: "Undeliverable",
|
|
518
|
+
ReturnedToSeller: "ReturnedToSeller",
|
|
519
|
+
LostInTransit: "LostInTransit",
|
|
520
|
+
LabelCanceled: "LabelCanceled",
|
|
521
|
+
DamagedInTransit: "DamagedInTransit",
|
|
522
|
+
OutForDelivery: "OutForDelivery"
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
// src/api-model/models/unit-of-length.ts
|
|
526
|
+
var UnitOfLength = {
|
|
527
|
+
Cm: "cm"
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
// src/api-model/models/unit-of-weight.ts
|
|
531
|
+
var UnitOfWeight = {
|
|
532
|
+
Grams: "grams",
|
|
533
|
+
G: "g"
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
// src/client.ts
|
|
537
|
+
var clientRateLimits = [
|
|
538
|
+
{
|
|
539
|
+
method: "post",
|
|
540
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
541
|
+
urlRegex: new RegExp("^/easyShip/2022-03-23/timeSlot$"),
|
|
542
|
+
rate: 1,
|
|
543
|
+
burst: 5
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
method: "get",
|
|
547
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
548
|
+
urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
|
|
549
|
+
rate: 1,
|
|
550
|
+
burst: 5
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
method: "post",
|
|
554
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
555
|
+
urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
|
|
556
|
+
rate: 1,
|
|
557
|
+
burst: 5
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
method: "patch",
|
|
561
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
562
|
+
urlRegex: new RegExp("^/easyShip/2022-03-23/package$"),
|
|
563
|
+
rate: 1,
|
|
564
|
+
burst: 5
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
method: "post",
|
|
568
|
+
// eslint-disable-next-line prefer-regex-literals
|
|
569
|
+
urlRegex: new RegExp("^/easyShip/2022-03-23/packages/bulk$"),
|
|
570
|
+
rate: 1,
|
|
571
|
+
burst: 5
|
|
572
|
+
}
|
|
573
|
+
];
|
|
574
|
+
var EasyShipApiClient = class extends EasyShipApi {
|
|
575
|
+
constructor(configuration) {
|
|
576
|
+
const { axios, endpoint } = createAxiosInstance(configuration, clientRateLimits);
|
|
577
|
+
super(new Configuration(), endpoint, axios);
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
export {
|
|
581
|
+
Code,
|
|
582
|
+
EasyShipApi,
|
|
583
|
+
EasyShipApiAxiosParamCreator,
|
|
584
|
+
EasyShipApiClient,
|
|
585
|
+
EasyShipApiFactory,
|
|
586
|
+
EasyShipApiFp,
|
|
587
|
+
HandoverMethod,
|
|
588
|
+
LabelFormat,
|
|
589
|
+
PackageStatus,
|
|
590
|
+
UnitOfLength,
|
|
591
|
+
UnitOfWeight,
|
|
592
|
+
clientRateLimits
|
|
593
|
+
};
|
|
594
|
+
//# sourceMappingURL=index.js.map
|