export type JTLDataContractsKeysArtikelKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateItemDuplicate = {sku?: string | undefined, name?: string | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateOversalesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateAttributesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateImagesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDownloadFilesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateUploadFilesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMediaFilesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCharacteristicsDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateBomDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateVariationsDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateConfigurationsDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDescriptionsDuplicationOptions = {isActive?: boolean | undefined, considerDescriptions?: boolean | undefined, considerMetadata?: boolean | undefined, considerUrlPaths?: boolean | undefined, considerNames?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCrossSellingDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCustomFieldsDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreatePurchasePricesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateIdentifiersDuplicationOptions = {isActive?: boolean | undefined, considerEan?: boolean | undefined, considerIsbn?: boolean | undefined, considerUpc?: boolean | undefined, considerHan?: boolean | undefined, considerTaricCode?: boolean | undefined, considerCountryCode?: boolean | undefined, considerHazardNumber?: boolean | undefined, considerSeries?: boolean | undefined, considerUnNumber?: boolean | undefined, considerAmazonFnsku?: boolean | undefined, considerNotes?: boolean | undefined, considerSearchTerms?: boolean | undefined, considerIncludeInPriceList?: boolean | undefined, considerOrderSuggestions?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSalesPricesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMasterDataDuplicationOptions = {isActive?: boolean | undefined, considerManufacturer?: boolean | undefined, considerProductGroup?: boolean | undefined, considerTaxClass?: boolean | undefined, considerShippingClass?: boolean | undefined, considerBasePriceUnit?: boolean | undefined, considerMinimumPurchaseSettings?: boolean | undefined, considerPackaging?: boolean | undefined, considerNonDiscountable?: boolean | undefined, considerItemType?: boolean | undefined, considerInventoryManagement?: boolean | undefined, considerMinMaxInventory?: boolean | undefined, considerProductCompliancePerson?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSpecialPricesDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDeliveryOptionsDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMeasurementssDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSuppliersDuplicationOptions = {isActive?: boolean | undefined, keepItemNumber?: boolean | undefined, keepItemName?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSaleschannelDuplicationOptions = {isActive?: boolean | undefined, considerHighlightOptions?: boolean | undefined}; export type JTLDataContractsKeysShopKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateScxDuplicationOptions = {isActive?: boolean | undefined, considerCategoryMappings?: boolean | undefined, considerSalesChannelFieldValues?: boolean | undefined, considerEveryShop?: boolean | undefined, shopsToConsider?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreatePackagingDuplicationOptions = {isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateItemDuplicationOptions = {oversalesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateOversalesDuplicationOptions | undefined, attributesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateAttributesDuplicationOptions | undefined, imagesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateImagesDuplicationOptions | undefined, downloadFilesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDownloadFilesDuplicationOptions | undefined, uploadFilesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateUploadFilesDuplicationOptions | undefined, mediaFilesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMediaFilesDuplicationOptions | undefined, characteristicsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCharacteristicsDuplicationOptions | undefined, bomDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateBomDuplicationOptions | undefined, variationsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateVariationsDuplicationOptions | undefined, configurationsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateConfigurationsDuplicationOptions | undefined, descriptionsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDescriptionsDuplicationOptions | undefined, crossSellingDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCrossSellingDuplicationOptions | undefined, customFieldsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateCustomFieldsDuplicationOptions | undefined, purchasePricesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreatePurchasePricesDuplicationOptions | undefined, identifiersDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateIdentifiersDuplicationOptions | undefined, salesPricesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSalesPricesDuplicationOptions | undefined, masterDataDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMasterDataDuplicationOptions | undefined, specialPricesDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSpecialPricesDuplicationOptions | undefined, deliveryOptionsDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateDeliveryOptionsDuplicationOptions | undefined, measurementssDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateMeasurementssDuplicationOptions | undefined, suppliersDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSuppliersDuplicationOptions | undefined, saleschannelDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateSaleschannelDuplicationOptions | undefined, scxDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateScxDuplicationOptions | undefined, packagingDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreatePackagingDuplicationOptions | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemDuplicateItemsCommandRequest = {duplicateItemId?: JTLDataContractsKeysArtikelKey | undefined, duplicatesToCreate?: Array | undefined, executeItemCreatedWorkflowOnCreation?: boolean | undefined, itemDuplicationOptions?: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemCreateItemDuplicationOptions | undefined}; export type CreateApiV2DuplicateItemsArgs = {'x-tenant-id': string, 'x-runas'?: string | undefined, 'x-companyid'?: string | undefined, body: JTLWawiItemPublicApiDataTransferObjectsV2DuplicateItemDuplicateItemsCommandRequest}; export type CreateApiV2DuplicateItemsOptions = {baseUrl?: string | undefined, oauth2AuthorizationCode?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates one or more duplicates of an existing item with specified duplication options. * * POST /v2/DuplicateItems * * Also accepts auth: oauth2-client-credentials */ export const createApiV2DuplicateItems = async (args: CreateApiV2DuplicateItemsArgs, options?: CreateApiV2DuplicateItemsOptions) => { const {baseUrl = "https://scx-sbx.api.jtl-software.com", fetch: fetchFn = fetch, oauth2AuthorizationCode} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['x-tenant-id'] != null) headers.set("x-tenant-id", String(args['x-tenant-id'])) if (args['x-runas'] != null) headers.set("x-runas", String(args['x-runas'])) if (args['x-companyid'] != null) headers.set("x-companyid", String(args['x-companyid'])) if (oauth2AuthorizationCode !== undefined) headers.set('authorization', `Bearer ${oauth2AuthorizationCode}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/DuplicateItems${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return (await res.json()) as unknown };