@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
545 lines • 72.3 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Listings Items
* The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API. For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
*
* The version of the OpenAPI document: 2021-08-01
*
*
* 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.ListingsApi = exports.ListingsApiFactory = exports.ListingsApiFp = exports.ListingsApiAxiosParamCreator = exports.PatchOperationOpEnum = exports.ListingsItemSubmissionResponseStatusEnum = exports.ListingsItemPutRequestRequirementsEnum = exports.ItemSummaryByMarketplaceStatusEnum = exports.ItemSummaryByMarketplaceConditionTypeEnum = exports.ItemRelationshipTypeEnum = exports.ItemOfferByMarketplaceOfferTypeEnum = exports.IssueExemptionStatusEnum = exports.IssueSeverityEnum = 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 IssueSeverityEnum;
(function (IssueSeverityEnum) {
IssueSeverityEnum["Error"] = "ERROR";
IssueSeverityEnum["Warning"] = "WARNING";
IssueSeverityEnum["Info"] = "INFO";
})(IssueSeverityEnum || (exports.IssueSeverityEnum = IssueSeverityEnum = {}));
/**
* @export
* @enum {string}
*/
var IssueExemptionStatusEnum;
(function (IssueExemptionStatusEnum) {
IssueExemptionStatusEnum["Exempt"] = "EXEMPT";
IssueExemptionStatusEnum["ExemptUntilExpiryDate"] = "EXEMPT_UNTIL_EXPIRY_DATE";
IssueExemptionStatusEnum["NotExempt"] = "NOT_EXEMPT";
})(IssueExemptionStatusEnum || (exports.IssueExemptionStatusEnum = IssueExemptionStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemOfferByMarketplaceOfferTypeEnum;
(function (ItemOfferByMarketplaceOfferTypeEnum) {
ItemOfferByMarketplaceOfferTypeEnum["B2C"] = "B2C";
ItemOfferByMarketplaceOfferTypeEnum["B2B"] = "B2B";
})(ItemOfferByMarketplaceOfferTypeEnum || (exports.ItemOfferByMarketplaceOfferTypeEnum = ItemOfferByMarketplaceOfferTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemRelationshipTypeEnum;
(function (ItemRelationshipTypeEnum) {
ItemRelationshipTypeEnum["Variation"] = "VARIATION";
ItemRelationshipTypeEnum["PackageHierarchy"] = "PACKAGE_HIERARCHY";
})(ItemRelationshipTypeEnum || (exports.ItemRelationshipTypeEnum = ItemRelationshipTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemSummaryByMarketplaceConditionTypeEnum;
(function (ItemSummaryByMarketplaceConditionTypeEnum) {
ItemSummaryByMarketplaceConditionTypeEnum["NewNew"] = "new_new";
ItemSummaryByMarketplaceConditionTypeEnum["NewOpenBox"] = "new_open_box";
ItemSummaryByMarketplaceConditionTypeEnum["NewOem"] = "new_oem";
ItemSummaryByMarketplaceConditionTypeEnum["RefurbishedRefurbished"] = "refurbished_refurbished";
ItemSummaryByMarketplaceConditionTypeEnum["UsedLikeNew"] = "used_like_new";
ItemSummaryByMarketplaceConditionTypeEnum["UsedVeryGood"] = "used_very_good";
ItemSummaryByMarketplaceConditionTypeEnum["UsedGood"] = "used_good";
ItemSummaryByMarketplaceConditionTypeEnum["UsedAcceptable"] = "used_acceptable";
ItemSummaryByMarketplaceConditionTypeEnum["CollectibleLikeNew"] = "collectible_like_new";
ItemSummaryByMarketplaceConditionTypeEnum["CollectibleVeryGood"] = "collectible_very_good";
ItemSummaryByMarketplaceConditionTypeEnum["CollectibleGood"] = "collectible_good";
ItemSummaryByMarketplaceConditionTypeEnum["CollectibleAcceptable"] = "collectible_acceptable";
ItemSummaryByMarketplaceConditionTypeEnum["ClubClub"] = "club_club";
})(ItemSummaryByMarketplaceConditionTypeEnum || (exports.ItemSummaryByMarketplaceConditionTypeEnum = ItemSummaryByMarketplaceConditionTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemSummaryByMarketplaceStatusEnum;
(function (ItemSummaryByMarketplaceStatusEnum) {
ItemSummaryByMarketplaceStatusEnum["Buyable"] = "BUYABLE";
ItemSummaryByMarketplaceStatusEnum["Discoverable"] = "DISCOVERABLE";
})(ItemSummaryByMarketplaceStatusEnum || (exports.ItemSummaryByMarketplaceStatusEnum = ItemSummaryByMarketplaceStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var ListingsItemPutRequestRequirementsEnum;
(function (ListingsItemPutRequestRequirementsEnum) {
ListingsItemPutRequestRequirementsEnum["Listing"] = "LISTING";
ListingsItemPutRequestRequirementsEnum["ListingProductOnly"] = "LISTING_PRODUCT_ONLY";
ListingsItemPutRequestRequirementsEnum["ListingOfferOnly"] = "LISTING_OFFER_ONLY";
})(ListingsItemPutRequestRequirementsEnum || (exports.ListingsItemPutRequestRequirementsEnum = ListingsItemPutRequestRequirementsEnum = {}));
/**
* @export
* @enum {string}
*/
var ListingsItemSubmissionResponseStatusEnum;
(function (ListingsItemSubmissionResponseStatusEnum) {
ListingsItemSubmissionResponseStatusEnum["Accepted"] = "ACCEPTED";
ListingsItemSubmissionResponseStatusEnum["Invalid"] = "INVALID";
ListingsItemSubmissionResponseStatusEnum["Valid"] = "VALID";
})(ListingsItemSubmissionResponseStatusEnum || (exports.ListingsItemSubmissionResponseStatusEnum = ListingsItemSubmissionResponseStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var PatchOperationOpEnum;
(function (PatchOperationOpEnum) {
PatchOperationOpEnum["Add"] = "add";
PatchOperationOpEnum["Replace"] = "replace";
PatchOperationOpEnum["Delete"] = "delete";
})(PatchOperationOpEnum || (exports.PatchOperationOpEnum = PatchOperationOpEnum = {}));
/**
* ListingsApi - axios parameter creator
* @export
*/
const ListingsApiAxiosParamCreator = function (configuration) {
return {
/**
* Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
deleteListingsItem: async (sellerId, sku, marketplaceIds, issueLocale, options = {}) => {
// verify required parameter 'sellerId' is not null or undefined
(0, common_1.assertParamExists)('deleteListingsItem', 'sellerId', sellerId);
// verify required parameter 'sku' is not null or undefined
(0, common_1.assertParamExists)('deleteListingsItem', 'sku', sku);
// verify required parameter 'marketplaceIds' is not null or undefined
(0, common_1.assertParamExists)('deleteListingsItem', 'marketplaceIds', marketplaceIds);
const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}`
.replace(`{${"sellerId"}}`, encodeURIComponent(String(sellerId)))
.replace(`{${"sku"}}`, encodeURIComponent(String(sku)));
// 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: 'DELETE', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (marketplaceIds) {
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
}
if (issueLocale !== undefined) {
localVarQueryParameter['issueLocale'] = issueLocale;
}
(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 details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {Array<'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' | 'relationships' | 'productTypes'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `summaries`.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getListingsItem: async (sellerId, sku, marketplaceIds, issueLocale, includedData, options = {}) => {
// verify required parameter 'sellerId' is not null or undefined
(0, common_1.assertParamExists)('getListingsItem', 'sellerId', sellerId);
// verify required parameter 'sku' is not null or undefined
(0, common_1.assertParamExists)('getListingsItem', 'sku', sku);
// verify required parameter 'marketplaceIds' is not null or undefined
(0, common_1.assertParamExists)('getListingsItem', 'marketplaceIds', marketplaceIds);
const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}`
.replace(`{${"sellerId"}}`, encodeURIComponent(String(sellerId)))
.replace(`{${"sku"}}`, encodeURIComponent(String(sku)));
// 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 (marketplaceIds) {
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
}
if (issueLocale !== undefined) {
localVarQueryParameter['issueLocale'] = issueLocale;
}
if (includedData) {
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
}
(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,
};
},
/**
* Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation.
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {ListingsItemPatchRequest} body The request body schema for the `patchListingsItem` operation.
* @param {Array<'identifiers' | 'issues'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `issues`.
* @param {'VALIDATION_PREVIEW'} [mode] The mode of operation for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
patchListingsItem: async (sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options = {}) => {
// verify required parameter 'sellerId' is not null or undefined
(0, common_1.assertParamExists)('patchListingsItem', 'sellerId', sellerId);
// verify required parameter 'sku' is not null or undefined
(0, common_1.assertParamExists)('patchListingsItem', 'sku', sku);
// verify required parameter 'marketplaceIds' is not null or undefined
(0, common_1.assertParamExists)('patchListingsItem', 'marketplaceIds', marketplaceIds);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('patchListingsItem', 'body', body);
const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}`
.replace(`{${"sellerId"}}`, encodeURIComponent(String(sellerId)))
.replace(`{${"sku"}}`, encodeURIComponent(String(sku)));
// 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: 'PATCH', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (marketplaceIds) {
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
}
if (includedData) {
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
}
if (mode !== undefined) {
localVarQueryParameter['mode'] = mode;
}
if (issueLocale !== undefined) {
localVarQueryParameter['issueLocale'] = issueLocale;
}
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,
};
},
/**
* Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {ListingsItemPutRequest} body The request body schema for the `putListingsItem` operation.
* @param {Array<'identifiers' | 'issues'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `issues`.
* @param {'VALIDATION_PREVIEW'} [mode] The mode of operation for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
putListingsItem: async (sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options = {}) => {
// verify required parameter 'sellerId' is not null or undefined
(0, common_1.assertParamExists)('putListingsItem', 'sellerId', sellerId);
// verify required parameter 'sku' is not null or undefined
(0, common_1.assertParamExists)('putListingsItem', 'sku', sku);
// verify required parameter 'marketplaceIds' is not null or undefined
(0, common_1.assertParamExists)('putListingsItem', 'marketplaceIds', marketplaceIds);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('putListingsItem', 'body', body);
const localVarPath = `/listings/2021-08-01/items/{sellerId}/{sku}`
.replace(`{${"sellerId"}}`, encodeURIComponent(String(sellerId)))
.replace(`{${"sku"}}`, encodeURIComponent(String(sku)));
// 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 (marketplaceIds) {
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
}
if (includedData) {
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
}
if (mode !== undefined) {
localVarQueryParameter['mode'] = mode;
}
if (issueLocale !== undefined) {
localVarQueryParameter['issueLocale'] = issueLocale;
}
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,
};
},
/**
* Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\".
* @param {Array<'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' | 'relationships' | 'productTypes'>} [includedData] A comma-delimited list of datasets that you want to include in the response. Default: `summaries`.
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use \'identifiers\' if you specify `variationParentSku` or `packageHierarchySku`.
* @param {'ASIN' | 'EAN' | 'FNSKU' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC'} [identifiersType] A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided.
* @param {string} [variationParentSku] Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request.
* @param {string} [packageHierarchySku] Filter results to include listing items that contain or are contained by the specified SKU. **Note**: You cannot use `packageHierarchySku` if you include `identifiers` or `variationParentSku` in your request.
* @param {string} [createdAfter] A date-time that is used to filter listing items. The response includes listings items that were created at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [createdBefore] A date-time that is used to filter listing items. The response includes listings items that were created at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [lastUpdatedAfter] A date-time that is used to filter listing items. The response includes listings items that were last updated at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [lastUpdatedBefore] A date-time that is used to filter listing items. The response includes listings items that were last updated at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {Array<'WARNING' | 'ERROR'>} [withIssueSeverity] Filter results to include only listing items that have issues that match one or more of the specified severity levels.
* @param {Array<'BUYABLE' | 'DISCOVERABLE'>} [withStatus] Filter results to include only listing items that have the specified status.
* @param {Array<'BUYABLE' | 'DISCOVERABLE'>} [withoutStatus] Filter results to include only listing items that don\'t contain the specified statuses.
* @param {'sku' | 'createdDate' | 'lastUpdatedDate'} [sortBy] An attribute by which to sort the returned listing items.
* @param {'ASC' | 'DESC'} [sortOrder] The order in which to sort the result items.
* @param {number} [pageSize] The number of results that you want to include on each page.
* @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchListingsItems: async (sellerId, marketplaceIds, issueLocale, includedData, identifiers, identifiersType, variationParentSku, packageHierarchySku, createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, withIssueSeverity, withStatus, withoutStatus, sortBy, sortOrder, pageSize, pageToken, options = {}) => {
// verify required parameter 'sellerId' is not null or undefined
(0, common_1.assertParamExists)('searchListingsItems', 'sellerId', sellerId);
// verify required parameter 'marketplaceIds' is not null or undefined
(0, common_1.assertParamExists)('searchListingsItems', 'marketplaceIds', marketplaceIds);
const localVarPath = `/listings/2021-08-01/items/{sellerId}`
.replace(`{${"sellerId"}}`, encodeURIComponent(String(sellerId)));
// 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 (marketplaceIds) {
localVarQueryParameter['marketplaceIds'] = marketplaceIds.join(base_1.COLLECTION_FORMATS.csv);
}
if (issueLocale !== undefined) {
localVarQueryParameter['issueLocale'] = issueLocale;
}
if (includedData) {
localVarQueryParameter['includedData'] = includedData.join(base_1.COLLECTION_FORMATS.csv);
}
if (identifiers) {
localVarQueryParameter['identifiers'] = identifiers.join(base_1.COLLECTION_FORMATS.csv);
}
if (identifiersType !== undefined) {
localVarQueryParameter['identifiersType'] = identifiersType;
}
if (variationParentSku !== undefined) {
localVarQueryParameter['variationParentSku'] = variationParentSku;
}
if (packageHierarchySku !== undefined) {
localVarQueryParameter['packageHierarchySku'] = packageHierarchySku;
}
if (createdAfter !== undefined) {
localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
createdAfter.toISOString() :
createdAfter;
}
if (createdBefore !== undefined) {
localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
createdBefore.toISOString() :
createdBefore;
}
if (lastUpdatedAfter !== undefined) {
localVarQueryParameter['lastUpdatedAfter'] = (lastUpdatedAfter instanceof Date) ?
lastUpdatedAfter.toISOString() :
lastUpdatedAfter;
}
if (lastUpdatedBefore !== undefined) {
localVarQueryParameter['lastUpdatedBefore'] = (lastUpdatedBefore instanceof Date) ?
lastUpdatedBefore.toISOString() :
lastUpdatedBefore;
}
if (withIssueSeverity) {
localVarQueryParameter['withIssueSeverity'] = withIssueSeverity.join(base_1.COLLECTION_FORMATS.csv);
}
if (withStatus) {
localVarQueryParameter['withStatus'] = withStatus.join(base_1.COLLECTION_FORMATS.csv);
}
if (withoutStatus) {
localVarQueryParameter['withoutStatus'] = withoutStatus.join(base_1.COLLECTION_FORMATS.csv);
}
if (sortBy !== undefined) {
localVarQueryParameter['sortBy'] = sortBy;
}
if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (pageToken !== undefined) {
localVarQueryParameter['pageToken'] = pageToken;
}
(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,
};
},
};
};
exports.ListingsApiAxiosParamCreator = ListingsApiAxiosParamCreator;
/**
* ListingsApi - functional programming interface
* @export
*/
const ListingsApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ListingsApiAxiosParamCreator)(configuration);
return {
/**
* Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async deleteListingsItem(sellerId, sku, marketplaceIds, issueLocale, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteListingsItem(sellerId, sku, marketplaceIds, issueLocale, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns details about a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {Array<'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' | 'relationships' | 'productTypes'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `summaries`.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getListingsItem(sellerId, sku, marketplaceIds, issueLocale, includedData, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getListingsItem(sellerId, sku, marketplaceIds, issueLocale, includedData, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Partially update (patch) a listings item for a selling partner. Only top-level listings item attributes can be patched. Patching nested attributes is not supported. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that were applied to the requested operation, when available. The preceding table indicates the default rate and burst values for this operation. Selling partners whose business demands require higher throughput can receive higher rate and burst values then those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api) in the Selling Partner API documentation.
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {ListingsItemPatchRequest} body The request body schema for the `patchListingsItem` operation.
* @param {Array<'identifiers' | 'issues'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `issues`.
* @param {'VALIDATION_PREVIEW'} [mode] The mode of operation for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async patchListingsItem(sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.patchListingsItem(sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Creates or fully updates an existing listings item for a selling partner. **Note:** This operation has a throttling rate of one request per second when `mode` is `VALIDATION_PREVIEW`. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 10 | 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).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {string} sku A selling partner provided identifier for an Amazon listing.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {ListingsItemPutRequest} body The request body schema for the `putListingsItem` operation.
* @param {Array<'identifiers' | 'issues'>} [includedData] A comma-delimited list of data sets to include in the response. Default: `issues`.
* @param {'VALIDATION_PREVIEW'} [mode] The mode of operation for the request.
* @param {string} [issueLocale] A locale for localization of issues. When not provided, the default language code of the first marketplace is used. Examples: `en_US`, `fr_CA`, `fr_FR`. Localized messages default to `en_US` when a localization is not available in the specified locale.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async putListingsItem(sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.putListingsItem(sellerId, sku, marketplaceIds, body, includedData, mode, issueLocale, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Search for and return a list of selling partner listings items and their respective details. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 5 | 5 | The `x-amzn-RateLimit-Limit` response header returns the usage plan rate limits that are applied to the requested operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} sellerId A selling partner identifier, such as a merchant account or vendor code.
* @param {Array<string>} marketplaceIds A comma-delimited list of Amazon marketplace identifiers for the request.
* @param {string} [issueLocale] A locale that is used to localize issues. When not provided, the default language code of the first marketplace is used. Examples: \"en_US\", \"fr_CA\", \"fr_FR\". When a localization is not available in the specified locale, localized messages default to \"en_US\".
* @param {Array<'summaries' | 'attributes' | 'issues' | 'offers' | 'fulfillmentAvailability' | 'procurement' | 'relationships' | 'productTypes'>} [includedData] A comma-delimited list of datasets that you want to include in the response. Default: `summaries`.
* @param {Array<string>} [identifiers] A comma-delimited list of product identifiers that you can use to search for listings items. **Note**: 1. This is required when you specify `identifiersType`. 2. You cannot use \'identifiers\' if you specify `variationParentSku` or `packageHierarchySku`.
* @param {'ASIN' | 'EAN' | 'FNSKU' | 'GTIN' | 'ISBN' | 'JAN' | 'MINSAN' | 'SKU' | 'UPC'} [identifiersType] A type of product identifiers that you can use to search for listings items. **Note**: This is required when `identifiers` is provided.
* @param {string} [variationParentSku] Filters results to include listing items that are variation children of the specified SKU. **Note**: You cannot use `variationParentSku` if you include `identifiers` or `packageHierarchySku` in your request.
* @param {string} [packageHierarchySku] Filter results to include listing items that contain or are contained by the specified SKU. **Note**: You cannot use `packageHierarchySku` if you include `identifiers` or `variationParentSku` in your request.
* @param {string} [createdAfter] A date-time that is used to filter listing items. The response includes listings items that were created at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [createdBefore] A date-time that is used to filter listing items. The response includes listings items that were created at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [lastUpdatedAfter] A date-time that is used to filter listing items. The response includes listings items that were last updated at or after this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {string} [lastUpdatedBefore] A date-time that is used to filter listing items. The response includes listings items that were last updated at or before this time. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
* @param {Array<'WARNING' | 'ERROR'>} [withIssueSeverity] Filter results to include only listing items that have issues that match one or more of the specified severity levels.
* @param {Array<'BUYABLE' | 'DISCOVERABLE'>} [withStatus] Filter results to include only listing items that have the specified status.
* @param {Array<'BUYABLE' | 'DISCOVERABLE'>} [withoutStatus] Filter results to include only listing items that don\'t contain the specified statuses.
* @param {'sku' | 'createdDate' | 'lastUpdatedDate'} [sortBy] An attribute by which to sort the returned listing items.
* @param {'ASC' | 'DESC'} [sortOrder] The order in which to sort the result items.
* @param {number} [pageSize] The number of results that you want to include on each page.
* @param {string} [pageToken] A token that you can use to fetch a specific page when there are multiple pages of results.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async searchListingsItems(sellerId, marketplaceIds, issueLocale, includedData, identifiers, identifiersType, variationParentSku, packageHierarchySku, createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, withIssueSeverity, withStatus, withoutStatus, sortBy, sortOrder, pageSize, pageToken, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.searchListingsItems(sellerId, marketplaceIds, issueLocale, includedData, identifiers, identifiersType, variationParentSku, packageHierarchySku, createdAfter, createdBefore, lastUpdatedAfter, lastUpdatedBefore, withIssueSeverity, withStatus, withoutStatus, sortBy, sortOrder, pageSize, pageToken, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.ListingsApiFp = ListingsApiFp;
/**
* ListingsApi - factory interface
* @export
*/
const ListingsApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ListingsApiFp)(configuration);
return {
/**
* Delete a listings item for a selling partner. **Note:** The parameters associated with this operation may contain special characters that must be encoded to successfully call the API. To avoid errors with SKUs when encoding URLs, refer to [URL Encoding](https://developer-docs.amazon.com/sp-api/docs/url-encoding). **Usage Plan:** | Rate (requests per second) | B