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.

237 lines (236 loc) 20.4 kB
/* 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. */ import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, BaseAPI, operationServerMap } from '../base'; /** * ShipmentInvoiceApi - axios parameter creator * @export */ 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 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: 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 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, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options }; const localVarHeaderParameter = {}; const localVarQueryParameter = {}; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; return { url: 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 assertParamExists('submitInvoice', 'shipmentId', shipmentId); // verify required parameter 'body' is not null or undefined 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, 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'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers }; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * ShipmentInvoiceApi - functional programming interface * @export */ export const ShipmentInvoiceApiFp = function (configuration) { const localVarAxiosParamCreator = 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 = operationServerMap['ShipmentInvoiceApi.getInvoiceStatus']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['ShipmentInvoiceApi.getShipmentDetails']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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 = operationServerMap['ShipmentInvoiceApi.submitInvoice']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * ShipmentInvoiceApi - factory interface * @export */ export const ShipmentInvoiceApiFactory = function (configuration, basePath, axios) { const localVarFp = 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)); }, }; }; /** * ShipmentInvoiceApi - object-oriented interface * @export * @class ShipmentInvoiceApi * @extends {BaseAPI} */ export class ShipmentInvoiceApi extends 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 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 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 ShipmentInvoiceApiFp(this.configuration).submitInvoice(requestParameters.shipmentId, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } }