UNPKG

@sp-api-sdk/fulfillment-inbound-api-2024-03-20

Version:

The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user inte

832 lines (828 loc) 214 kB
// src/client.ts import { createAxiosInstance } from "@sp-api-sdk/common"; // src/api-model/api/fulfillment-inbound-api.ts import globalAxios2 from "axios"; // src/api-model/base.ts import globalAxios from "axios"; var BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, ""); var BaseAPI = class { constructor(configuration, basePath = BASE_PATH, axios = globalAxios) { this.basePath = basePath; this.axios = axios; if (configuration) { this.configuration = configuration; this.basePath = configuration.basePath ?? basePath; } } basePath; axios; configuration; }; var RequiredError = class extends Error { constructor(field, msg) { super(msg); this.field = field; this.name = "RequiredError"; } field; }; var operationServerMap = {}; // src/api-model/common.ts var DUMMY_BASE_URL = "https://example.com"; var assertParamExists = function(functionName, paramName, paramValue) { if (paramValue === null || paramValue === void 0) { throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); } }; function setFlattenedQueryParams(urlSearchParams, parameter, key = "") { if (parameter == null) return; if (typeof parameter === "object") { if (Array.isArray(parameter) || parameter instanceof Set) { parameter.forEach((item) => setFlattenedQueryParams(urlSearchParams, item, key)); } else { Object.keys(parameter).forEach( (currentKey) => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== "" ? "." : ""}${currentKey}`) ); } } else { if (urlSearchParams.has(key)) { urlSearchParams.append(key, parameter); } else { urlSearchParams.set(key, parameter); } } } var setSearchParams = function(url, ...objects) { const searchParams = new URLSearchParams(url.search); setFlattenedQueryParams(searchParams, objects); url.search = searchParams.toString(); }; var replaceWithSerializableTypeIfNeeded = function(key, value) { if (value instanceof Set) { return Array.from(value); } else { return value; } }; var serializeDataIfNeeded = function(value, requestOptions, configuration) { const nonString = typeof value !== "string"; const needsSerialization = nonString && configuration && configuration.isJsonMime ? configuration.isJsonMime(requestOptions.headers["Content-Type"]) : nonString; return needsSerialization ? JSON.stringify(value !== void 0 ? value : {}, replaceWithSerializableTypeIfNeeded) : value || ""; }; var toPathString = function(url) { return url.pathname + url.search + url.hash; }; var createRequestFunction = function(axiosArgs, globalAxios3, BASE_PATH2, configuration) { return (axios = globalAxios3, basePath = BASE_PATH2) => { const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? "" : configuration?.basePath ?? basePath) + axiosArgs.url }; return axios.request(axiosRequestArgs); }; }; // src/api-model/api/fulfillment-inbound-api.ts var FulfillmentInboundApiAxiosParamCreator = function(configuration) { return { /** * Cancels an Inbound Plan. Charges may apply if the cancellation is performed outside of a void window. The window for Amazon Partnered Carriers is 24 hours for Small Parcel Delivery (SPD) and one hour for Less-Than-Truckload (LTL) carrier shipments. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelInboundPlan: async (inboundPlanId, options = {}) => { assertParamExists("cancelInboundPlan", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/cancellation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Cancels a self-ship appointment slot against a shipment. Only available in the following [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {CancelSelfShipAppointmentRequest} body The body of the request to `cancelSelfShipAppointment`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelSelfShipAppointment: async (inboundPlanId, shipmentId, body, options = {}) => { assertParamExists("cancelSelfShipAppointment", "inboundPlanId", inboundPlanId); assertParamExists("cancelSelfShipAppointment", "shipmentId", shipmentId); assertParamExists("cancelSelfShipAppointment", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentCancellation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "PUT", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Confirms the delivery window option for chosen shipment within an inbound plan. A placement option must be confirmed prior to use of this API. Once confirmed, new delivery window options cannot be generated, but the chosen delivery window option can be updated before shipment closure. The window is used to provide the expected time when a shipment will arrive at the warehouse. All transportation options which have the program `CONFIRMED_DELIVERY_WINDOW` require a delivery window to be confirmed prior to transportation option confirmation. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId The shipment to confirm the delivery window option for. * @param {string} deliveryWindowOptionId The id of the delivery window option to be confirmed. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmDeliveryWindowOptions: async (inboundPlanId, shipmentId, deliveryWindowOptionId, options = {}) => { assertParamExists("confirmDeliveryWindowOptions", "inboundPlanId", inboundPlanId); assertParamExists("confirmDeliveryWindowOptions", "shipmentId", shipmentId); assertParamExists("confirmDeliveryWindowOptions", "deliveryWindowOptionId", deliveryWindowOptionId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions/{deliveryWindowOptionId}/confirmation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))).replace("{deliveryWindowOptionId}", encodeURIComponent(String(deliveryWindowOptionId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Confirms the packing option for an inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} packingOptionId Identifier of a packing option. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmPackingOption: async (inboundPlanId, packingOptionId, options = {}) => { assertParamExists("confirmPackingOption", "inboundPlanId", inboundPlanId); assertParamExists("confirmPackingOption", "packingOptionId", packingOptionId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions/{packingOptionId}/confirmation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{packingOptionId}", encodeURIComponent(String(packingOptionId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Confirms the placement option for an inbound plan. Once confirmed, it cannot be changed for the Inbound Plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} placementOptionId The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmPlacementOption: async (inboundPlanId, placementOptionId, options = {}) => { assertParamExists("confirmPlacementOption", "inboundPlanId", inboundPlanId); assertParamExists("confirmPlacementOption", "placementOptionId", placementOptionId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions/{placementOptionId}/confirmation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{placementOptionId}", encodeURIComponent(String(placementOptionId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Confirm a shipment content update preview and accept the changes in transportation cost. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {string} contentUpdatePreviewId Identifier of a content update preview. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmShipmentContentUpdatePreview: async (inboundPlanId, shipmentId, contentUpdatePreviewId, options = {}) => { assertParamExists("confirmShipmentContentUpdatePreview", "inboundPlanId", inboundPlanId); assertParamExists("confirmShipmentContentUpdatePreview", "shipmentId", shipmentId); assertParamExists("confirmShipmentContentUpdatePreview", "contentUpdatePreviewId", contentUpdatePreviewId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}/confirmation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))).replace("{contentUpdatePreviewId}", encodeURIComponent(String(contentUpdatePreviewId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Confirms all the transportation options for an inbound plan. A placement option must be confirmed prior to use of this API. Once confirmed, new transportation options can not be generated or confirmed for the Inbound Plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {ConfirmTransportationOptionsRequest} body The body of the request to `confirmTransportationOptions`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ confirmTransportationOptions: async (inboundPlanId, body, options = {}) => { assertParamExists("confirmTransportationOptions", "inboundPlanId", inboundPlanId); assertParamExists("confirmTransportationOptions", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions/confirmation`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Creates an inbound plan. An inbound plan contains all the necessary information to send shipments into Amazon\'s fufillment network. * @param {CreateInboundPlanRequest} body The body of the request to `createInboundPlan`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createInboundPlan: async (body, options = {}) => { assertParamExists("createInboundPlan", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans`; const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * For a given marketplace - creates labels for a list of MSKUs. * @param {CreateMarketplaceItemLabelsRequest} body The body of the request to `createMarketplaceItemLabels`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createMarketplaceItemLabels: async (body, options = {}) => { assertParamExists("createMarketplaceItemLabels", "body", body); const localVarPath = `/inbound/fba/2024-03-20/items/labels`; const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Generates available delivery window options for a given shipment. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId The shipment to generate delivery window options for. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateDeliveryWindowOptions: async (inboundPlanId, shipmentId, options = {}) => { assertParamExists("generateDeliveryWindowOptions", "inboundPlanId", inboundPlanId); assertParamExists("generateDeliveryWindowOptions", "shipmentId", shipmentId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Generates available packing options for the inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generatePackingOptions: async (inboundPlanId, options = {}) => { assertParamExists("generatePackingOptions", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/packingOptions`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Generates placement options for the inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {GeneratePlacementOptionsRequest} body The body of the request to `generatePlacementOptions`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generatePlacementOptions: async (inboundPlanId, body, options = {}) => { assertParamExists("generatePlacementOptions", "inboundPlanId", inboundPlanId); assertParamExists("generatePlacementOptions", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/placementOptions`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Initiates the process of generating the appointment slots list. Only available in the following [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {GenerateSelfShipAppointmentSlotsRequest} body The body of the request to `generateSelfShipAppointmentSlots`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateSelfShipAppointmentSlots: async (inboundPlanId, shipmentId, body, options = {}) => { assertParamExists("generateSelfShipAppointmentSlots", "inboundPlanId", inboundPlanId); assertParamExists("generateSelfShipAppointmentSlots", "shipmentId", shipmentId); assertParamExists("generateSelfShipAppointmentSlots", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Generate a shipment content update preview given a set of intended boxes and/or items for a shipment with a confirmed carrier. The shipment content update preview will be viewable with the updated costs and contents prior to confirmation. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {GenerateShipmentContentUpdatePreviewsRequest} body The body of the request to `generateShipmentContentUpdatePreviews`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateShipmentContentUpdatePreviews: async (inboundPlanId, shipmentId, body, options = {}) => { assertParamExists("generateShipmentContentUpdatePreviews", "inboundPlanId", inboundPlanId); assertParamExists("generateShipmentContentUpdatePreviews", "shipmentId", shipmentId); assertParamExists("generateShipmentContentUpdatePreviews", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Generates available transportation options for a given placement option. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {GenerateTransportationOptionsRequest} body The body of the request to `generateTransportationOptions`. * @param {*} [options] Override http request option. * @throws {RequiredError} */ generateTransportationOptions: async (inboundPlanId, body, options = {}) => { assertParamExists("generateTransportationOptions", "inboundPlanId", inboundPlanId); assertParamExists("generateTransportationOptions", "body", body); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/transportationOptions`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "POST", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Content-Type"] = "application/json"; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Provide delivery challan document for PCP transportation in IN marketplace. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getDeliveryChallanDocument: async (inboundPlanId, shipmentId, options = {}) => { assertParamExists("getDeliveryChallanDocument", "inboundPlanId", inboundPlanId); assertParamExists("getDeliveryChallanDocument", "shipmentId", shipmentId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryChallanDocument`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Gets the status of the processing of an asynchronous API call. * @param {string} operationId Identifier of an asynchronous operation. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInboundOperationStatus: async (operationId, options = {}) => { assertParamExists("getInboundOperationStatus", "operationId", operationId); const localVarPath = `/inbound/fba/2024-03-20/operations/{operationId}`.replace("{operationId}", encodeURIComponent(String(operationId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Fetches the top level information about an inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInboundPlan: async (inboundPlanId, options = {}) => { assertParamExists("getInboundPlan", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Retrieves a list of available self-ship appointment slots used to drop off a shipment at a warehouse. Only available in the following [marketplaces](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids): MX, BR, EG, SA, AE, IN. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {number} [pageSize] The number of self ship appointment slots to return in the response matching the given query. * @param {string} [paginationToken] A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the `pagination` returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSelfShipAppointmentSlots: async (inboundPlanId, shipmentId, pageSize, paginationToken, options = {}) => { assertParamExists("getSelfShipAppointmentSlots", "inboundPlanId", inboundPlanId); assertParamExists("getSelfShipAppointmentSlots", "shipmentId", shipmentId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/selfShipAppointmentSlots`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (paginationToken !== void 0) { localVarQueryParameter["paginationToken"] = paginationToken; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Provides the full details for a specific shipment within an inbound plan. The `transportationOptionId` inside `acceptedTransportationSelection` can be used to retrieve the transportation details for the shipment. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getShipment: async (inboundPlanId, shipmentId, options = {}) => { assertParamExists("getShipment", "inboundPlanId", inboundPlanId); assertParamExists("getShipment", "shipmentId", shipmentId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Retrieve a shipment content update preview which provides a summary of the requested shipment content changes along with the transportation cost implications of the change that can only be confirmed prior to the expiry date specified. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId Identifier of a shipment. A shipment contains the boxes and units being inbounded. * @param {string} contentUpdatePreviewId Identifier of a content update preview. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getShipmentContentUpdatePreview: async (inboundPlanId, shipmentId, contentUpdatePreviewId, options = {}) => { assertParamExists("getShipmentContentUpdatePreview", "inboundPlanId", inboundPlanId); assertParamExists("getShipmentContentUpdatePreview", "shipmentId", shipmentId); assertParamExists("getShipmentContentUpdatePreview", "contentUpdatePreviewId", contentUpdatePreviewId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/contentUpdatePreviews/{contentUpdatePreviewId}`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))).replace("{contentUpdatePreviewId}", encodeURIComponent(String(contentUpdatePreviewId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Retrieves all delivery window options for a shipment. Delivery window options must first be generated by the `generateDeliveryWindowOptions` operation before becoming available. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {string} shipmentId The shipment to get delivery window options for. * @param {number} [pageSize] The number of delivery window options to return in the response matching the given query. * @param {string} [paginationToken] A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the `pagination` returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listDeliveryWindowOptions: async (inboundPlanId, shipmentId, pageSize, paginationToken, options = {}) => { assertParamExists("listDeliveryWindowOptions", "inboundPlanId", inboundPlanId); assertParamExists("listDeliveryWindowOptions", "shipmentId", shipmentId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/shipments/{shipmentId}/deliveryWindowOptions`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))).replace("{shipmentId}", encodeURIComponent(String(shipmentId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (paginationToken !== void 0) { localVarQueryParameter["paginationToken"] = paginationToken; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Provides a paginated list of box packages in an inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {number} [pageSize] The number of boxes to return in the response matching the given query. * @param {string} [paginationToken] A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the `pagination` returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInboundPlanBoxes: async (inboundPlanId, pageSize, paginationToken, options = {}) => { assertParamExists("listInboundPlanBoxes", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/boxes`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (paginationToken !== void 0) { localVarQueryParameter["paginationToken"] = paginationToken; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Provides a paginated list of item packages in an inbound plan. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {number} [pageSize] The number of items to return in the response matching the given query. * @param {string} [paginationToken] A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the `pagination` returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInboundPlanItems: async (inboundPlanId, pageSize, paginationToken, options = {}) => { assertParamExists("listInboundPlanItems", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/items`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (paginationToken !== void 0) { localVarQueryParameter["paginationToken"] = paginationToken; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions }; }, /** * Provides a paginated list of pallet packages in an inbound plan. An inbound plan will have pallets when the related details are provided after generating Less-Than-Truckload (LTL) carrier shipments. * @param {string} inboundPlanId Identifier of an inbound plan. * @param {number} [pageSize] The number of pallets to return in the response matching the given query. * @param {string} [paginationToken] A token to fetch a certain page when there are multiple pages worth of results. The value of this token is fetched from the `pagination` returned in the API response. In the absence of the token value from the query parameter the API returns the first page of the result. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listInboundPlanPallets: async (inboundPlanId, pageSize, paginationToken, options = {}) => { assertParamExists("listInboundPlanPallets", "inboundPlanId", inboundPlanId); const localVarPath = `/inbound/fba/2024-03-20/inboundPlans/{inboundPlanId}/pallets`.replace("{inboundPlanId}", encodeURIComponent(String(inboundPlanId))); const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; if (pageSize !== void 0) { localVarQueryParameter["pageSize"] = pageSize; } if (paginationToken !== void 0) { localVarQueryParameter["paginationToken"] = paginationToken; } localVarHeaderParameter["Accept"] = "application/json"; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.he