UNPKG

@datenkraft/bb-fulfillment-api-ts-client

Version:

The fulfillment API TS Client enables you to work with the fulfillment API

691 lines 70.2 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Fulfillment API * - alpha: Currently developed API version. Subject to major changes. - beta: A semi-stable early access version. New features can be added. Breaking changes are possible. - stable: The API is recommended for use in production. [Changelog](https://fulfillment-api.steve.niceshops.com/v2/docs/changelog.html) All data is transferred in UTF-8 encoding.\\ The API uses stateless HTTP. No cookies have to be kept.\\ Authentication via OAuth2 client credentials flow. [Privacy Policy](https://www.niceshops.com/en/dienstleistungen/data-privacy-policy) [Fulfillment API PHP client @Packagist](https://packagist.org/packages/datenkraft/bb-fulfillment-api-php-client) * * The version of the OpenAPI document: v2.beta * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OrderApi = exports.OrderApiFactory = exports.OrderApiFp = exports.OrderApiAxiosParamCreator = void 0; const axios_1 = __importDefault(require("axios")); // URLSearchParams not necessarily used // @ts-ignore const url_1 = require("url"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("../common"); // @ts-ignore const base_1 = require("../base"); /** * OrderApi - axios parameter creator * @export */ const OrderApiAxiosParamCreator = function (configuration) { return { /** * Cancel the order specified by the given order number (set in param orderNumber). An orderNumber from a canceled order cannot be used for a new order, because they must always be unique. * @summary Cancel an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelOrder: (orderNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('cancelOrder', 'orderNumber', orderNumber); const localVarPath = `/order/{orderNumber}/cancel` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get an order by order number. * @summary Get an order by order number. * @param {string} orderNumber The order number as defined during the creation of the order. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrder: (orderNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('getOrder', 'orderNumber', orderNumber); const localVarPath = `/order/{orderNumber}` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderBulkImportTemplate: (options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/bulk-import/template/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Get a list of shop orders. * @summary Get a list of shop orders. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - orderDate The default sort order is orderDate:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterStatus] Filter for status/statuses (optional). * @param {string} [filterExternalOrderId] Filter for the external order ID e.g. from third party apps (optional) * @param {string} [filterExternalCustomerId] Filter for the external customer ID e.g. from third party apps (optional) * @param {string} [filterExternalOrderReference] filter for externalOrderReference * @param {string} [filterOrderDateFrom] filter for orderDate format in ISO 8601 with UTC offsets * @param {string} [filterOrderDateTo] filter for orderDate format in ISO 8601 with UTC offsets * @param {string} [filterOrderNumber] Filter for order number(s). * @param {string} [filterSearch] filter for order search. Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields \'externalOrderReference\', \'externalOrderId\', \'customer.deliveryAddress.nameLine1\', \'customer.deliveryAddress.nameLine2\', \'orderNumber\' and the tracking code of the orders shipments. - Each search term filters the response for orders where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for orders where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the order is not included in the results. * @param {'allOrderItems' | 'notAllOrderItems'} [filterDeliverabilityStatus] filter for deliverabilityStatus By default, all orders are returned. Use \'allOrderItems\' to return all deliverable orders (\'availableCount\' of all \'orderItems\' is greater or equal than the ordered \'count\') Use \'notAllOrderItems\' to specifically return not deliverable orders (\'availableCount\' of at least one \'orderItem\' is smaller than the ordered \'count\' * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderCollection: (page, pageSize, paginationMode, sortBy, filterShopCode, filterStatus, filterExternalOrderId, filterExternalCustomerId, filterExternalOrderReference, filterOrderDateFrom, filterOrderDateTo, filterOrderNumber, filterSearch, filterDeliverabilityStatus, options = {}) => __awaiter(this, void 0, void 0, function* () { const localVarPath = `/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (paginationMode !== undefined) { localVarQueryParameter['paginationMode'] = paginationMode; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } if (filterShopCode !== undefined) { localVarQueryParameter['filter[shopCode]'] = filterShopCode; } if (filterStatus !== undefined) { localVarQueryParameter['filter[status]'] = filterStatus; } if (filterExternalOrderId !== undefined) { localVarQueryParameter['filter[externalOrderId]'] = filterExternalOrderId; } if (filterExternalCustomerId !== undefined) { localVarQueryParameter['filter[externalCustomerId]'] = filterExternalCustomerId; } if (filterExternalOrderReference !== undefined) { localVarQueryParameter['filter[externalOrderReference]'] = filterExternalOrderReference; } if (filterOrderDateFrom !== undefined) { localVarQueryParameter['filter[orderDateFrom]'] = (filterOrderDateFrom instanceof Date) ? filterOrderDateFrom.toISOString() : filterOrderDateFrom; } if (filterOrderDateTo !== undefined) { localVarQueryParameter['filter[orderDateTo]'] = (filterOrderDateTo instanceof Date) ? filterOrderDateTo.toISOString() : filterOrderDateTo; } if (filterOrderNumber !== undefined) { localVarQueryParameter['filter[orderNumber]'] = filterOrderNumber; } if (filterSearch !== undefined) { localVarQueryParameter['filter[search]'] = filterSearch; } if (filterDeliverabilityStatus !== undefined) { localVarQueryParameter['filter[deliverabilityStatus]'] = filterDeliverabilityStatus; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Import one or more new orders. The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new orders. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} */ orderBulkImport: (file, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'file' is not null or undefined (0, common_1.assertParamExists)('orderBulkImport', 'file', file); const localVarPath = `/bulk-import/order`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (file !== undefined) { localVarFormParams.append('file', file); } localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = localVarFormParams; return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Add a new order referenced by the given orderNumber. * @summary Add a new order. * @param {string} orderNumber The number the order should be referred by. \\ This number is user defined, must be unique and has a maximum length (check maxLength field). \\ Please ensure that it does not contain any of the following character sequences: \'/\', \'%2F\', \'%2f\', \'?\', \'%3F\', \'%3f\',\'#\', \'%23\', \'&\', \'%26\'. \\ Using any of these will result in the route not being handled correctly. * @param {NewOrder} newOrder * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrder: (orderNumber, newOrder, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('postOrder', 'orderNumber', orderNumber); // verify required parameter 'newOrder' is not null or undefined (0, common_1.assertParamExists)('postOrder', 'newOrder', newOrder); const localVarPath = `/order/{orderNumber}` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(newOrder, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Cancel all open order items of the order specified by the given order number (set in param orderNumber). * @summary Cancel open order items. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrderCancelOpenOrderItems: (orderNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('postOrderCancelOpenOrderItems', 'orderNumber', orderNumber); const localVarPath = `/order/{orderNumber}/cancel-open-order-items` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Trigger partial delivery for the order specified by the given order number (set in param orderNumber). * @summary Trigger partial delivery for an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrderPartialDelivery: (orderNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('postOrderPartialDelivery', 'orderNumber', orderNumber); const localVarPath = `/order/{orderNumber}/partial-delivery` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Create reconsignment announcements for an order. \\ Only delivered orders are reconsignable. \\ If the order has been redacted, it is also not reconsignable. \\ The created reconsignment announcement(s) are returned in the response. * @summary Create reconsignment announcements for an order. * @param {string} orderNumber The number the order is referred by. * @param {NewReconsignmentAnnouncement} newReconsignmentAnnouncement * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ reconsignOrder: (orderNumber, newReconsignmentAnnouncement, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('reconsignOrder', 'orderNumber', orderNumber); // verify required parameter 'newReconsignmentAnnouncement' is not null or undefined (0, common_1.assertParamExists)('reconsignOrder', 'newReconsignmentAnnouncement', newReconsignmentAnnouncement); const localVarPath = `/order/{orderNumber}/reconsign` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } localVarHeaderParameter['Content-Type'] = 'application/json'; (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(newReconsignmentAnnouncement, localVarRequestOptions, configuration); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Redact the order and all other orders linked to the given order number (set in the param orderNumber) in a GDPR article 17 conform way. \\ Only orders with one of the following statuses are redactable: - delivered - deleted - canceled * @summary Redact an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ redactOrder: (orderNumber, shopCode, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'orderNumber' is not null or undefined (0, common_1.assertParamExists)('redactOrder', 'orderNumber', orderNumber); const localVarPath = `/order/{orderNumber}/redact` .replace(`{${"orderNumber"}}`, encodeURIComponent(String(orderNumber))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new url_1.URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication oAuthAuthorization required // oauth required yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oAuthAuthorization", [], configuration); // authentication bearerAuth required // http bearer authentication required yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration); if (shopCode !== undefined) { localVarQueryParameter['shopCode'] = shopCode; } (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: (0, common_1.toPathString)(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; exports.OrderApiAxiosParamCreator = OrderApiAxiosParamCreator; /** * OrderApi - functional programming interface * @export */ const OrderApiFp = function (configuration) { const localVarAxiosParamCreator = (0, exports.OrderApiAxiosParamCreator)(configuration); return { /** * Cancel the order specified by the given order number (set in param orderNumber). An orderNumber from a canceled order cannot be used for a new order, because they must always be unique. * @summary Cancel an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelOrder(orderNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.cancelOrder(orderNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get an order by order number. * @summary Get an order by order number. * @param {string} orderNumber The order number as defined during the creation of the order. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrder(orderNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrder(orderNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderBulkImportTemplate(options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderBulkImportTemplate(options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Get a list of shop orders. * @summary Get a list of shop orders. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collection will not be calculated. - totalCount: The total number of items in the collection will be calculated. This can mean loss of performance. * @param {string} [sortBy] Sort the results by one or more comma-separated sort criteria, with the criterion specified first having priority. Available sort orders: - asc: ascending order - desc: descending order Available fields for sorting: - orderDate The default sort order is orderDate:desc. * @param {string} [filterShopCode] The shopCode used internally to distinguish between clients. \\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {string} [filterStatus] Filter for status/statuses (optional). * @param {string} [filterExternalOrderId] Filter for the external order ID e.g. from third party apps (optional) * @param {string} [filterExternalCustomerId] Filter for the external customer ID e.g. from third party apps (optional) * @param {string} [filterExternalOrderReference] filter for externalOrderReference * @param {string} [filterOrderDateFrom] filter for orderDate format in ISO 8601 with UTC offsets * @param {string} [filterOrderDateTo] filter for orderDate format in ISO 8601 with UTC offsets * @param {string} [filterOrderNumber] Filter for order number(s). * @param {string} [filterSearch] filter for order search. Usage: - Provide one or multiple search terms (min. 2 characters) to filter results. - Multiple search terms are separated by spaces. - The search is not case sensitive. - The search is enabled for the fields \'externalOrderReference\', \'externalOrderId\', \'customer.deliveryAddress.nameLine1\', \'customer.deliveryAddress.nameLine2\', \'orderNumber\' and the tracking code of the orders shipments. - Each search term filters the response for orders where at least one of the fields contains the search term. - For example, filter[search]=\'term1 term2\' will filter the result for orders where \'term1\' is found in any field and \'term2\' is also found in any field. If only \'term1\' or \'term2\' is found in the fields, the order is not included in the results. * @param {'allOrderItems' | 'notAllOrderItems'} [filterDeliverabilityStatus] filter for deliverabilityStatus By default, all orders are returned. Use \'allOrderItems\' to return all deliverable orders (\'availableCount\' of all \'orderItems\' is greater or equal than the ordered \'count\') Use \'notAllOrderItems\' to specifically return not deliverable orders (\'availableCount\' of at least one \'orderItem\' is smaller than the ordered \'count\' * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterStatus, filterExternalOrderId, filterExternalCustomerId, filterExternalOrderReference, filterOrderDateFrom, filterOrderDateTo, filterOrderNumber, filterSearch, filterDeliverabilityStatus, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrderCollection(page, pageSize, paginationMode, sortBy, filterShopCode, filterStatus, filterExternalOrderId, filterExternalCustomerId, filterExternalOrderReference, filterOrderDateFrom, filterOrderDateTo, filterOrderNumber, filterSearch, filterDeliverabilityStatus, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Import one or more new orders. The file type is controlled by the content type attribute of the uploaded file * @summary Import one or more new orders. * @param {File} file File to upload * @param {*} [options] Override http request option. * @throws {RequiredError} */ orderBulkImport(file, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.orderBulkImport(file, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Add a new order referenced by the given orderNumber. * @summary Add a new order. * @param {string} orderNumber The number the order should be referred by. \\ This number is user defined, must be unique and has a maximum length (check maxLength field). \\ Please ensure that it does not contain any of the following character sequences: \'/\', \'%2F\', \'%2f\', \'?\', \'%3F\', \'%3f\',\'#\', \'%23\', \'&\', \'%26\'. \\ Using any of these will result in the route not being handled correctly. * @param {NewOrder} newOrder * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrder(orderNumber, newOrder, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.postOrder(orderNumber, newOrder, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Cancel all open order items of the order specified by the given order number (set in param orderNumber). * @summary Cancel open order items. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrderCancelOpenOrderItems(orderNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.postOrderCancelOpenOrderItems(orderNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Trigger partial delivery for the order specified by the given order number (set in param orderNumber). * @summary Trigger partial delivery for an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ postOrderPartialDelivery(orderNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.postOrderPartialDelivery(orderNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Create reconsignment announcements for an order. \\ Only delivered orders are reconsignable. \\ If the order has been redacted, it is also not reconsignable. \\ The created reconsignment announcement(s) are returned in the response. * @summary Create reconsignment announcements for an order. * @param {string} orderNumber The number the order is referred by. * @param {NewReconsignmentAnnouncement} newReconsignmentAnnouncement * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ reconsignOrder(orderNumber, newReconsignmentAnnouncement, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.reconsignOrder(orderNumber, newReconsignmentAnnouncement, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Redact the order and all other orders linked to the given order number (set in the param orderNumber) in a GDPR article 17 conform way. \\ Only orders with one of the following statuses are redactable: - delivered - deleted - canceled * @summary Redact an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ redactOrder(orderNumber, shopCode, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.redactOrder(orderNumber, shopCode, options); return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; exports.OrderApiFp = OrderApiFp; /** * OrderApi - factory interface * @export */ const OrderApiFactory = function (configuration, basePath, axios) { const localVarFp = (0, exports.OrderApiFp)(configuration); return { /** * Cancel the order specified by the given order number (set in param orderNumber). An orderNumber from a canceled order cannot be used for a new order, because they must always be unique. * @summary Cancel an order. * @param {string} orderNumber The number the order is referred by. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ cancelOrder(orderNumber, shopCode, options) { return localVarFp.cancelOrder(orderNumber, shopCode, options).then((request) => request(axios, basePath)); }, /** * Get an order by order number. * @summary Get an order by order number. * @param {string} orderNumber The order number as defined during the creation of the order. * @param {string} [shopCode] The shopCode used internally to distinguish between clients.\\ _This code is optional, if your identity is assigned to only one shop. Otherwise the response would be a 422 HTTP Error._ * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrder(orderNumber, shopCode, options) { return localVarFp.getOrder(orderNumber, shopCode, options).then((request) => request(axios, basePath)); }, /** * Get a spreadsheet template for performing POST queries to the respective endpoint. The file type is controlled by the accept header. The fill-in help in the second line can be removed or remain. * @summary Get a spreadsheet template for performing POST queries to the respective endpoint. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getOrderBulkImportTemplate(options) { return localVarFp.getOrderBulkImportTemplate(options).then((request) => request(axios, basePath)); }, /** * Get a list of shop orders. * @summary Get a list of shop orders. * @param {number} [page] The page to read. Default is the first page. * @param {number} [pageSize] The maximum size per page is 100. Default is 100. * @param {'default' | 'totalCount'} [paginationMode] The paginationMode to use: - default: The total number of items in the collectio