@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
251 lines • 13.6 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Vendor Invoices v1
* The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments 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.VendorInvoicesApi = exports.VendorInvoicesApiFactory = exports.VendorInvoicesApiFp = exports.VendorInvoicesApiAxiosParamCreator = exports.TotalWeightUnitOfMeasureEnum = exports.TaxRegistrationDetailsTaxRegistrationTypeEnum = exports.TaxDetailsTaxTypeEnum = exports.PaymentTermsTypeEnum = exports.NetCostUnitOfMeasure = exports.ItemQuantityUnitOfMeasureEnum = exports.InvoiceInvoiceTypeEnum = exports.ChargeDetailsTypeEnum = exports.AllowanceDetailsTypeEnum = exports.AdditionalDetailsTypeEnum = 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 AdditionalDetailsTypeEnum;
(function (AdditionalDetailsTypeEnum) {
AdditionalDetailsTypeEnum["Sur"] = "SUR";
AdditionalDetailsTypeEnum["Ocr"] = "OCR";
AdditionalDetailsTypeEnum["CartonCount"] = "CartonCount";
})(AdditionalDetailsTypeEnum || (exports.AdditionalDetailsTypeEnum = AdditionalDetailsTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var AllowanceDetailsTypeEnum;
(function (AllowanceDetailsTypeEnum) {
AllowanceDetailsTypeEnum["Discount"] = "Discount";
AllowanceDetailsTypeEnum["DiscountIncentive"] = "DiscountIncentive";
AllowanceDetailsTypeEnum["Defective"] = "Defective";
AllowanceDetailsTypeEnum["Promotional"] = "Promotional";
AllowanceDetailsTypeEnum["UnsaleableMerchandise"] = "UnsaleableMerchandise";
AllowanceDetailsTypeEnum["Special"] = "Special";
})(AllowanceDetailsTypeEnum || (exports.AllowanceDetailsTypeEnum = AllowanceDetailsTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ChargeDetailsTypeEnum;
(function (ChargeDetailsTypeEnum) {
ChargeDetailsTypeEnum["Freight"] = "Freight";
ChargeDetailsTypeEnum["Packing"] = "Packing";
ChargeDetailsTypeEnum["Duty"] = "Duty";
ChargeDetailsTypeEnum["Service"] = "Service";
ChargeDetailsTypeEnum["SmallOrder"] = "SmallOrder";
ChargeDetailsTypeEnum["InsurancePlacementCost"] = "InsurancePlacementCost";
ChargeDetailsTypeEnum["InsuranceFee"] = "InsuranceFee";
ChargeDetailsTypeEnum["SpecialHandlingService"] = "SpecialHandlingService";
ChargeDetailsTypeEnum["CollectionAndRecyclingService"] = "CollectionAndRecyclingService";
ChargeDetailsTypeEnum["EnvironmentalProtectionService"] = "EnvironmentalProtectionService";
ChargeDetailsTypeEnum["TaxCollectedAtSource"] = "TaxCollectedAtSource";
})(ChargeDetailsTypeEnum || (exports.ChargeDetailsTypeEnum = ChargeDetailsTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var InvoiceInvoiceTypeEnum;
(function (InvoiceInvoiceTypeEnum) {
InvoiceInvoiceTypeEnum["Invoice"] = "Invoice";
InvoiceInvoiceTypeEnum["CreditNote"] = "CreditNote";
})(InvoiceInvoiceTypeEnum || (exports.InvoiceInvoiceTypeEnum = InvoiceInvoiceTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var ItemQuantityUnitOfMeasureEnum;
(function (ItemQuantityUnitOfMeasureEnum) {
ItemQuantityUnitOfMeasureEnum["Cases"] = "Cases";
ItemQuantityUnitOfMeasureEnum["Eaches"] = "Eaches";
})(ItemQuantityUnitOfMeasureEnum || (exports.ItemQuantityUnitOfMeasureEnum = ItemQuantityUnitOfMeasureEnum = {}));
/**
* This field represents weight unit of measure of items that are ordered by cases and supporting priced by weight.
* @export
* @enum {string}
*/
var NetCostUnitOfMeasure;
(function (NetCostUnitOfMeasure) {
NetCostUnitOfMeasure["Pounds"] = "POUNDS";
NetCostUnitOfMeasure["Ounces"] = "OUNCES";
NetCostUnitOfMeasure["Grams"] = "GRAMS";
NetCostUnitOfMeasure["Kilograms"] = "KILOGRAMS";
})(NetCostUnitOfMeasure || (exports.NetCostUnitOfMeasure = NetCostUnitOfMeasure = {}));
/**
* @export
* @enum {string}
*/
var PaymentTermsTypeEnum;
(function (PaymentTermsTypeEnum) {
PaymentTermsTypeEnum["Basic"] = "Basic";
PaymentTermsTypeEnum["EndOfMonth"] = "EndOfMonth";
PaymentTermsTypeEnum["FixedDate"] = "FixedDate";
PaymentTermsTypeEnum["Proximo"] = "Proximo";
PaymentTermsTypeEnum["PaymentDueUponReceiptOfInvoice"] = "PaymentDueUponReceiptOfInvoice";
PaymentTermsTypeEnum["LetterofCredit"] = "LetterofCredit";
})(PaymentTermsTypeEnum || (exports.PaymentTermsTypeEnum = PaymentTermsTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var TaxDetailsTaxTypeEnum;
(function (TaxDetailsTaxTypeEnum) {
TaxDetailsTaxTypeEnum["Cgst"] = "CGST";
TaxDetailsTaxTypeEnum["Sgst"] = "SGST";
TaxDetailsTaxTypeEnum["Cess"] = "CESS";
TaxDetailsTaxTypeEnum["Utgst"] = "UTGST";
TaxDetailsTaxTypeEnum["Igst"] = "IGST";
TaxDetailsTaxTypeEnum["MwSt"] = "MwSt.";
TaxDetailsTaxTypeEnum["Pst"] = "PST";
TaxDetailsTaxTypeEnum["Tva"] = "TVA";
TaxDetailsTaxTypeEnum["Vat"] = "VAT";
TaxDetailsTaxTypeEnum["Gst"] = "GST";
TaxDetailsTaxTypeEnum["St"] = "ST";
TaxDetailsTaxTypeEnum["Consumption"] = "Consumption";
TaxDetailsTaxTypeEnum["MutuallyDefined"] = "MutuallyDefined";
TaxDetailsTaxTypeEnum["DomesticVat"] = "DomesticVAT";
})(TaxDetailsTaxTypeEnum || (exports.TaxDetailsTaxTypeEnum = TaxDetailsTaxTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var TaxRegistrationDetailsTaxRegistrationTypeEnum;
(function (TaxRegistrationDetailsTaxRegistrationTypeEnum) {
TaxRegistrationDetailsTaxRegistrationTypeEnum["Vat"] = "VAT";
TaxRegistrationDetailsTaxRegistrationTypeEnum["Gst"] = "GST";
})(TaxRegistrationDetailsTaxRegistrationTypeEnum || (exports.TaxRegistrationDetailsTaxRegistrationTypeEnum = TaxRegistrationDetailsTaxRegistrationTypeEnum = {}));
/**
* @export
* @enum {string}
*/
var TotalWeightUnitOfMeasureEnum;
(function (TotalWeightUnitOfMeasureEnum) {
TotalWeightUnitOfMeasureEnum["Pounds"] = "POUNDS";
TotalWeightUnitOfMeasureEnum["Ounces"] = "OUNCES";
TotalWeightUnitOfMeasureEnum["Grams"] = "GRAMS";
TotalWeightUnitOfMeasureEnum["Kilograms"] = "KILOGRAMS";
})(TotalWeightUnitOfMeasureEnum || (exports.TotalWeightUnitOfMeasureEnum = TotalWeightUnitOfMeasureEnum = {}));
/**
* VendorInvoicesApi - axios parameter creator
* @export
*/
const VendorInvoicesApiAxiosParamCreator = function (configuration) {
return {
/**
* Submit new invoices to Amazon. **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 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).
* @summary submitInvoices
* @param {SubmitInvoicesRequest} body The request body containing the invoice data to submit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitInvoices: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('submitInvoices', 'body', body);
const localVarPath = `/vendor/payments/v1/invoices`;
// 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.VendorInvoicesApiAxiosParamCreator = VendorInvoicesApiAxiosParamCreator;
/**
* VendorInvoicesApi - functional programming interface
* @export
*/
const VendorInvoicesApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.VendorInvoicesApiAxiosParamCreator)(configuration);
return {
/**
* Submit new invoices to Amazon. **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 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).
* @summary submitInvoices
* @param {SubmitInvoicesRequest} body The request body containing the invoice data to submit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async submitInvoices(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.submitInvoices(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.VendorInvoicesApiFp = VendorInvoicesApiFp;
/**
* VendorInvoicesApi - factory interface
* @export
*/
const VendorInvoicesApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.VendorInvoicesApiFp)(configuration);
return {
/**
* Submit new invoices to Amazon. **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 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).
* @summary submitInvoices
* @param {SubmitInvoicesRequest} body The request body containing the invoice data to submit.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
submitInvoices(body, options) {
return localVarFp.submitInvoices(body, options).then((request) => request(axios, basePath));
},
};
};
exports.VendorInvoicesApiFactory = VendorInvoicesApiFactory;
/**
* VendorInvoicesApi - object-oriented interface
* @export
* @class VendorInvoicesApi
* @extends {BaseAPI}
*/
class VendorInvoicesApi extends base_1.BaseAPI {
/**
* Submit new invoices to Amazon. **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 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).
* @summary submitInvoices
* @param {VendorInvoicesApiSubmitInvoicesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof VendorInvoicesApi
*/
submitInvoices(requestParameters, options) {
return (0, exports.VendorInvoicesApiFp)(this.configuration).submitInvoices(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.VendorInvoicesApi = VendorInvoicesApi;
//# sourceMappingURL=api.js.map