UNPKG

@scaleleap/selling-partner-api-sdk

Version:

📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API

175 lines • 10.3 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Direct Fulfillment Payments * The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor\'s invoice 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.VendorInvoiceApi = exports.VendorInvoiceApiFactory = exports.VendorInvoiceApiFp = exports.VendorInvoiceApiAxiosParamCreator = exports.TaxRegistrationDetailTaxRegistrationTypeEnum = exports.TaxDetailTaxTypeEnum = exports.ChargeDetailsTypeEnum = 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 || (exports.AdditionalDetailsTypeEnum = AdditionalDetailsTypeEnum = {})); /** * @export * @enum {string} */ var ChargeDetailsTypeEnum; (function (ChargeDetailsTypeEnum) { ChargeDetailsTypeEnum["Giftwrap"] = "GIFTWRAP"; ChargeDetailsTypeEnum["Fulfillment"] = "FULFILLMENT"; ChargeDetailsTypeEnum["Marketinginsert"] = "MARKETINGINSERT"; ChargeDetailsTypeEnum["Packaging"] = "PACKAGING"; ChargeDetailsTypeEnum["Loading"] = "LOADING"; ChargeDetailsTypeEnum["Freightout"] = "FREIGHTOUT"; ChargeDetailsTypeEnum["TaxCollectedAtSource"] = "TAX_COLLECTED_AT_SOURCE"; })(ChargeDetailsTypeEnum || (exports.ChargeDetailsTypeEnum = ChargeDetailsTypeEnum = {})); /** * @export * @enum {string} */ var TaxDetailTaxTypeEnum; (function (TaxDetailTaxTypeEnum) { TaxDetailTaxTypeEnum["Cgst"] = "CGST"; TaxDetailTaxTypeEnum["Sgst"] = "SGST"; TaxDetailTaxTypeEnum["Cess"] = "CESS"; TaxDetailTaxTypeEnum["Utgst"] = "UTGST"; TaxDetailTaxTypeEnum["Igst"] = "IGST"; TaxDetailTaxTypeEnum["MwSt"] = "MwSt."; TaxDetailTaxTypeEnum["Pst"] = "PST"; TaxDetailTaxTypeEnum["Tva"] = "TVA"; TaxDetailTaxTypeEnum["Vat"] = "VAT"; TaxDetailTaxTypeEnum["Gst"] = "GST"; TaxDetailTaxTypeEnum["St"] = "ST"; TaxDetailTaxTypeEnum["Consumption"] = "Consumption"; TaxDetailTaxTypeEnum["MutuallyDefined"] = "MutuallyDefined"; TaxDetailTaxTypeEnum["DomesticVat"] = "DomesticVAT"; })(TaxDetailTaxTypeEnum || (exports.TaxDetailTaxTypeEnum = TaxDetailTaxTypeEnum = {})); /** * @export * @enum {string} */ var TaxRegistrationDetailTaxRegistrationTypeEnum; (function (TaxRegistrationDetailTaxRegistrationTypeEnum) { TaxRegistrationDetailTaxRegistrationTypeEnum["Vat"] = "VAT"; TaxRegistrationDetailTaxRegistrationTypeEnum["Gst"] = "GST"; })(TaxRegistrationDetailTaxRegistrationTypeEnum || (exports.TaxRegistrationDetailTaxRegistrationTypeEnum = TaxRegistrationDetailTaxRegistrationTypeEnum = {})); /** * VendorInvoiceApi - axios parameter creator * @export */ const VendorInvoiceApiAxiosParamCreator = function (configuration) { return { /** * Submits one or more invoices for a vendor\'s direct fulfillment 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 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 {SubmitInvoiceRequest} body The request body containing one or more invoices for vendor orders. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInvoice: async (body, options = {}) => { // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('submitInvoice', 'body', body); const localVarPath = `/vendor/directFulfillment/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.VendorInvoiceApiAxiosParamCreator = VendorInvoiceApiAxiosParamCreator; /** * VendorInvoiceApi - functional programming interface * @export */ const VendorInvoiceApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.VendorInvoiceApiAxiosParamCreator)(configuration); return { /** * Submits one or more invoices for a vendor\'s direct fulfillment 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 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 {SubmitInvoiceRequest} body The request body containing one or more invoices for vendor orders. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async submitInvoice(body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.submitInvoice(body, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }, }; }; exports.VendorInvoiceApiFp = VendorInvoiceApiFp; /** * VendorInvoiceApi - factory interface * @export */ const VendorInvoiceApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.VendorInvoiceApiFp)(configuration); return { /** * Submits one or more invoices for a vendor\'s direct fulfillment 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 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 {SubmitInvoiceRequest} body The request body containing one or more invoices for vendor orders. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInvoice(body, options) { return localVarFp.submitInvoice(body, options).then((request) => request(axios, basePath)); }, }; }; exports.VendorInvoiceApiFactory = VendorInvoiceApiFactory; /** * VendorInvoiceApi - object-oriented interface * @export * @class VendorInvoiceApi * @extends {BaseAPI} */ class VendorInvoiceApi extends base_1.BaseAPI { /** * Submits one or more invoices for a vendor\'s direct fulfillment 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 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 {VendorInvoiceApiSubmitInvoiceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VendorInvoiceApi */ submitInvoice(requestParameters, options) { return (0, exports.VendorInvoiceApiFp)(this.configuration).submitInvoice(requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } } exports.VendorInvoiceApi = VendorInvoiceApi; //# sourceMappingURL=api.js.map