UNPKG

@sp-api-sdk/fba-inbound-eligibility-api-v1

Version:

With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon's fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon

144 lines (143 loc) 11 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for FBA Inbound Eligibilty * With the FBA Inbound Eligibility API, you can build applications that let sellers get eligibility previews for items before shipping them to Amazon\'s fulfillment centers. With this API you can find out if an item is eligible for inbound shipment to Amazon\'s fulfillment centers in a specific marketplace. You can also find out if an item is eligible for using the manufacturer barcode for FBA inventory tracking. Sellers can use this information to inform their decisions about which items to ship Amazon\'s fulfillment centers. * * The version of the OpenAPI document: v1 * * * 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.GetItemEligibilityPreviewProgramEnum = exports.FbaInboundEligibilityApi = exports.FbaInboundEligibilityApiFactory = exports.FbaInboundEligibilityApiFp = exports.FbaInboundEligibilityApiAxiosParamCreator = 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"); /** * FbaInboundEligibilityApi - axios parameter creator * @export */ const FbaInboundEligibilityApiAxiosParamCreator = function (configuration) { return { /** * This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item\'s eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} asin The ASIN of the item for which you want an eligibility preview. * @param {GetItemEligibilityPreviewProgramEnum} program The program that you want to check eligibility against. * @param {Array<string>} [marketplaceIds] The identifier for the marketplace in which you want to determine eligibility. Required only when program&#x3D;INBOUND. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemEligibilityPreview: async (asin, program, marketplaceIds, options = {}) => { // verify required parameter 'asin' is not null or undefined (0, common_1.assertParamExists)('getItemEligibilityPreview', 'asin', asin); // verify required parameter 'program' is not null or undefined (0, common_1.assertParamExists)('getItemEligibilityPreview', 'program', program); const localVarPath = `/fba/inbound/v1/eligibility/itemPreview`; // 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 (asin !== undefined) { localVarQueryParameter['asin'] = asin; } if (program !== undefined) { localVarQueryParameter['program'] = program; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; exports.FbaInboundEligibilityApiAxiosParamCreator = FbaInboundEligibilityApiAxiosParamCreator; /** * FbaInboundEligibilityApi - functional programming interface * @export */ const FbaInboundEligibilityApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.FbaInboundEligibilityApiAxiosParamCreator)(configuration); return { /** * This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item\'s eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {string} asin The ASIN of the item for which you want an eligibility preview. * @param {GetItemEligibilityPreviewProgramEnum} program The program that you want to check eligibility against. * @param {Array<string>} [marketplaceIds] The identifier for the marketplace in which you want to determine eligibility. Required only when program&#x3D;INBOUND. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getItemEligibilityPreview(asin, program, marketplaceIds, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getItemEligibilityPreview(asin, program, marketplaceIds, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['FbaInboundEligibilityApi.getItemEligibilityPreview']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.FbaInboundEligibilityApiFp = FbaInboundEligibilityApiFp; /** * FbaInboundEligibilityApi - factory interface * @export */ const FbaInboundEligibilityApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.FbaInboundEligibilityApiFp)(configuration); return { /** * This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item\'s eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {FbaInboundEligibilityApiGetItemEligibilityPreviewRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getItemEligibilityPreview(requestParameters, options) { return localVarFp.getItemEligibilityPreview(requestParameters.asin, requestParameters.program, requestParameters.marketplaceIds, options).then((request) => request(axios, basePath)); }, }; }; exports.FbaInboundEligibilityApiFactory = FbaInboundEligibilityApiFactory; /** * FbaInboundEligibilityApi - object-oriented interface * @export * @class FbaInboundEligibilityApi * @extends {BaseAPI} */ class FbaInboundEligibilityApi extends base_1.BaseAPI { /** * This operation gets an eligibility preview for an item that you specify. You can specify the type of eligibility preview that you want (INBOUND or COMMINGLING). For INBOUND previews, you can specify the marketplace in which you want to determine the item\'s eligibility. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 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](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api). * @param {FbaInboundEligibilityApiGetItemEligibilityPreviewRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof FbaInboundEligibilityApi */ getItemEligibilityPreview(requestParameters, options) { return (0, exports.FbaInboundEligibilityApiFp)(this.configuration).getItemEligibilityPreview(requestParameters.asin, requestParameters.program, requestParameters.marketplaceIds, options).then((request) => request(this.axios, this.basePath)); } } exports.FbaInboundEligibilityApi = FbaInboundEligibilityApi; /** * @export */ exports.GetItemEligibilityPreviewProgramEnum = { Inbound: 'INBOUND', Commingling: 'COMMINGLING' };