@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
520 lines • 61.3 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* The Selling Partner API for Invoices.
* Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.
*
* The version of the OpenAPI document: 2024-06-19
*
*
* 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.InvoicesApi = exports.InvoicesApiFactory = exports.InvoicesApiFp = exports.InvoicesApiAxiosParamCreator = exports.FileFormat = exports.ExportStatus = 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");
/**
* The current status of the request.
* @export
* @enum {string}
*/
var ExportStatus;
(function (ExportStatus) {
ExportStatus["Requested"] = "REQUESTED";
ExportStatus["Processing"] = "PROCESSING";
ExportStatus["Done"] = "DONE";
ExportStatus["Error"] = "ERROR";
})(ExportStatus || (exports.ExportStatus = ExportStatus = {}));
/**
* Supported invoice file extensions.
* @export
* @enum {string}
*/
var FileFormat;
(function (FileFormat) {
FileFormat["Xml"] = "XML";
})(FileFormat || (exports.FileFormat = FileFormat = {}));
/**
* InvoicesApi - axios parameter creator
* @export
*/
const InvoicesApiAxiosParamCreator = function (configuration) {
return {
/**
* Creates an invoice export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.167 | 1 | 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 {ExportInvoicesRequest} body Information required to create the export request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createInvoicesExport: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('createInvoicesExport', 'body', body);
const localVarPath = `/tax/invoices/2024-06-19/exports`;
// 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,
};
},
/**
* Returns invoice data for the specified invoice. This operation returns only a subset of the invoices data; refer to the response definition to get all the possible attributes. To get the full invoice, use the `createInvoicesExport` operation to start an export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} marketplaceId The marketplace from which you want the invoice.
* @param {string} invoiceId The invoice identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoice: async (marketplaceId, invoiceId, options = {}) => {
// verify required parameter 'marketplaceId' is not null or undefined
(0, common_1.assertParamExists)('getInvoice', 'marketplaceId', marketplaceId);
// verify required parameter 'invoiceId' is not null or undefined
(0, common_1.assertParamExists)('getInvoice', 'invoiceId', invoiceId);
const localVarPath = `/tax/invoices/2024-06-19/invoices/{invoiceId}`
.replace(`{${"invoiceId"}}`, encodeURIComponent(String(invoiceId)));
// 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 (marketplaceId !== undefined) {
localVarQueryParameter['marketplaceId'] = marketplaceId;
}
(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 invoice details for the invoices that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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} marketplaceId The response includes only the invoices that match the specified marketplace.
* @param {string} [transactionIdentifierName] The name of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierId` field.Use the `getInvoicesAttributes` operation to check `transactionIdentifierName` options.
* @param {number} [pageSize] The maximum number of invoices you want to return in a single call. Minimum: 1 Maximum: 200
* @param {string} [dateEnd] The latest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is the current date-time.
* @param {string} [transactionType] The marketplace-specific classification of the transaction type for which the invoice was created. Use the `getInvoicesAttributes` operation to check `transactionType` options.
* @param {string} [transactionIdentifierId] The ID of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierName` field.
* @param {string} [dateStart] The earliest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 24 hours prior to the time of the request.
* @param {string} [series] Return invoices with the specified series number.
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
* @param {'DESC' | 'ASC'} [sortOrder] Sort the invoices in the response in ascending or descending order.
* @param {string} [invoiceType] The marketplace-specific classification of the invoice type. Use the `getInvoicesAttributes` operation to check `invoiceType` options.
* @param {Array<string>} [statuses] A list of statuses that you can use to filter invoices. Use the `getInvoicesAttributes` operation to check invoice status options. Min count: 1
* @param {string} [externalInvoiceId] Return invoices that match this external ID. This is typically the Government Invoice ID.
* @param {'START_DATE_TIME'} [sortBy] The attribute by which you want to sort the invoices in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoices: async (marketplaceId, transactionIdentifierName, pageSize, dateEnd, transactionType, transactionIdentifierId, dateStart, series, nextToken, sortOrder, invoiceType, statuses, externalInvoiceId, sortBy, options = {}) => {
// verify required parameter 'marketplaceId' is not null or undefined
(0, common_1.assertParamExists)('getInvoices', 'marketplaceId', marketplaceId);
const localVarPath = `/tax/invoices/2024-06-19/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: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (transactionIdentifierName !== undefined) {
localVarQueryParameter['transactionIdentifierName'] = transactionIdentifierName;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (dateEnd !== undefined) {
localVarQueryParameter['dateEnd'] = (dateEnd instanceof Date) ?
dateEnd.toISOString() :
dateEnd;
}
if (marketplaceId !== undefined) {
localVarQueryParameter['marketplaceId'] = marketplaceId;
}
if (transactionType !== undefined) {
localVarQueryParameter['transactionType'] = transactionType;
}
if (transactionIdentifierId !== undefined) {
localVarQueryParameter['transactionIdentifierId'] = transactionIdentifierId;
}
if (dateStart !== undefined) {
localVarQueryParameter['dateStart'] = (dateStart instanceof Date) ?
dateStart.toISOString() :
dateStart;
}
if (series !== undefined) {
localVarQueryParameter['series'] = series;
}
if (nextToken !== undefined) {
localVarQueryParameter['nextToken'] = nextToken;
}
if (sortOrder !== undefined) {
localVarQueryParameter['sortOrder'] = sortOrder;
}
if (invoiceType !== undefined) {
localVarQueryParameter['invoiceType'] = invoiceType;
}
if (statuses) {
localVarQueryParameter['statuses'] = statuses.join(base_1.COLLECTION_FORMATS.csv);
}
if (externalInvoiceId !== undefined) {
localVarQueryParameter['externalInvoiceId'] = externalInvoiceId;
}
if (sortBy !== undefined) {
localVarQueryParameter['sortBy'] = sortBy;
}
(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 marketplace-dependent schemas and their respective set of possible values. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | 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} marketplaceId The marketplace identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesAttributes: async (marketplaceId, options = {}) => {
// verify required parameter 'marketplaceId' is not null or undefined
(0, common_1.assertParamExists)('getInvoicesAttributes', 'marketplaceId', marketplaceId);
const localVarPath = `/tax/invoices/2024-06-19/attributes`;
// 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 (marketplaceId !== undefined) {
localVarQueryParameter['marketplaceId'] = marketplaceId;
}
(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 the invoice document\'s ID and URL. Use the URL to download the ZIP file, which contains the invoices from the corresponding `createInvoicesExport` request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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} invoicesDocumentId The export document identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesDocument: async (invoicesDocumentId, options = {}) => {
// verify required parameter 'invoicesDocumentId' is not null or undefined
(0, common_1.assertParamExists)('getInvoicesDocument', 'invoicesDocumentId', invoicesDocumentId);
const localVarPath = `/tax/invoices/2024-06-19/documents/{invoicesDocumentId}`
.replace(`{${"invoicesDocumentId"}}`, encodeURIComponent(String(invoicesDocumentId)));
// 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 invoice export details (including the `exportDocumentId`, if available) for the export that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} exportId The unique identifier for the export.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesExport: async (exportId, options = {}) => {
// verify required parameter 'exportId' is not null or undefined
(0, common_1.assertParamExists)('getInvoicesExport', 'exportId', exportId);
const localVarPath = `/tax/invoices/2024-06-19/exports/{exportId}`
.replace(`{${"exportId"}}`, encodeURIComponent(String(exportId)));
// 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 invoice exports details for exports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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} marketplaceId The returned exports match the specified marketplace.
* @param {string} [dateStart] The earliest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 30 days ago.
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
* @param {number} [pageSize] The maximum number of invoices to return in a single call. Minimum: 1 Maximum: 100
* @param {string} [dateEnd] The latest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default value is the time of the request.
* @param {'REQUESTED' | 'PROCESSING' | 'DONE' | 'ERROR'} [status] Return exports matching the status specified.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesExports: async (marketplaceId, dateStart, nextToken, pageSize, dateEnd, status, options = {}) => {
// verify required parameter 'marketplaceId' is not null or undefined
(0, common_1.assertParamExists)('getInvoicesExports', 'marketplaceId', marketplaceId);
const localVarPath = `/tax/invoices/2024-06-19/exports`;
// 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 (marketplaceId !== undefined) {
localVarQueryParameter['marketplaceId'] = marketplaceId;
}
if (dateStart !== undefined) {
localVarQueryParameter['dateStart'] = (dateStart instanceof Date) ?
dateStart.toISOString() :
dateStart;
}
if (nextToken !== undefined) {
localVarQueryParameter['nextToken'] = nextToken;
}
if (pageSize !== undefined) {
localVarQueryParameter['pageSize'] = pageSize;
}
if (dateEnd !== undefined) {
localVarQueryParameter['dateEnd'] = (dateEnd instanceof Date) ?
dateEnd.toISOString() :
dateEnd;
}
if (status !== undefined) {
localVarQueryParameter['status'] = status;
}
(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,
};
},
};
};
exports.InvoicesApiAxiosParamCreator = InvoicesApiAxiosParamCreator;
/**
* InvoicesApi - functional programming interface
* @export
*/
const InvoicesApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.InvoicesApiAxiosParamCreator)(configuration);
return {
/**
* Creates an invoice export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.167 | 1 | 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 {ExportInvoicesRequest} body Information required to create the export request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async createInvoicesExport(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.createInvoicesExport(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns invoice data for the specified invoice. This operation returns only a subset of the invoices data; refer to the response definition to get all the possible attributes. To get the full invoice, use the `createInvoicesExport` operation to start an export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} marketplaceId The marketplace from which you want the invoice.
* @param {string} invoiceId The invoice identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoice(marketplaceId, invoiceId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoice(marketplaceId, invoiceId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns invoice details for the invoices that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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} marketplaceId The response includes only the invoices that match the specified marketplace.
* @param {string} [transactionIdentifierName] The name of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierId` field.Use the `getInvoicesAttributes` operation to check `transactionIdentifierName` options.
* @param {number} [pageSize] The maximum number of invoices you want to return in a single call. Minimum: 1 Maximum: 200
* @param {string} [dateEnd] The latest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is the current date-time.
* @param {string} [transactionType] The marketplace-specific classification of the transaction type for which the invoice was created. Use the `getInvoicesAttributes` operation to check `transactionType` options.
* @param {string} [transactionIdentifierId] The ID of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierName` field.
* @param {string} [dateStart] The earliest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 24 hours prior to the time of the request.
* @param {string} [series] Return invoices with the specified series number.
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
* @param {'DESC' | 'ASC'} [sortOrder] Sort the invoices in the response in ascending or descending order.
* @param {string} [invoiceType] The marketplace-specific classification of the invoice type. Use the `getInvoicesAttributes` operation to check `invoiceType` options.
* @param {Array<string>} [statuses] A list of statuses that you can use to filter invoices. Use the `getInvoicesAttributes` operation to check invoice status options. Min count: 1
* @param {string} [externalInvoiceId] Return invoices that match this external ID. This is typically the Government Invoice ID.
* @param {'START_DATE_TIME'} [sortBy] The attribute by which you want to sort the invoices in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoices(marketplaceId, transactionIdentifierName, pageSize, dateEnd, transactionType, transactionIdentifierId, dateStart, series, nextToken, sortOrder, invoiceType, statuses, externalInvoiceId, sortBy, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoices(marketplaceId, transactionIdentifierName, pageSize, dateEnd, transactionType, transactionIdentifierId, dateStart, series, nextToken, sortOrder, invoiceType, statuses, externalInvoiceId, sortBy, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns marketplace-dependent schemas and their respective set of possible values. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | 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} marketplaceId The marketplace identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoicesAttributes(marketplaceId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoicesAttributes(marketplaceId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns the invoice document\'s ID and URL. Use the URL to download the ZIP file, which contains the invoices from the corresponding `createInvoicesExport` request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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} invoicesDocumentId The export document identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoicesDocument(invoicesDocumentId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoicesDocument(invoicesDocumentId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns invoice export details (including the `exportDocumentId`, if available) for the export that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} exportId The unique identifier for the export.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoicesExport(exportId, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoicesExport(exportId, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Returns invoice exports details for exports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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} marketplaceId The returned exports match the specified marketplace.
* @param {string} [dateStart] The earliest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 30 days ago.
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
* @param {number} [pageSize] The maximum number of invoices to return in a single call. Minimum: 1 Maximum: 100
* @param {string} [dateEnd] The latest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default value is the time of the request.
* @param {'REQUESTED' | 'PROCESSING' | 'DONE' | 'ERROR'} [status] Return exports matching the status specified.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getInvoicesExports(marketplaceId, dateStart, nextToken, pageSize, dateEnd, status, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getInvoicesExports(marketplaceId, dateStart, nextToken, pageSize, dateEnd, status, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.InvoicesApiFp = InvoicesApiFp;
/**
* InvoicesApi - factory interface
* @export
*/
const InvoicesApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.InvoicesApiFp)(configuration);
return {
/**
* Creates an invoice export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.167 | 1 | 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 {ExportInvoicesRequest} body Information required to create the export request.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
createInvoicesExport(body, options) {
return localVarFp.createInvoicesExport(body, options).then((request) => request(axios, basePath));
},
/**
* Returns invoice data for the specified invoice. This operation returns only a subset of the invoices data; refer to the response definition to get all the possible attributes. To get the full invoice, use the `createInvoicesExport` operation to start an export request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} marketplaceId The marketplace from which you want the invoice.
* @param {string} invoiceId The invoice identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoice(marketplaceId, invoiceId, options) {
return localVarFp.getInvoice(marketplaceId, invoiceId, options).then((request) => request(axios, basePath));
},
/**
* Returns invoice details for the invoices that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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} marketplaceId The response includes only the invoices that match the specified marketplace.
* @param {string} [transactionIdentifierName] The name of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierId` field.Use the `getInvoicesAttributes` operation to check `transactionIdentifierName` options.
* @param {number} [pageSize] The maximum number of invoices you want to return in a single call. Minimum: 1 Maximum: 200
* @param {string} [dateEnd] The latest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is the current date-time.
* @param {string} [transactionType] The marketplace-specific classification of the transaction type for which the invoice was created. Use the `getInvoicesAttributes` operation to check `transactionType` options.
* @param {string} [transactionIdentifierId] The ID of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the `transactionIdentifierName` field.
* @param {string} [dateStart] The earliest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 24 hours prior to the time of the request.
* @param {string} [series] Return invoices with the specified series number.
* @param {string} [nextToken] The response includes `nextToken` when the number of results exceeds the specified `pageSize` value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextToken` is null. Note that this operation can return empty pages.
* @param {'DESC' | 'ASC'} [sortOrder] Sort the invoices in the response in ascending or descending order.
* @param {string} [invoiceType] The marketplace-specific classification of the invoice type. Use the `getInvoicesAttributes` operation to check `invoiceType` options.
* @param {Array<string>} [statuses] A list of statuses that you can use to filter invoices. Use the `getInvoicesAttributes` operation to check invoice status options. Min count: 1
* @param {string} [externalInvoiceId] Return invoices that match this external ID. This is typically the Government Invoice ID.
* @param {'START_DATE_TIME'} [sortBy] The attribute by which you want to sort the invoices in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoices(marketplaceId, transactionIdentifierName, pageSize, dateEnd, transactionType, transactionIdentifierId, dateStart, series, nextToken, sortOrder, invoiceType, statuses, externalInvoiceId, sortBy, options) {
return localVarFp.getInvoices(marketplaceId, transactionIdentifierName, pageSize, dateEnd, transactionType, transactionIdentifierId, dateStart, series, nextToken, sortOrder, invoiceType, statuses, externalInvoiceId, sortBy, options).then((request) => request(axios, basePath));
},
/**
* Returns marketplace-dependent schemas and their respective set of possible values. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 1 | 1 | 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} marketplaceId The marketplace identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesAttributes(marketplaceId, options) {
return localVarFp.getInvoicesAttributes(marketplaceId, options).then((request) => request(axios, basePath));
},
/**
* Returns the invoice document\'s ID and URL. Use the URL to download the ZIP file, which contains the invoices from the corresponding `createInvoicesExport` request. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.0167 | 1 | 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} invoicesDocumentId The export document identifier.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesDocument(invoicesDocumentId, options) {
return localVarFp.getInvoicesDocument(invoicesDocumentId, options).then((request) => request(axios, basePath));
},
/**
* Returns invoice export details (including the `exportDocumentId`, if available) for the export that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 2 | 15 | 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} exportId The unique identifier for the export.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getInvoicesExport(exportId, options) {
return localVarFp.getInvoicesExport(exportId, options).then((request) => request(axios, basePath));
},
/**
* Returns invoice exports details for exports that match the filters that you specify. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.1 | 20 | 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.