UNPKG

@sp-api-sdk/shipment-invoicing-api-v0

Version:

The Selling Partner API for Shipment Invoicing helps you programmatically retrieve shipment invoice information in the Brazil marketplace for a selling partner’s Fulfillment by Amazon (FBA) orders.

247 lines (246 loc) 21.2 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Selling Partner API for Shipment Invoicing * The Selling Partner API for Shipment Invoicing helps you programmatically retrieve shipment invoice information in the Brazil marketplace for a selling partner’s Fulfillment by Amazon (FBA) orders. * * 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.ShipmentInvoiceApi = exports.ShipmentInvoiceApiFactory = exports.ShipmentInvoiceApiFp = exports.ShipmentInvoiceApiAxiosParamCreator = 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"); /** * ShipmentInvoiceApi - axios parameter creator * @export */ const ShipmentInvoiceApiAxiosParamCreator = function (configuration) { return { /** * Returns the invoice status for the shipment you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The shipment identifier for the shipment. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInvoiceStatus: async (shipmentId, options = {}) => { // verify required parameter 'shipmentId' is not null or undefined (0, common_1.assertParamExists)('getInvoiceStatus', 'shipmentId', shipmentId); const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}/invoice/status` .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId))); // 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); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Returns the shipment details required to issue an invoice for the specified shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus notification. For information about subscribing to notifications, see the [Notifications API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). * @param {*} [options] Override http request option. * @throws {RequiredError} */ getShipmentDetails: async (shipmentId, options = {}) => { // verify required parameter 'shipmentId' is not null or undefined (0, common_1.assertParamExists)('getShipmentDetails', 'shipmentId', shipmentId); const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}` .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId))); // 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); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Submits a shipment invoice document for a given shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The identifier for the shipment. * @param {SubmitInvoiceRequest} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInvoice: async (shipmentId, body, options = {}) => { // verify required parameter 'shipmentId' is not null or undefined (0, common_1.assertParamExists)('submitInvoice', 'shipmentId', shipmentId); // verify required parameter 'body' is not null or undefined (0, common_1.assertParamExists)('submitInvoice', 'body', body); const localVarPath = `/fba/outbound/brazil/v0/shipments/{shipmentId}/invoice` .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId))); // 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); 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.ShipmentInvoiceApiAxiosParamCreator = ShipmentInvoiceApiAxiosParamCreator; /** * ShipmentInvoiceApi - functional programming interface * @export */ const ShipmentInvoiceApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.ShipmentInvoiceApiAxiosParamCreator)(configuration); return { /** * Returns the invoice status for the shipment you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The shipment identifier for the shipment. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getInvoiceStatus(shipmentId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoiceStatus(shipmentId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['ShipmentInvoiceApi.getInvoiceStatus']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns the shipment details required to issue an invoice for the specified shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The identifier for the shipment. Get this value from the FBAOutboundShipmentStatus notification. For information about subscribing to notifications, see the [Notifications API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide). * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getShipmentDetails(shipmentId, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.getShipmentDetails(shipmentId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['ShipmentInvoiceApi.getShipmentDetails']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Submits a shipment invoice document for a given shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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} shipmentId The identifier for the shipment. * @param {SubmitInvoiceRequest} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async submitInvoice(shipmentId, body, options) { const localVarAxiosArgs = await localVarAxiosParamCreator.submitInvoice(shipmentId, body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = base_1.operationServerMap['ShipmentInvoiceApi.submitInvoice']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; exports.ShipmentInvoiceApiFp = ShipmentInvoiceApiFp; /** * ShipmentInvoiceApi - factory interface * @export */ const ShipmentInvoiceApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.ShipmentInvoiceApiFp)(configuration); return { /** * Returns the invoice status for the shipment you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiGetInvoiceStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getInvoiceStatus(requestParameters, options) { return localVarFp.getInvoiceStatus(requestParameters.shipmentId, options).then((request) => request(axios, basePath)); }, /** * Returns the shipment details required to issue an invoice for the specified shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiGetShipmentDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getShipmentDetails(requestParameters, options) { return localVarFp.getShipmentDetails(requestParameters.shipmentId, options).then((request) => request(axios, basePath)); }, /** * Submits a shipment invoice document for a given shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiSubmitInvoiceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ submitInvoice(requestParameters, options) { return localVarFp.submitInvoice(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(axios, basePath)); }, }; }; exports.ShipmentInvoiceApiFactory = ShipmentInvoiceApiFactory; /** * ShipmentInvoiceApi - object-oriented interface * @export * @class ShipmentInvoiceApi * @extends {BaseAPI} */ class ShipmentInvoiceApi extends base_1.BaseAPI { /** * Returns the invoice status for the shipment you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiGetInvoiceStatusRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ShipmentInvoiceApi */ getInvoiceStatus(requestParameters, options) { return (0, exports.ShipmentInvoiceApiFp)(this.configuration).getInvoiceStatus(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath)); } /** * Returns the shipment details required to issue an invoice for the specified shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiGetShipmentDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ShipmentInvoiceApi */ getShipmentDetails(requestParameters, options) { return (0, exports.ShipmentInvoiceApiFp)(this.configuration).getShipmentDetails(requestParameters.shipmentId, options).then((request) => request(this.axios, this.basePath)); } /** * Submits a shipment invoice document for a given shipment. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1.133 | 25 | 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 {ShipmentInvoiceApiSubmitInvoiceRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof ShipmentInvoiceApi */ submitInvoice(requestParameters, options) { return (0, exports.ShipmentInvoiceApiFp)(this.configuration).submitInvoice(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } } exports.ShipmentInvoiceApi = ShipmentInvoiceApi;