@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
756 lines • 149 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Amazon Shipping API
* The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
*
* The version of the OpenAPI document: v2
* Contact: swa-api-core@amazon.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShippingApi = exports.ShippingApiFactory = exports.ShippingApiFp = exports.ShippingApiAxiosParamCreator = exports.WeightUnitEnum = exports.TaxType = exports.Status = exports.ShipmentType = exports.RateItemType = exports.RateItemID = exports.PaymentType = exports.LiquidVolumeUnitEnum = exports.InputType = exports.IneligibilityReasonCode = exports.GenerationStatus = exports.EventCode = exports.DocumentType = exports.DocumentSizeUnitEnum = exports.DocumentFormat = exports.DimensionsUnitEnum = exports.DangerousGoodsDetailsPackingInstructionEnum = exports.DangerousGoodsDetailsPackingGroupEnum = exports.ClientReferenceDetailClientReferenceTypeEnum = exports.ChargeComponentChargeTypeEnum = exports.ChannelType = exports.AccountType = exports.AccountStatus = exports.AccessPointType = exports.AccessPointAssistanceTypeEnum = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
/**
* @export
* @enum {string}
*/
var AccessPointAssistanceTypeEnum;
(function (AccessPointAssistanceTypeEnum) {
AccessPointAssistanceTypeEnum["StaffAssisted"] = "STAFF_ASSISTED";
AccessPointAssistanceTypeEnum["SelfAssisted"] = "SELF_ASSISTED";
})(AccessPointAssistanceTypeEnum || (exports.AccessPointAssistanceTypeEnum = AccessPointAssistanceTypeEnum = {}));
/**
* The type of access point, like counter (HELIX), lockers, etc.
* @export
* @enum {string}
*/
var AccessPointType;
(function (AccessPointType) {
AccessPointType["Helix"] = "HELIX";
AccessPointType["CampusLocker"] = "CAMPUS_LOCKER";
AccessPointType["OmniLocker"] = "OMNI_LOCKER";
AccessPointType["OdinLocker"] = "ODIN_LOCKER";
AccessPointType["DobbyLocker"] = "DOBBY_LOCKER";
AccessPointType["CoreLocker"] = "CORE_LOCKER";
AccessPointType["_3P"] = "3P";
AccessPointType["CampusRoom"] = "CAMPUS_ROOM";
})(AccessPointType || (exports.AccessPointType = AccessPointType = {}));
/**
* Account Status.
* @export
* @enum {string}
*/
var AccountStatus;
(function (AccountStatus) {
AccountStatus["Active"] = "ACTIVE";
AccountStatus["Inactive"] = "INACTIVE";
AccountStatus["Pending"] = "PENDING";
AccountStatus["Suspended"] = "SUSPENDED";
})(AccountStatus || (exports.AccountStatus = AccountStatus = {}));
/**
* Shipper Account Type.
* @export
* @enum {string}
*/
var AccountType;
(function (AccountType) {
AccountType["ShipperAccount"] = "SHIPPER_ACCOUNT";
AccountType["ShipperAccountWithInvoice"] = "SHIPPER_ACCOUNT_WITH_INVOICE";
AccountType["AmazonAccount"] = "AMAZON_ACCOUNT";
})(AccountType || (exports.AccountType = AccountType = {}));
/**
* The shipment source channel type.
* @export
* @enum {string}
*/
var ChannelType;
(function (ChannelType) {
ChannelType["Amazon"] = "AMAZON";
ChannelType["External"] = "EXTERNAL";
})(ChannelType || (exports.ChannelType = ChannelType = {}));
/**
* @export
* @enum {string}
*/
var ChargeComponentChargeTypeEnum;
(function (ChargeComponentChargeTypeEnum) {
ChargeComponentChargeTypeEnum["Tax"] = "TAX";
ChargeComponentChargeTypeEnum["Discount"] = "DISCOUNT";
})(ChargeComponentChargeTypeEnum || (exports.ChargeComponentChargeTypeEnum = ChargeComponentChargeTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ClientReferenceDetailClientReferenceTypeEnum;
(function (ClientReferenceDetailClientReferenceTypeEnum) {
ClientReferenceDetailClientReferenceTypeEnum["IntegratorShipperId"] = "IntegratorShipperId";
ClientReferenceDetailClientReferenceTypeEnum["IntegratorMerchantId"] = "IntegratorMerchantId";
})(ClientReferenceDetailClientReferenceTypeEnum || (exports.ClientReferenceDetailClientReferenceTypeEnum = ClientReferenceDetailClientReferenceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var DangerousGoodsDetailsPackingGroupEnum;
(function (DangerousGoodsDetailsPackingGroupEnum) {
DangerousGoodsDetailsPackingGroupEnum["I"] = "I";
DangerousGoodsDetailsPackingGroupEnum["Ii"] = "II";
DangerousGoodsDetailsPackingGroupEnum["Iii"] = "III";
})(DangerousGoodsDetailsPackingGroupEnum || (exports.DangerousGoodsDetailsPackingGroupEnum = DangerousGoodsDetailsPackingGroupEnum = {}));
/**
* @export
* @enum {string}
*/
var DangerousGoodsDetailsPackingInstructionEnum;
(function (DangerousGoodsDetailsPackingInstructionEnum) {
DangerousGoodsDetailsPackingInstructionEnum["Pi965SectionIa"] = "PI965_SECTION_IA";
DangerousGoodsDetailsPackingInstructionEnum["Pi965SectionIb"] = "PI965_SECTION_IB";
DangerousGoodsDetailsPackingInstructionEnum["Pi965SectionIi"] = "PI965_SECTION_II";
DangerousGoodsDetailsPackingInstructionEnum["Pi966SectionI"] = "PI966_SECTION_I";
DangerousGoodsDetailsPackingInstructionEnum["Pi966SectionIi"] = "PI966_SECTION_II";
DangerousGoodsDetailsPackingInstructionEnum["Pi967SectionI"] = "PI967_SECTION_I";
DangerousGoodsDetailsPackingInstructionEnum["Pi967SectionIi"] = "PI967_SECTION_II";
DangerousGoodsDetailsPackingInstructionEnum["Pi968SectionIa"] = "PI968_SECTION_IA";
DangerousGoodsDetailsPackingInstructionEnum["Pi968SectionIb"] = "PI968_SECTION_IB";
DangerousGoodsDetailsPackingInstructionEnum["Pi969SectionI"] = "PI969_SECTION_I";
DangerousGoodsDetailsPackingInstructionEnum["Pi969SectionIi"] = "PI969_SECTION_II";
DangerousGoodsDetailsPackingInstructionEnum["Pi970SectionI"] = "PI970_SECTION_I";
DangerousGoodsDetailsPackingInstructionEnum["Pi970SectionIi"] = "PI970_SECTION_II";
})(DangerousGoodsDetailsPackingInstructionEnum || (exports.DangerousGoodsDetailsPackingInstructionEnum = DangerousGoodsDetailsPackingInstructionEnum = {}));
/**
* @export
* @enum {string}
*/
var DimensionsUnitEnum;
(function (DimensionsUnitEnum) {
DimensionsUnitEnum["Inch"] = "INCH";
DimensionsUnitEnum["Centimeter"] = "CENTIMETER";
})(DimensionsUnitEnum || (exports.DimensionsUnitEnum = DimensionsUnitEnum = {}));
/**
* The file format of the document.
* @export
* @enum {string}
*/
var DocumentFormat;
(function (DocumentFormat) {
DocumentFormat["Pdf"] = "PDF";
DocumentFormat["Png"] = "PNG";
DocumentFormat["Zpl"] = "ZPL";
})(DocumentFormat || (exports.DocumentFormat = DocumentFormat = {}));
/**
* @export
* @enum {string}
*/
var DocumentSizeUnitEnum;
(function (DocumentSizeUnitEnum) {
DocumentSizeUnitEnum["Inch"] = "INCH";
DocumentSizeUnitEnum["Centimeter"] = "CENTIMETER";
})(DocumentSizeUnitEnum || (exports.DocumentSizeUnitEnum = DocumentSizeUnitEnum = {}));
/**
* The type of shipping document.
* @export
* @enum {string}
*/
var DocumentType;
(function (DocumentType) {
DocumentType["Packslip"] = "PACKSLIP";
DocumentType["Label"] = "LABEL";
DocumentType["Receipt"] = "RECEIPT";
DocumentType["CustomForm"] = "CUSTOM_FORM";
})(DocumentType || (exports.DocumentType = DocumentType = {}));
/**
* The tracking event type.
* @export
* @enum {string}
*/
var EventCode;
(function (EventCode) {
EventCode["ReadyForReceive"] = "ReadyForReceive";
EventCode["PickupDone"] = "PickupDone";
EventCode["Delivered"] = "Delivered";
EventCode["Departed"] = "Departed";
EventCode["DeliveryAttempted"] = "DeliveryAttempted";
EventCode["Lost"] = "Lost";
EventCode["OutForDelivery"] = "OutForDelivery";
EventCode["ArrivedAtCarrierFacility"] = "ArrivedAtCarrierFacility";
EventCode["Rejected"] = "Rejected";
EventCode["Undeliverable"] = "Undeliverable";
EventCode["PickupCancelled"] = "PickupCancelled";
})(EventCode || (exports.EventCode = EventCode = {}));
/**
* Generation Status.
* @export
* @enum {string}
*/
var GenerationStatus;
(function (GenerationStatus) {
GenerationStatus["Completed"] = "Completed";
GenerationStatus["InProgress"] = "InProgress";
})(GenerationStatus || (exports.GenerationStatus = GenerationStatus = {}));
/**
* Reasons that make a shipment service offering ineligible.
* @export
* @enum {string}
*/
var IneligibilityReasonCode;
(function (IneligibilityReasonCode) {
IneligibilityReasonCode["NoCoverage"] = "NO_COVERAGE";
IneligibilityReasonCode["PickupSlotRestriction"] = "PICKUP_SLOT_RESTRICTION";
IneligibilityReasonCode["UnsupportedVas"] = "UNSUPPORTED_VAS";
IneligibilityReasonCode["VasCombinationRestriction"] = "VAS_COMBINATION_RESTRICTION";
IneligibilityReasonCode["SizeRestrictions"] = "SIZE_RESTRICTIONS";
IneligibilityReasonCode["WeightRestrictions"] = "WEIGHT_RESTRICTIONS";
IneligibilityReasonCode["LateDelivery"] = "LATE_DELIVERY";
IneligibilityReasonCode["ProgramConstraints"] = "PROGRAM_CONSTRAINTS";
IneligibilityReasonCode["TermsAndConditionsNotAccepted"] = "TERMS_AND_CONDITIONS_NOT_ACCEPTED";
IneligibilityReasonCode["Unknown"] = "UNKNOWN";
})(IneligibilityReasonCode || (exports.IneligibilityReasonCode = IneligibilityReasonCode = {}));
/**
* Type of Input.
* @export
* @enum {string}
*/
var InputType;
(function (InputType) {
InputType["Textbox"] = "TEXTBOX";
InputType["Password"] = "PASSWORD";
})(InputType || (exports.InputType = InputType = {}));
/**
* @export
* @enum {string}
*/
var LiquidVolumeUnitEnum;
(function (LiquidVolumeUnitEnum) {
LiquidVolumeUnitEnum["Ml"] = "ML";
LiquidVolumeUnitEnum["L"] = "L";
LiquidVolumeUnitEnum["FlOz"] = "FL_OZ";
LiquidVolumeUnitEnum["Gal"] = "GAL";
LiquidVolumeUnitEnum["Pt"] = "PT";
LiquidVolumeUnitEnum["Qt"] = "QT";
LiquidVolumeUnitEnum["C"] = "C";
})(LiquidVolumeUnitEnum || (exports.LiquidVolumeUnitEnum = LiquidVolumeUnitEnum = {}));
/**
* Payment type of the purchase.
* @export
* @enum {string}
*/
var PaymentType;
(function (PaymentType) {
PaymentType["ThroughAmazon"] = "PAY_THROUGH_AMAZON";
PaymentType["DirectToCarrier"] = "PAY_DIRECT_TO_CARRIER";
})(PaymentType || (exports.PaymentType = PaymentType = {}));
/**
* Unique ID for the rateItem.
* @export
* @enum {string}
*/
var RateItemID;
(function (RateItemID) {
RateItemID["BaseRate"] = "BASE_RATE";
RateItemID["TransactionFee"] = "TRANSACTION_FEE";
RateItemID["AdultSignatureConfirmation"] = "ADULT_SIGNATURE_CONFIRMATION";
RateItemID["SignatureConfirmation"] = "SIGNATURE_CONFIRMATION";
RateItemID["NoConfirmation"] = "NO_CONFIRMATION";
RateItemID["WaiveSignature"] = "WAIVE_SIGNATURE";
RateItemID["ImpliedLiability"] = "IMPLIED_LIABILITY";
RateItemID["HiddenPostage"] = "HIDDEN_POSTAGE";
RateItemID["DeclaredValue"] = "DECLARED_VALUE";
RateItemID["SundayHolidayDelivery"] = "SUNDAY_HOLIDAY_DELIVERY";
RateItemID["DeliveryConfirmation"] = "DELIVERY_CONFIRMATION";
RateItemID["ImportDutyCharge"] = "IMPORT_DUTY_CHARGE";
RateItemID["Vat"] = "VAT";
RateItemID["NoSaturdayDelivery"] = "NO_SATURDAY_DELIVERY";
RateItemID["Insurance"] = "INSURANCE";
RateItemID["Cod"] = "COD";
RateItemID["FuelSurcharge"] = "FUEL_SURCHARGE";
RateItemID["InspectionCharge"] = "INSPECTION_CHARGE";
RateItemID["DeliveryAreaSurcharge"] = "DELIVERY_AREA_SURCHARGE";
RateItemID["WaybillCharge"] = "WAYBILL_CHARGE";
RateItemID["AmazonSponsoredDiscount"] = "AMAZON_SPONSORED_DISCOUNT";
RateItemID["IntegratorSponsoredDiscount"] = "INTEGRATOR_SPONSORED_DISCOUNT";
RateItemID["OversizeSurcharge"] = "OVERSIZE_SURCHARGE";
RateItemID["CongestionCharge"] = "CONGESTION_CHARGE";
RateItemID["ResidentialSurcharge"] = "RESIDENTIAL_SURCHARGE";
RateItemID["AdditionalSurcharge"] = "ADDITIONAL_SURCHARGE";
RateItemID["Surcharge"] = "SURCHARGE";
RateItemID["Rebate"] = "REBATE";
})(RateItemID || (exports.RateItemID = RateItemID = {}));
/**
* Type of the rateItem.
* @export
* @enum {string}
*/
var RateItemType;
(function (RateItemType) {
RateItemType["Mandatory"] = "MANDATORY";
RateItemType["Optional"] = "OPTIONAL";
RateItemType["Included"] = "INCLUDED";
})(RateItemType || (exports.RateItemType = RateItemType = {}));
/**
* Shipment type.
* @export
* @enum {string}
*/
var ShipmentType;
(function (ShipmentType) {
ShipmentType["Forward"] = "FORWARD";
ShipmentType["Returns"] = "RETURNS";
})(ShipmentType || (exports.ShipmentType = ShipmentType = {}));
/**
* The status of the package being shipped.
* @export
* @enum {string}
*/
var Status;
(function (Status) {
Status["PreTransit"] = "PreTransit";
Status["InTransit"] = "InTransit";
Status["Delivered"] = "Delivered";
Status["Lost"] = "Lost";
Status["OutForDelivery"] = "OutForDelivery";
Status["Rejected"] = "Rejected";
Status["Undeliverable"] = "Undeliverable";
Status["DeliveryAttempted"] = "DeliveryAttempted";
Status["PickupCancelled"] = "PickupCancelled";
})(Status || (exports.Status = Status = {}));
/**
* Indicates the type of tax.
* @export
* @enum {string}
*/
var TaxType;
(function (TaxType) {
TaxType["Gst"] = "GST";
})(TaxType || (exports.TaxType = TaxType = {}));
/**
* @export
* @enum {string}
*/
var WeightUnitEnum;
(function (WeightUnitEnum) {
WeightUnitEnum["Gram"] = "GRAM";
WeightUnitEnum["Kilogram"] = "KILOGRAM";
WeightUnitEnum["Ounce"] = "OUNCE";
WeightUnitEnum["Pound"] = "POUND";
})(WeightUnitEnum || (exports.WeightUnitEnum = WeightUnitEnum = {}));
/**
* ShippingApi - axios parameter creator
* @export
*/
const ShippingApiAxiosParamCreator = function (configuration) {
return {
/**
* Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {string} shipmentId The shipment identifier originally returned by the purchaseShipment operation.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cancelShipment: async (shipmentId, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('cancelShipment', 'shipmentId', shipmentId);
const localVarPath = `/shipping/v2/shipments/{shipmentId}/cancel`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related details and documents. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {DirectPurchaseRequest} body
* @param {string} [xAmznIdempotencyKey] A unique value which the server uses to recognize subsequent retries of the same request.
* @param {string} [locale] The IETF Language Tag. Note that this only supports the primary language subtag with one secondary language subtag (i.e. en-US, fr-CA). The secondary language subtag is almost always a regional designation. This does not support additional subtags beyond the primary and secondary language subtags.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
directPurchaseShipment: async (body, xAmznIdempotencyKey, locale, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('directPurchaseShipment', 'body', body);
const localVarPath = `/shipping/v2/shipments/directPurchase`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznIdempotencyKey !== undefined && xAmznIdempotencyKey !== null) {
localVarHeaderParameter['x-amzn-IdempotencyKey'] = String(xAmznIdempotencyKey);
}
if (locale !== undefined && locale !== null) {
localVarHeaderParameter['locale'] = String(locale);
}
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This API Call to generate the collection form. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {GenerateCollectionFormRequest} body
* @param {string} [xAmznIdempotencyKey] A unique value which the server uses to recognize subsequent retries of the same request.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
generateCollectionForm: async (body, xAmznIdempotencyKey, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('generateCollectionForm', 'body', body);
const localVarPath = `/shipping/v2/collectionForms`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznIdempotencyKey !== undefined && xAmznIdempotencyKey !== null) {
localVarHeaderParameter['x-amzn-IdempotencyKey'] = String(xAmznIdempotencyKey);
}
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns a list of access points in proximity of input postal code. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {Array<'HELIX' | 'CAMPUS_LOCKER' | 'OMNI_LOCKER' | 'ODIN_LOCKER' | 'DOBBY_LOCKER' | 'CORE_LOCKER' | '3P' | 'CAMPUS_ROOM'>} accessPointTypes
* @param {string} countryCode
* @param {string} postalCode
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAccessPoints: async (accessPointTypes, countryCode, postalCode, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'accessPointTypes' is not null or undefined
(0, common_1.assertParamExists)('getAccessPoints', 'accessPointTypes', accessPointTypes);
// verify required parameter 'countryCode' is not null or undefined
(0, common_1.assertParamExists)('getAccessPoints', 'countryCode', countryCode);
// verify required parameter 'postalCode' is not null or undefined
(0, common_1.assertParamExists)('getAccessPoints', 'postalCode', postalCode);
const localVarPath = `/shipping/v2/accessPoints`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (accessPointTypes) {
localVarQueryParameter['accessPointTypes'] = accessPointTypes.join(base_1.COLLECTION_FORMATS.csv);
}
if (countryCode !== undefined) {
localVarQueryParameter['countryCode'] = countryCode;
}
if (postalCode !== undefined) {
localVarQueryParameter['postalCode'] = postalCode;
}
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {string} requestToken The request token returned in the response to the getRates operation.
* @param {string} rateId The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAdditionalInputs: async (requestToken, rateId, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'requestToken' is not null or undefined
(0, common_1.assertParamExists)('getAdditionalInputs', 'requestToken', requestToken);
// verify required parameter 'rateId' is not null or undefined
(0, common_1.assertParamExists)('getAdditionalInputs', 'rateId', rateId);
const localVarPath = `/shipping/v2/shipments/additionalInputs/schema`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (requestToken !== undefined) {
localVarQueryParameter['requestToken'] = requestToken;
}
if (rateId !== undefined) {
localVarQueryParameter['rateId'] = rateId;
}
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This API will return a list of input schema required to register a shipper account with the carrier. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCarrierAccountFormInputs: async (xAmznShippingBusinessId, options = {}) => {
const localVarPath = `/shipping/v2/carrierAccountFormInputs`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This API will return Get all carrier accounts for a merchant. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {GetCarrierAccountsRequest} body
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCarrierAccounts: async (body, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getCarrierAccounts', 'body', body);
const localVarPath = `/shipping/v2/carrierAccounts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This API reprint a collection form. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {string} collectionFormId collection form Id to reprint a collection.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCollectionForm: async (collectionFormId, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'collectionFormId' is not null or undefined
(0, common_1.assertParamExists)('getCollectionForm', 'collectionFormId', collectionFormId);
const localVarPath = `/shipping/v2/collectionForms/{collectionFormId}`
.replace(`{${"collectionFormId"}}`, encodeURIComponent(String(collectionFormId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* This API Call to get the history of the previously generated collection forms. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {GetCollectionFormHistoryRequest} body
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCollectionFormHistory: async (body, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getCollectionFormHistory', 'body', body);
const localVarPath = `/shipping/v2/collectionForms/history`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the available shipping service offerings. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {GetRatesRequest} body
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getRates: async (body, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getRates', 'body', body);
const localVarPath = `/shipping/v2/shipments/rates`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the shipping documents associated with a package in a shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | 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 then 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).
* @param {string} shipmentId The shipment identifier originally returned by the purchaseShipment operation.
* @param {string} packageClientReferenceId The package client reference identifier originally provided in the request body parameter for the getRates operation.
* @param {string} [format] The file format of the document. Must be one of the supported formats returned by the getRates operation.
* @param {number} [dpi] The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.
* @param {'AmazonShipping_US' | 'AmazonShipping_IN' | 'AmazonShipping_UK' | 'AmazonShipping_UAE' | 'AmazonShipping_SA' | 'AmazonShipping_EG' | 'AmazonShipping_IT' | 'AmazonShipping_ES' | 'AmazonShipping_FR' | 'AmazonShipping_JP'} [xAmznShippingBusinessId] Amazon shipping business to assume for this request. The default is AmazonShipping_UK.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getShipmentDocuments: async (shipmentId, packageClientReferenceId, format, dpi, xAmznShippingBusinessId, options = {}) => {
// verify required parameter 'shipmentId' is not null or undefined
(0, common_1.assertParamExists)('getShipmentDocuments', 'shipmentId', shipmentId);
// verify required parameter 'packageClientReferenceId' is not null or undefined
(0, common_1.assertParamExists)('getShipmentDocuments', 'packageClientReferenceId', packageClientReferenceId);
const localVarPath = `/shipping/v2/shipments/{shipmentId}/documents`
.replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (packageClientReferenceId !== undefined) {
localVarQueryParameter['packageClientReferenceId'] = packageClientReferenceId;
}
if (format !== undefined) {
localVarQueryParameter['format'] = format;
}
if (dpi !== undefined) {
localVarQueryParameter['dpi'] = dpi;
}
if (xAmznShippingBusinessId !== undefined && xAmznShippingBusinessId !== null) {
localVarHeaderParameter['x-amzn-shipping-business-id'] = String(xAmznShippingBusinessId);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns tracking information for a purchased shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 80 | 100 | The `x-