@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
529 lines • 56.9 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Selling Partner API for Retail Procurement Orders
* The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
*
* 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.VendorOrdersApi = exports.VendorOrdersApiFactory = exports.VendorOrdersApiFp = exports.VendorOrdersApiAxiosParamCreator = exports.TaxRegistrationDetailsTaxRegistrationTypeEnum = exports.OrderStatusPurchaseOrderStatusEnum = exports.OrderItemStatusReceivingStatusReceiveStatusEnum = exports.OrderItemStatusAcknowledgementStatusConfirmationStatusEnum = exports.OrderItemAcknowledgementRejectionReasonEnum = exports.OrderItemAcknowledgementAcknowledgementCodeEnum = exports.OrderDetailsPaymentMethodEnum = exports.OrderDetailsPurchaseOrderTypeEnum = exports.OrderPurchaseOrderStateEnum = exports.MoneyUnitOfMeasureEnum = exports.ItemQuantityUnitOfMeasureEnum = exports.ImportDetailsInternationalCommercialTermsEnum = exports.ImportDetailsMethodOfPaymentEnum = 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 ImportDetailsMethodOfPaymentEnum;
(function (ImportDetailsMethodOfPaymentEnum) {
ImportDetailsMethodOfPaymentEnum["PaidByBuyer"] = "PaidByBuyer";
ImportDetailsMethodOfPaymentEnum["CollectOnDelivery"] = "CollectOnDelivery";
ImportDetailsMethodOfPaymentEnum["DefinedByBuyerAndSeller"] = "DefinedByBuyerAndSeller";
ImportDetailsMethodOfPaymentEnum["FobPortOfCall"] = "FOBPortOfCall";
ImportDetailsMethodOfPaymentEnum["PrepaidBySeller"] = "PrepaidBySeller";
ImportDetailsMethodOfPaymentEnum["PaidBySeller"] = "PaidBySeller";
})(ImportDetailsMethodOfPaymentEnum || (exports.ImportDetailsMethodOfPaymentEnum = ImportDetailsMethodOfPaymentEnum = {}));
/**
* @export
* @enum {string}
*/
var ImportDetailsInternationalCommercialTermsEnum;
(function (ImportDetailsInternationalCommercialTermsEnum) {
ImportDetailsInternationalCommercialTermsEnum["ExWorks"] = "ExWorks";
ImportDetailsInternationalCommercialTermsEnum["FreeCarrier"] = "FreeCarrier";
ImportDetailsInternationalCommercialTermsEnum["FreeOnBoard"] = "FreeOnBoard";
ImportDetailsInternationalCommercialTermsEnum["FreeAlongSideShip"] = "FreeAlongSideShip";
ImportDetailsInternationalCommercialTermsEnum["CarriagePaidTo"] = "CarriagePaidTo";
ImportDetailsInternationalCommercialTermsEnum["CostAndFreight"] = "CostAndFreight";
ImportDetailsInternationalCommercialTermsEnum["CarriageAndInsurancePaidTo"] = "CarriageAndInsurancePaidTo";
ImportDetailsInternationalCommercialTermsEnum["CostInsuranceAndFreight"] = "CostInsuranceAndFreight";
ImportDetailsInternationalCommercialTermsEnum["DeliveredAtTerminal"] = "DeliveredAtTerminal";
ImportDetailsInternationalCommercialTermsEnum["DeliveredAtPlace"] = "DeliveredAtPlace";
ImportDetailsInternationalCommercialTermsEnum["DeliverDutyPaid"] = "DeliverDutyPaid";
})(ImportDetailsInternationalCommercialTermsEnum || (exports.ImportDetailsInternationalCommercialTermsEnum = ImportDetailsInternationalCommercialTermsEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemQuantityUnitOfMeasureEnum;
(function (ItemQuantityUnitOfMeasureEnum) {
ItemQuantityUnitOfMeasureEnum["Cases"] = "Cases";
ItemQuantityUnitOfMeasureEnum["Eaches"] = "Eaches";
})(ItemQuantityUnitOfMeasureEnum || (exports.ItemQuantityUnitOfMeasureEnum = ItemQuantityUnitOfMeasureEnum = {}));
/**
* @export
* @enum {string}
*/
var MoneyUnitOfMeasureEnum;
(function (MoneyUnitOfMeasureEnum) {
MoneyUnitOfMeasureEnum["Pounds"] = "POUNDS";
MoneyUnitOfMeasureEnum["Ounces"] = "OUNCES";
MoneyUnitOfMeasureEnum["Grams"] = "GRAMS";
MoneyUnitOfMeasureEnum["Kilograms"] = "KILOGRAMS";
})(MoneyUnitOfMeasureEnum || (exports.MoneyUnitOfMeasureEnum = MoneyUnitOfMeasureEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderPurchaseOrderStateEnum;
(function (OrderPurchaseOrderStateEnum) {
OrderPurchaseOrderStateEnum["New"] = "New";
OrderPurchaseOrderStateEnum["Acknowledged"] = "Acknowledged";
OrderPurchaseOrderStateEnum["Closed"] = "Closed";
})(OrderPurchaseOrderStateEnum || (exports.OrderPurchaseOrderStateEnum = OrderPurchaseOrderStateEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderDetailsPurchaseOrderTypeEnum;
(function (OrderDetailsPurchaseOrderTypeEnum) {
OrderDetailsPurchaseOrderTypeEnum["RegularOrder"] = "RegularOrder";
OrderDetailsPurchaseOrderTypeEnum["ConsignedOrder"] = "ConsignedOrder";
OrderDetailsPurchaseOrderTypeEnum["NewProductIntroduction"] = "NewProductIntroduction";
OrderDetailsPurchaseOrderTypeEnum["RushOrder"] = "RushOrder";
})(OrderDetailsPurchaseOrderTypeEnum || (exports.OrderDetailsPurchaseOrderTypeEnum = OrderDetailsPurchaseOrderTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderDetailsPaymentMethodEnum;
(function (OrderDetailsPaymentMethodEnum) {
OrderDetailsPaymentMethodEnum["Invoice"] = "Invoice";
OrderDetailsPaymentMethodEnum["Consignment"] = "Consignment";
OrderDetailsPaymentMethodEnum["CreditCard"] = "CreditCard";
OrderDetailsPaymentMethodEnum["Prepaid"] = "Prepaid";
})(OrderDetailsPaymentMethodEnum || (exports.OrderDetailsPaymentMethodEnum = OrderDetailsPaymentMethodEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderItemAcknowledgementAcknowledgementCodeEnum;
(function (OrderItemAcknowledgementAcknowledgementCodeEnum) {
OrderItemAcknowledgementAcknowledgementCodeEnum["Accepted"] = "Accepted";
OrderItemAcknowledgementAcknowledgementCodeEnum["Backordered"] = "Backordered";
OrderItemAcknowledgementAcknowledgementCodeEnum["Rejected"] = "Rejected";
})(OrderItemAcknowledgementAcknowledgementCodeEnum || (exports.OrderItemAcknowledgementAcknowledgementCodeEnum = OrderItemAcknowledgementAcknowledgementCodeEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderItemAcknowledgementRejectionReasonEnum;
(function (OrderItemAcknowledgementRejectionReasonEnum) {
OrderItemAcknowledgementRejectionReasonEnum["TemporarilyUnavailable"] = "TemporarilyUnavailable";
OrderItemAcknowledgementRejectionReasonEnum["InvalidProductIdentifier"] = "InvalidProductIdentifier";
OrderItemAcknowledgementRejectionReasonEnum["ObsoleteProduct"] = "ObsoleteProduct";
})(OrderItemAcknowledgementRejectionReasonEnum || (exports.OrderItemAcknowledgementRejectionReasonEnum = OrderItemAcknowledgementRejectionReasonEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderItemStatusAcknowledgementStatusConfirmationStatusEnum;
(function (OrderItemStatusAcknowledgementStatusConfirmationStatusEnum) {
OrderItemStatusAcknowledgementStatusConfirmationStatusEnum["Accepted"] = "ACCEPTED";
OrderItemStatusAcknowledgementStatusConfirmationStatusEnum["PartiallyAccepted"] = "PARTIALLY_ACCEPTED";
OrderItemStatusAcknowledgementStatusConfirmationStatusEnum["Rejected"] = "REJECTED";
OrderItemStatusAcknowledgementStatusConfirmationStatusEnum["Unconfirmed"] = "UNCONFIRMED";
})(OrderItemStatusAcknowledgementStatusConfirmationStatusEnum || (exports.OrderItemStatusAcknowledgementStatusConfirmationStatusEnum = OrderItemStatusAcknowledgementStatusConfirmationStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderItemStatusReceivingStatusReceiveStatusEnum;
(function (OrderItemStatusReceivingStatusReceiveStatusEnum) {
OrderItemStatusReceivingStatusReceiveStatusEnum["NotReceived"] = "NOT_RECEIVED";
OrderItemStatusReceivingStatusReceiveStatusEnum["PartiallyReceived"] = "PARTIALLY_RECEIVED";
OrderItemStatusReceivingStatusReceiveStatusEnum["Received"] = "RECEIVED";
})(OrderItemStatusReceivingStatusReceiveStatusEnum || (exports.OrderItemStatusReceivingStatusReceiveStatusEnum = OrderItemStatusReceivingStatusReceiveStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var OrderStatusPurchaseOrderStatusEnum;
(function (OrderStatusPurchaseOrderStatusEnum) {
OrderStatusPurchaseOrderStatusEnum["Open"] = "OPEN";
OrderStatusPurchaseOrderStatusEnum["Closed"] = "CLOSED";
})(OrderStatusPurchaseOrderStatusEnum || (exports.OrderStatusPurchaseOrderStatusEnum = OrderStatusPurchaseOrderStatusEnum = {}));
/**
* @export
* @enum {string}
*/
var TaxRegistrationDetailsTaxRegistrationTypeEnum;
(function (TaxRegistrationDetailsTaxRegistrationTypeEnum) {
TaxRegistrationDetailsTaxRegistrationTypeEnum["Vat"] = "VAT";
TaxRegistrationDetailsTaxRegistrationTypeEnum["Gst"] = "GST";
})(TaxRegistrationDetailsTaxRegistrationTypeEnum || (exports.TaxRegistrationDetailsTaxRegistrationTypeEnum = TaxRegistrationDetailsTaxRegistrationTypeEnum = {}));
/**
* VendorOrdersApi - axios parameter creator
* @export
*/
const VendorOrdersApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns a purchase order based on the `purchaseOrderNumber` value that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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} purchaseOrderNumber The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrder: async (purchaseOrderNumber, options = {}) => {
// verify required parameter 'purchaseOrderNumber' is not null or undefined
(0, common_1.assertParamExists)('getPurchaseOrder', 'purchaseOrderNumber', purchaseOrderNumber);
const localVarPath = `/vendor/orders/v1/purchaseOrders/{purchaseOrderNumber}`
.replace(`{${"purchaseOrderNumber"}}`, encodeURIComponent(String(purchaseOrderNumber)));
// 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 = {};
(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 a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {string} [createdAfter] Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
* @param {boolean} [includeDetails] When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
* @param {string} [changedAfter] Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [changedBefore] Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {'Cancelled'} [poItemState] Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
* @param {boolean} [isPOChanged] When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
* @param {'New' | 'Acknowledged' | 'Closed'} [purchaseOrderState] Filters purchase orders based on the purchase order state.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrders: async (limit, createdAfter, createdBefore, sortOrder, nextToken, includeDetails, changedAfter, changedBefore, poItemState, isPOChanged, purchaseOrderState, orderingVendorCode, options = {}) => {
const localVarPath = `/vendor/orders/v1/purchaseOrders`;
// 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 (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (createdAfter !== undefined) {
localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
createdAfter.toISOString() :
createdAfter;
}
if (createdBefore !== undefined) {
localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
createdBefore.toISOString() :
createdBefore;
}
if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}
if (nextToken !== undefined) {
localVarQueryParameter['nextToken'] = nextToken;
}
if (includeDetails !== undefined) {
localVarQueryParameter['includeDetails'] = includeDetails;
}
if (changedAfter !== undefined) {
localVarQueryParameter['changedAfter'] = (changedAfter instanceof Date) ?
changedAfter.toISOString() :
changedAfter;
}
if (changedBefore !== undefined) {
localVarQueryParameter['changedBefore'] = (changedBefore instanceof Date) ?
changedBefore.toISOString() :
changedBefore;
}
if (poItemState !== undefined) {
localVarQueryParameter['poItemState'] = poItemState;
}
if (isPOChanged !== undefined) {
localVarQueryParameter['isPOChanged'] = isPOChanged;
}
if (purchaseOrderState !== undefined) {
localVarQueryParameter['purchaseOrderState'] = purchaseOrderState;
}
if (orderingVendorCode !== undefined) {
localVarQueryParameter['orderingVendorCode'] = orderingVendorCode;
}
(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 purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there are more purchase orders than the specified result size limit.
* @param {string} [createdAfter] Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedAfter] Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedBefore] Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [purchaseOrderNumber] Provides purchase order status for the specified purchase order number.
* @param {'OPEN' | 'CLOSED'} [purchaseOrderStatus] Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
* @param {'ACCEPTED' | 'PARTIALLY_ACCEPTED' | 'REJECTED' | 'UNCONFIRMED'} [itemConfirmationStatus] Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
* @param {'NOT_RECEIVED' | 'PARTIALLY_RECEIVED' | 'RECEIVED'} [itemReceiveStatus] Filters purchase orders based on the purchase order\'s item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
* @param {string} [shipToPartyId] Filters purchase orders for a specific buyer\'s Fulfillment Center/warehouse by providing ship to location id here. This value should be same as \'shipToParty.partyId\' in the purchase order. If not included in filter, this will return purchase orders for all the buyer\'s warehouses used for vendor group purchase orders.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrdersStatus: async (limit, sortOrder, nextToken, createdAfter, createdBefore, updatedAfter, updatedBefore, purchaseOrderNumber, purchaseOrderStatus, itemConfirmationStatus, itemReceiveStatus, orderingVendorCode, shipToPartyId, options = {}) => {
const localVarPath = `/vendor/orders/v1/purchaseOrdersStatus`;
// 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 (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}
if (nextToken !== undefined) {
localVarQueryParameter['nextToken'] = nextToken;
}
if (createdAfter !== undefined) {
localVarQueryParameter['createdAfter'] = (createdAfter instanceof Date) ?
createdAfter.toISOString() :
createdAfter;
}
if (createdBefore !== undefined) {
localVarQueryParameter['createdBefore'] = (createdBefore instanceof Date) ?
createdBefore.toISOString() :
createdBefore;
}
if (updatedAfter !== undefined) {
localVarQueryParameter['updatedAfter'] = (updatedAfter instanceof Date) ?
updatedAfter.toISOString() :
updatedAfter;
}
if (updatedBefore !== undefined) {
localVarQueryParameter['updatedBefore'] = (updatedBefore instanceof Date) ?
updatedBefore.toISOString() :
updatedBefore;
}
if (purchaseOrderNumber !== undefined) {
localVarQueryParameter['purchaseOrderNumber'] = purchaseOrderNumber;
}
if (purchaseOrderStatus !== undefined) {
localVarQueryParameter['purchaseOrderStatus'] = purchaseOrderStatus;
}
if (itemConfirmationStatus !== undefined) {
localVarQueryParameter['itemConfirmationStatus'] = itemConfirmationStatus;
}
if (itemReceiveStatus !== undefined) {
localVarQueryParameter['itemReceiveStatus'] = itemReceiveStatus;
}
if (orderingVendorCode !== undefined) {
localVarQueryParameter['orderingVendorCode'] = orderingVendorCode;
}
if (shipToPartyId !== undefined) {
localVarQueryParameter['shipToPartyId'] = shipToPartyId;
}
(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,
};
},
/**
* Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {SubmitAcknowledgementRequest} body Submits acknowledgements for one or more purchase orders from a vendor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitAcknowledgement: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('submitAcknowledgement', 'body', body);
const localVarPath = `/vendor/orders/v1/acknowledgements`;
// 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.VendorOrdersApiAxiosParamCreator = VendorOrdersApiAxiosParamCreator;
/**
* VendorOrdersApi - functional programming interface
* @export
*/
const VendorOrdersApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.VendorOrdersApiAxiosParamCreator)(configuration);
return {
/**
* Returns a purchase order based on the `purchaseOrderNumber` value that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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} purchaseOrderNumber The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPurchaseOrder(purchaseOrderNumber, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPurchaseOrder(purchaseOrderNumber, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {string} [createdAfter] Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
* @param {boolean} [includeDetails] When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
* @param {string} [changedAfter] Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [changedBefore] Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {'Cancelled'} [poItemState] Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
* @param {boolean} [isPOChanged] When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
* @param {'New' | 'Acknowledged' | 'Closed'} [purchaseOrderState] Filters purchase orders based on the purchase order state.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPurchaseOrders(limit, createdAfter, createdBefore, sortOrder, nextToken, includeDetails, changedAfter, changedBefore, poItemState, isPOChanged, purchaseOrderState, orderingVendorCode, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPurchaseOrders(limit, createdAfter, createdBefore, sortOrder, nextToken, includeDetails, changedAfter, changedBefore, poItemState, isPOChanged, purchaseOrderState, orderingVendorCode, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there are more purchase orders than the specified result size limit.
* @param {string} [createdAfter] Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedAfter] Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedBefore] Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [purchaseOrderNumber] Provides purchase order status for the specified purchase order number.
* @param {'OPEN' | 'CLOSED'} [purchaseOrderStatus] Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
* @param {'ACCEPTED' | 'PARTIALLY_ACCEPTED' | 'REJECTED' | 'UNCONFIRMED'} [itemConfirmationStatus] Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
* @param {'NOT_RECEIVED' | 'PARTIALLY_RECEIVED' | 'RECEIVED'} [itemReceiveStatus] Filters purchase orders based on the purchase order\'s item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
* @param {string} [shipToPartyId] Filters purchase orders for a specific buyer\'s Fulfillment Center/warehouse by providing ship to location id here. This value should be same as \'shipToParty.partyId\' in the purchase order. If not included in filter, this will return purchase orders for all the buyer\'s warehouses used for vendor group purchase orders.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPurchaseOrdersStatus(limit, sortOrder, nextToken, createdAfter, createdBefore, updatedAfter, updatedBefore, purchaseOrderNumber, purchaseOrderStatus, itemConfirmationStatus, itemReceiveStatus, orderingVendorCode, shipToPartyId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPurchaseOrdersStatus(limit, sortOrder, nextToken, createdAfter, createdBefore, updatedAfter, updatedBefore, purchaseOrderNumber, purchaseOrderStatus, itemConfirmationStatus, itemReceiveStatus, orderingVendorCode, shipToPartyId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {SubmitAcknowledgementRequest} body Submits acknowledgements for one or more purchase orders from a vendor.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async submitAcknowledgement(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.submitAcknowledgement(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.VendorOrdersApiFp = VendorOrdersApiFp;
/**
* VendorOrdersApi - factory interface
* @export
*/
const VendorOrdersApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.VendorOrdersApiFp)(configuration);
return {
/**
* Returns a purchase order based on the `purchaseOrderNumber` value that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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} purchaseOrderNumber The purchase order identifier for the order that you want. Formatting Notes: 8-character alpha-numeric code.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrder(purchaseOrderNumber, options) {
return localVarFp.getPurchaseOrder(purchaseOrderNumber, options).then((request) => request(axios, basePath));
},
/**
* Returns a list of purchase orders created or changed during the time frame that you specify. You define the time frame using the `createdAfter`, `createdBefore`, `changedAfter` and `changedBefore` parameters. The date range to search must not be more than 7 days. You can choose to get only the purchase order numbers by setting `includeDetails` to false. You can then use the `getPurchaseOrder` operation to receive details for a specific purchase order. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {string} [createdAfter] Purchase orders that became available after this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this time will be included in the result. Must be in ISO-8601 date/time format.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there is more purchase orders than the specified result size limit. The token value is returned in the previous API call
* @param {boolean} [includeDetails] When true, returns purchase orders with complete details. Otherwise, only purchase order numbers are returned. Default value is true.
* @param {string} [changedAfter] Purchase orders that changed after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [changedBefore] Purchase orders that changed before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {'Cancelled'} [poItemState] Current state of the purchase order item. If this value is Cancelled, this API will return purchase orders which have one or more items cancelled by Amazon with updated item quantity as zero.
* @param {boolean} [isPOChanged] When true, returns purchase orders which were modified after the order was placed. Vendors are required to pull the changed purchase order and fulfill the updated purchase order and not the original one. Default value is false.
* @param {'New' | 'Acknowledged' | 'Closed'} [purchaseOrderState] Filters purchase orders based on the purchase order state.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in the filter, all purchase orders for all of the vendor codes that exist in the vendor group used to authorize the API client application are returned.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrders(limit, createdAfter, createdBefore, sortOrder, nextToken, includeDetails, changedAfter, changedBefore, poItemState, isPOChanged, purchaseOrderState, orderingVendorCode, options) {
return localVarFp.getPurchaseOrders(limit, createdAfter, createdBefore, sortOrder, nextToken, includeDetails, changedAfter, changedBefore, poItemState, isPOChanged, purchaseOrderState, orderingVendorCode, options).then((request) => request(axios, basePath));
},
/**
* Returns purchase order statuses based on the filters that you specify. Date range to search must not be more than 7 days. You can return a list of purchase order statuses using the available filters, or a single purchase order status by providing the purchase order number. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refer to [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 {number} [limit] The limit to the number of records returned. Default value is 100 records.
* @param {'ASC' | 'DESC'} [sortOrder] Sort in ascending or descending order by purchase order creation date.
* @param {string} [nextToken] Used for pagination when there are more purchase orders than the specified result size limit.
* @param {string} [createdAfter] Purchase orders that became available after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [createdBefore] Purchase orders that became available before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedAfter] Purchase orders for which the last purchase order update happened after this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [updatedBefore] Purchase orders for which the last purchase order update happened before this timestamp will be included in the result. Must be in ISO-8601 date/time format.
* @param {string} [purchaseOrderNumber] Provides purchase order status for the specified purchase order number.
* @param {'OPEN' | 'CLOSED'} [purchaseOrderStatus] Filters purchase orders based on the specified purchase order status. If not included in filter, this will return purchase orders for all statuses.
* @param {'ACCEPTED' | 'PARTIALLY_ACCEPTED' | 'REJECTED' | 'UNCONFIRMED'} [itemConfirmationStatus] Filters purchase orders based on their item confirmation status. If the item confirmation status is not included in the filter, purchase orders for all confirmation statuses are included.
* @param {'NOT_RECEIVED' | 'PARTIALLY_RECEIVED' | 'RECEIVED'} [itemReceiveStatus] Filters purchase orders based on the purchase order\'s item receive status. If the item receive status is not included in the filter, purchase orders for all receive statuses are included.
* @param {string} [orderingVendorCode] Filters purchase orders based on the specified ordering vendor code. This value should be same as \'sellingParty.partyId\' in the purchase order. If not included in filter, all purchase orders for all the vendor codes that exist in the vendor group used to authorize API client application are returned.
* @param {string} [shipToPartyId] Filters purchase orders for a specific buyer\'s Fulfillment Center/warehouse by providing ship to location id here. This value should be same as \'shipToParty.partyId\' in the purchase order. If not included in filter, this will return purchase orders for all the buyer\'s warehouses used for vendor group purchase orders.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPurchaseOrdersStatus(limit, sortOrder, nextToken, createdAfter, createdBefore, updatedAfter, updatedBefore, purchaseOrderNumber, purchaseOrderStatus, itemConfirmationStatus, itemReceiveStatus, orderingVendorCode, shipToPartyId, options) {
return localVarFp.getPurchaseOrdersStatus(limit, sortOrder, nextToken, createdAfter, createdBefore, updatedAfter, updatedBefore, purchaseOrderNumber, purchaseOrderStatus, itemConfirmationStatus, itemReceiveStatus, orderingVendorCode, shipToPartyId, options).then((request) => request(axios, basePath));
},
/**
* Submits acknowledgements for one or more purchase orders. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 10 | 10 | 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 may have higher rate and burst values than those shown here. For more information, refe