@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
310 lines • 23.3 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Pricing
* The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer pricing information for Amazon Marketplace products. For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
*
* The version of the OpenAPI document: 2022-05-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.ProductPricingApi = exports.ProductPricingApiFactory = exports.ProductPricingApiFp = exports.ProductPricingApiAxiosParamCreator = exports.ShippingOptionShippingOptionTypeEnum = exports.SegmentedFeaturedOfferSubConditionEnum = exports.PrimeDetailsEligibilityEnum = exports.OfferSubConditionEnum = exports.LowestPricedOffersInputOfferTypeEnum = exports.HttpMethod = exports.FulfillmentType = exports.FeaturedOfferSegmentCustomerMembershipEnum = exports.FeaturedBuyingOptionBuyingOptionTypeEnum = exports.Condition = exports.CompetitiveSummaryIncludedData = 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");
/**
* The supported data types in the `getCompetitiveSummary` API.
* @export
* @enum {string}
*/
var CompetitiveSummaryIncludedData;
(function (CompetitiveSummaryIncludedData) {
CompetitiveSummaryIncludedData["FeaturedBuyingOptions"] = "featuredBuyingOptions";
CompetitiveSummaryIncludedData["ReferencePrices"] = "referencePrices";
CompetitiveSummaryIncludedData["LowestPricedOffers"] = "lowestPricedOffers";
})(CompetitiveSummaryIncludedData || (exports.CompetitiveSummaryIncludedData = CompetitiveSummaryIncludedData = {}));
/**
* The condition of the item.
* @export
* @enum {string}
*/
var Condition;
(function (Condition) {
Condition["New"] = "New";
Condition["Used"] = "Used";
Condition["Collectible"] = "Collectible";
Condition["Refurbished"] = "Refurbished";
Condition["Club"] = "Club";
})(Condition || (exports.Condition = Condition = {}));
/**
* @export
* @enum {string}
*/
var FeaturedBuyingOptionBuyingOptionTypeEnum;
(function (FeaturedBuyingOptionBuyingOptionTypeEnum) {
FeaturedBuyingOptionBuyingOptionTypeEnum["New"] = "New";
})(FeaturedBuyingOptionBuyingOptionTypeEnum || (exports.FeaturedBuyingOptionBuyingOptionTypeEnum = FeaturedBuyingOptionBuyingOptionTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var FeaturedOfferSegmentCustomerMembershipEnum;
(function (FeaturedOfferSegmentCustomerMembershipEnum) {
FeaturedOfferSegmentCustomerMembershipEnum["Prime"] = "PRIME";
FeaturedOfferSegmentCustomerMembershipEnum["NonPrime"] = "NON_PRIME";
})(FeaturedOfferSegmentCustomerMembershipEnum || (exports.FeaturedOfferSegmentCustomerMembershipEnum = FeaturedOfferSegmentCustomerMembershipEnum = {}));
/**
* Indicates whether the item is fulfilled by Amazon or by the seller (merchant).
* @export
* @enum {string}
*/
var FulfillmentType;
(function (FulfillmentType) {
FulfillmentType["Afn"] = "AFN";
FulfillmentType["Mfn"] = "MFN";
})(FulfillmentType || (exports.FulfillmentType = FulfillmentType = {}));
/**
* The HTTP method associated with an individual request within a batch.
* @export
* @enum {string}
*/
var HttpMethod;
(function (HttpMethod) {
HttpMethod["Get"] = "GET";
HttpMethod["Put"] = "PUT";
HttpMethod["Patch"] = "PATCH";
HttpMethod["Delete"] = "DELETE";
HttpMethod["Post"] = "POST";
})(HttpMethod || (exports.HttpMethod = HttpMethod = {}));
/**
* @export
* @enum {string}
*/
var LowestPricedOffersInputOfferTypeEnum;
(function (LowestPricedOffersInputOfferTypeEnum) {
LowestPricedOffersInputOfferTypeEnum["Consumer"] = "CONSUMER";
})(LowestPricedOffersInputOfferTypeEnum || (exports.LowestPricedOffersInputOfferTypeEnum = LowestPricedOffersInputOfferTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var OfferSubConditionEnum;
(function (OfferSubConditionEnum) {
OfferSubConditionEnum["New"] = "New";
OfferSubConditionEnum["Mint"] = "Mint";
OfferSubConditionEnum["VeryGood"] = "VeryGood";
OfferSubConditionEnum["Good"] = "Good";
OfferSubConditionEnum["Acceptable"] = "Acceptable";
OfferSubConditionEnum["Poor"] = "Poor";
OfferSubConditionEnum["Club"] = "Club";
OfferSubConditionEnum["Oem"] = "OEM";
OfferSubConditionEnum["Warranty"] = "Warranty";
OfferSubConditionEnum["RefurbishedWarranty"] = "RefurbishedWarranty";
OfferSubConditionEnum["Refurbished"] = "Refurbished";
OfferSubConditionEnum["OpenBox"] = "OpenBox";
OfferSubConditionEnum["Other"] = "Other";
})(OfferSubConditionEnum || (exports.OfferSubConditionEnum = OfferSubConditionEnum = {}));
/**
* @export
* @enum {string}
*/
var PrimeDetailsEligibilityEnum;
(function (PrimeDetailsEligibilityEnum) {
PrimeDetailsEligibilityEnum["National"] = "NATIONAL";
PrimeDetailsEligibilityEnum["Regional"] = "REGIONAL";
PrimeDetailsEligibilityEnum["None"] = "NONE";
})(PrimeDetailsEligibilityEnum || (exports.PrimeDetailsEligibilityEnum = PrimeDetailsEligibilityEnum = {}));
/**
* @export
* @enum {string}
*/
var SegmentedFeaturedOfferSubConditionEnum;
(function (SegmentedFeaturedOfferSubConditionEnum) {
SegmentedFeaturedOfferSubConditionEnum["New"] = "New";
SegmentedFeaturedOfferSubConditionEnum["Mint"] = "Mint";
SegmentedFeaturedOfferSubConditionEnum["VeryGood"] = "VeryGood";
SegmentedFeaturedOfferSubConditionEnum["Good"] = "Good";
SegmentedFeaturedOfferSubConditionEnum["Acceptable"] = "Acceptable";
SegmentedFeaturedOfferSubConditionEnum["Poor"] = "Poor";
SegmentedFeaturedOfferSubConditionEnum["Club"] = "Club";
SegmentedFeaturedOfferSubConditionEnum["Oem"] = "OEM";
SegmentedFeaturedOfferSubConditionEnum["Warranty"] = "Warranty";
SegmentedFeaturedOfferSubConditionEnum["RefurbishedWarranty"] = "RefurbishedWarranty";
SegmentedFeaturedOfferSubConditionEnum["Refurbished"] = "Refurbished";
SegmentedFeaturedOfferSubConditionEnum["OpenBox"] = "OpenBox";
SegmentedFeaturedOfferSubConditionEnum["Other"] = "Other";
})(SegmentedFeaturedOfferSubConditionEnum || (exports.SegmentedFeaturedOfferSubConditionEnum = SegmentedFeaturedOfferSubConditionEnum = {}));
/**
* @export
* @enum {string}
*/
var ShippingOptionShippingOptionTypeEnum;
(function (ShippingOptionShippingOptionTypeEnum) {
ShippingOptionShippingOptionTypeEnum["Default"] = "DEFAULT";
})(ShippingOptionShippingOptionTypeEnum || (exports.ShippingOptionShippingOptionTypeEnum = ShippingOptionShippingOptionTypeEnum = {}));
/**
* ProductPricingApi - axios parameter creator
* @export
*/
const ProductPricingApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {CompetitiveSummaryBatchRequest} requests The batch of `getCompetitiveSummary` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCompetitiveSummary: async (requests, options = {}) => {
// verify required parameter 'requests' is not null or undefined
(0, common_1.assertParamExists)('getCompetitiveSummary', 'requests', requests);
const localVarPath = `/batches/products/pricing/2022-05-01/items/competitiveSummary`;
// 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 = {};
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)(requests, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {GetFeaturedOfferExpectedPriceBatchRequest} getFeaturedOfferExpectedPriceBatchRequestBody The batch of `getFeaturedOfferExpectedPrice` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFeaturedOfferExpectedPriceBatch: async (getFeaturedOfferExpectedPriceBatchRequestBody, options = {}) => {
// verify required parameter 'getFeaturedOfferExpectedPriceBatchRequestBody' is not null or undefined
(0, common_1.assertParamExists)('getFeaturedOfferExpectedPriceBatch', 'getFeaturedOfferExpectedPriceBatchRequestBody', getFeaturedOfferExpectedPriceBatchRequestBody);
const localVarPath = `/batches/products/pricing/2022-05-01/offer/featuredOfferExpectedPrice`;
// 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 = {};
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)(getFeaturedOfferExpectedPriceBatchRequestBody, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.ProductPricingApiAxiosParamCreator = ProductPricingApiAxiosParamCreator;
/**
* ProductPricingApi - functional programming interface
* @export
*/
const ProductPricingApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.ProductPricingApiAxiosParamCreator)(configuration);
return {
/**
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {CompetitiveSummaryBatchRequest} requests The batch of `getCompetitiveSummary` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCompetitiveSummary(requests, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCompetitiveSummary(requests, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {GetFeaturedOfferExpectedPriceBatchRequest} getFeaturedOfferExpectedPriceBatchRequestBody The batch of `getFeaturedOfferExpectedPrice` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.ProductPricingApiFp = ProductPricingApiFp;
/**
* ProductPricingApi - factory interface
* @export
*/
const ProductPricingApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.ProductPricingApiFp)(configuration);
return {
/**
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {CompetitiveSummaryBatchRequest} requests The batch of `getCompetitiveSummary` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCompetitiveSummary(requests, options) {
return localVarFp.getCompetitiveSummary(requests, options).then((request) => request(axios, basePath));
},
/**
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {GetFeaturedOfferExpectedPriceBatchRequest} getFeaturedOfferExpectedPriceBatchRequestBody The batch of `getFeaturedOfferExpectedPrice` requests.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options) {
return localVarFp.getFeaturedOfferExpectedPriceBatch(getFeaturedOfferExpectedPriceBatchRequestBody, options).then((request) => request(axios, basePath));
},
};
};
exports.ProductPricingApiFactory = ProductPricingApiFactory;
/**
* ProductPricingApi - object-oriented interface
* @export
* @class ProductPricingApi
* @extends {BaseAPI}
*/
class ProductPricingApi extends base_1.BaseAPI {
/**
* Returns the competitive summary response, including featured buying options for the ASIN and `marketplaceId` combination. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {ProductPricingApiGetCompetitiveSummaryRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProductPricingApi
*/
getCompetitiveSummary(requestParameters, options) {
return (0, exports.ProductPricingApiFp)(this.configuration).getCompetitiveSummary(requestParameters.requests, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns the set of responses that correspond to the batched list of up to 40 requests defined in the request body. The response for each successful (HTTP status code 200) request in the set includes the computed listing price at or below which a seller can expect to become the featured offer (before applicable promotions). This is called the featured offer expected price (FOEP). Featured offer is not guaranteed because competing offers might change. Other offers might be featured based on factors such as fulfillment capabilities to a specific customer. The response to an unsuccessful request includes the available error text. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.033 | 1 | 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 may receive 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) in the Selling Partner API.
* @param {ProductPricingApiGetFeaturedOfferExpectedPriceBatchRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ProductPricingApi
*/
getFeaturedOfferExpectedPriceBatch(requestParameters, options) {
return (0, exports.ProductPricingApiFp)(this.configuration).getFeaturedOfferExpectedPriceBatch(requestParameters.getFeaturedOfferExpectedPriceBatchRequestBody, options).then((request) => request(this.axios, this.basePath));
}
}
exports.ProductPricingApi = ProductPricingApi;
//# sourceMappingURL=api.js.map