@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
271 lines • 28.8 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Product Fees
* The Selling Partner API for Product Fees lets you programmatically retrieve estimated fees for a product. You can then account for those fees in your pricing.
*
* The version of the OpenAPI document: v0
*
*
* 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.FeesApi = exports.FeesApiFactory = exports.FeesApiFp = exports.FeesApiAxiosParamCreator = exports.OptionalFulfillmentProgram = exports.IdType = 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 type of product identifier used in a `FeesEstimateByIdRequest`.
* @export
* @enum {string}
*/
var IdType;
(function (IdType) {
IdType["Asin"] = "ASIN";
IdType["SellerSku"] = "SellerSKU";
})(IdType || (exports.IdType = IdType = {}));
/**
* An optional enrollment program to return the estimated fees when the offer is fulfilled by Amazon (IsAmazonFulfilled is set to true).
* @export
* @enum {string}
*/
var OptionalFulfillmentProgram;
(function (OptionalFulfillmentProgram) {
OptionalFulfillmentProgram["Core"] = "FBA_CORE";
OptionalFulfillmentProgram["Snl"] = "FBA_SNL";
OptionalFulfillmentProgram["Efn"] = "FBA_EFN";
})(OptionalFulfillmentProgram || (exports.OptionalFulfillmentProgram = OptionalFulfillmentProgram = {}));
/**
* FeesApi - axios parameter creator
* @export
*/
const FeesApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item\'s catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimateForASIN: async (asin, body, options = {}) => {
// verify required parameter 'asin' is not null or undefined
(0, common_1.assertParamExists)('getMyFeesEstimateForASIN', 'asin', asin);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getMyFeesEstimateForASIN', 'body', body);
const localVarPath = `/products/fees/v0/items/{Asin}/feesEstimate`
.replace(`{${"Asin"}}`, encodeURIComponent(String(asin)));
// 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)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to 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). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they\'ve sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} sellerSKU Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimateForSKU: async (sellerSKU, body, options = {}) => {
// verify required parameter 'sellerSKU' is not null or undefined
(0, common_1.assertParamExists)('getMyFeesEstimateForSKU', 'sellerSKU', sellerSKU);
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getMyFeesEstimateForSKU', 'body', body);
const localVarPath = `/products/fees/v0/listings/{SellerSKU}/feesEstimate`
.replace(`{${"SellerSKU"}}`, encodeURIComponent(String(sellerSKU)));
// 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)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {Array<FeesEstimateByIdRequest>} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimates: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('getMyFeesEstimates', 'body', body);
const localVarPath = `/products/fees/v0/feesEstimate`;
// 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)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.FeesApiAxiosParamCreator = FeesApiAxiosParamCreator;
/**
* FeesApi - functional programming interface
* @export
*/
const FeesApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.FeesApiAxiosParamCreator)(configuration);
return {
/**
* Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item\'s catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getMyFeesEstimateForASIN(asin, body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getMyFeesEstimateForASIN(asin, body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to 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). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they\'ve sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} sellerSKU Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getMyFeesEstimateForSKU(sellerSKU, body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getMyFeesEstimateForSKU(sellerSKU, body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {Array<FeesEstimateByIdRequest>} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getMyFeesEstimates(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getMyFeesEstimates(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.FeesApiFp = FeesApiFp;
/**
* FeesApi - factory interface
* @export
*/
const FeesApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.FeesApiFp)(configuration);
return {
/**
* Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item\'s catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} asin The Amazon Standard Identification Number (ASIN) of the item.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimateForASIN(asin, body, options) {
return localVarFp.getMyFeesEstimateForASIN(asin, body, options).then((request) => request(axios, basePath));
},
/**
* Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to 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). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they\'ve sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} sellerSKU Used to identify an item in the given marketplace. SellerSKU is qualified by the seller\'s SellerId, which is included with every operation that you submit.
* @param {GetMyFeesEstimateRequest} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimateForSKU(sellerSKU, body, options) {
return localVarFp.getMyFeesEstimateForSKU(sellerSKU, body, options).then((request) => request(axios, basePath));
},
/**
* Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {Array<FeesEstimateByIdRequest>} body
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getMyFeesEstimates(body, options) {
return localVarFp.getMyFeesEstimates(body, options).then((request) => request(axios, basePath));
},
};
};
exports.FeesApiFactory = FeesApiFactory;
/**
* FeesApi - object-oriented interface
* @export
* @class FeesApi
* @extends {BaseAPI}
*/
class FeesApi extends base_1.BaseAPI {
/**
* Returns the estimated fees for the item indicated by the specified ASIN in the marketplace specified in the request body. You can call `getMyFeesEstimateForASIN` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take estimated fees into account. Each fees request must include an original identifier. This identifier is included in the fees estimate so you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When using the `getMyFeesEstimateForASIN` operation with an ASIN, the fee estimates might be different. This is because these estimates use the item\'s catalog size, which might not always match the actual size of the item sent to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {FeesApiGetMyFeesEstimateForASINRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FeesApi
*/
getMyFeesEstimateForASIN(requestParameters, options) {
return (0, exports.FeesApiFp)(this.configuration).getMyFeesEstimateForASIN(requestParameters.asin, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns the estimated fees for the item indicated by the specified seller SKU in the marketplace specified in the request body. **Note:** The parameters associated with this operation may contain special characters that require URL encoding to 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). You can call `getMyFeesEstimateForSKU` for an item on behalf of a selling partner before the selling partner sets the item\'s price. The selling partner can then take any estimated fees into account. Each fees estimate request must include an original identifier. This identifier is included in the fees estimate so that you can correlate a fees estimate with the original request. **Note:** This identifier value is used to identify an estimate. Actual costs may vary. Search \"fees\" in [Seller Central](https://sellercentral.amazon.com/) and consult the store-specific fee schedule for the most up-to-date information. **Note:** When sellers use the `getMyFeesEstimateForSKU` operation with their `SellerSKU`, they get accurate fees based on real item measurements, but only after they\'ve sent their items to Amazon. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 2 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {FeesApiGetMyFeesEstimateForSKURequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FeesApi
*/
getMyFeesEstimateForSKU(requestParameters, options) {
return (0, exports.FeesApiFp)(this.configuration).getMyFeesEstimateForSKU(requestParameters.sellerSKU, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
/**
* Returns the estimated fees for a list of products. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.5 | 1 | 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](doc:usage-plans-and-rate-limits-in-the-sp-api).
* @param {FeesApiGetMyFeesEstimatesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof FeesApi
*/
getMyFeesEstimates(requestParameters, options) {
return (0, exports.FeesApiFp)(this.configuration).getMyFeesEstimates(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.FeesApi = FeesApi;
//# sourceMappingURL=api.js.map