export type JTLDataContractsKeysWarengruppeKey = string; export type JTLDataContractsKeysVersandklasseKey = string; export type JTLDataContractsKeysHerstellerKey = string; export type JTLDataContractsKeysKategorieKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCategory = {categoryId?: JTLDataContractsKeysKategorieKey | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCategories = {categories?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemIdentifiers = {sku?: string | undefined, amazonFnsku?: string | undefined, gtin?: string | undefined, manufacturerNumber?: string | undefined, isbn?: string | undefined, tariccode?: string | undefined, upc?: string | undefined, unNumber?: string | undefined, hazardNumber?: string | undefined, ownIdentifier?: string | undefined, defaultAsin?: string | undefined, jfsku?: string | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDescriptionData = {itemName?: string | undefined, shortDescription?: string | undefined, description?: string | undefined, metaDescription?: string | undefined, metaKeywords?: string | undefined, titleTag?: string | undefined, urlPath?: string | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDefaultDescription = {languageIso?: string | undefined, descriptionData?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDescriptionData | undefined}; export type JTLWawiRestContractsModelsSalesChannelId = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateSalesChannelDescription = {salesChannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, languageIso?: string | undefined, descriptionData?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDescriptionData | undefined}; export type JTLDataContractsKeysPlattformKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreatePlatformDescription = {platformId?: JTLDataContractsKeysPlattformKey | undefined, languageIso?: string | undefined, descriptionData?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDescriptionData | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemDescriptions = {defaultDescriptions?: Array | undefined, salesChannelDescriptions?: Array | undefined, platformDescriptions?: Array | undefined}; export type JTLDataContractsKeysShopKey = string; export type JTLDataContractsKeysKundenGruppeKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemPrice = {fromQuantity?: number | undefined, netPrice?: number | undefined, reduceStandardPriceByPercent?: number | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomerGroupPrices = {customerGroupId?: JTLDataContractsKeysKundenGruppeKey | undefined, prices?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSaleschannelPrices = {saleschannelId?: JTLDataContractsKeysShopKey | undefined, customerGroupPrices?: Array | undefined, isActive?: boolean | undefined}; export type JTLDataContractsKeysKundeKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomerPrices = {customerId?: JTLDataContractsKeysKundeKey | undefined, prices?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemPrices = {ignoreDiscounts?: boolean | undefined, salesPriceNet?: number | undefined, suggestedRetailPrice?: number | undefined, purchasePriceNet?: number | undefined, ebayPrice?: number | undefined, amazonPrice?: number | undefined, salesChannelPrices?: Array | undefined, customerPrices?: Array | undefined, defaultPrices?: Array | undefined}; export type JTLDataContractsKeysLieferantKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateSupplierPrice = {fromQuantity?: number | undefined, netPrice?: number | undefined, usePercentageDiscount?: boolean | undefined, percentageDiscount?: number | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSupplier = {supplierId?: JTLDataContractsKeysLieferantKey | undefined, supplierItemName?: string | undefined, supplierItemNumber?: string | undefined, stockLevel?: number | undefined, netPurchasePrice?: number | undefined, minimumPurchaseQuantity?: number | undefined, deliveryTimeInDays?: number | undefined, isDropshippingActive?: boolean | undefined, packageUnitDescription?: string | undefined, packageUnitQuantity?: number | undefined, notes?: string | undefined, vatRate?: number | undefined, useSupplierDeliveryTime?: boolean | undefined, includeSupplierStock?: boolean | undefined, purchaseInterval?: number | undefined, scalePrices?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSuppliers = {defaultSupplier?: JTLDataContractsKeysLieferantKey | undefined, defaultDropshippingSupplier?: JTLDataContractsKeysLieferantKey | undefined, suppliers?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemMeasurements = {height?: number | undefined, length?: number | undefined, shippingWeight?: number | undefined, weight?: number | undefined, width?: number | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemImage = {blobIdentifier?: string | undefined, sortNumber?: number | undefined, isMainImage?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreatePlatformImages = {platformId?: JTLDataContractsKeysPlattformKey | undefined, images?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateSaleschannelImages = {saleschannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, images?: Array | undefined}; export type JTLDataContractsKeysEbayUserKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateEbayImages = {ebayAccountId?: JTLDataContractsKeysEbayUserKey | undefined, images?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemImages = {defaultImages?: Array | undefined, platformImages?: Array | undefined, saleschannelImages?: Array | undefined, ebayImages?: Array | undefined}; export type JTLDataContractsKeysEigenesFeldKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomFieldValue = {fieldId?: JTLDataContractsKeysEigenesFeldKey | undefined, value?: string | undefined, valueCultureName?: string | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomFields = {fieldValues?: Array | undefined}; export type JTLDataContractsKeysVariationKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateDescription = {languageIso?: string | undefined, name?: string | undefined}; export type JTLDataContractsKeysVariationWertKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateCustomerGroupSurcharge = {customerGroupId?: JTLDataContractsKeysKundenGruppeKey | undefined, surcharge?: number | undefined, isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateSalesChannelSurcharge = {salesChannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, surcharges?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateVariationValueSurcharges = {defaultSurchargeNet?: number | undefined, customerGroupSurcharges?: Array | undefined, salesChannelSurcharges?: Array | undefined}; export type JTLDataContractsKeysBildKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateVariationValue = {variationValueId?: JTLDataContractsKeysVariationWertKey | undefined, itemNumber?: string | undefined, gTIN?: string | undefined, weightOffset?: number | undefined, descriptions?: Array | undefined, surcharges?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateVariationValueSurcharges | undefined, position?: number | undefined, image?: JTLDataContractsKeysBildKey | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsVariationType = 0 | 1 | 2 | 3 | 4 | 5 | 6; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateVariation = {variationId?: JTLDataContractsKeysVariationKey | undefined, position?: number | undefined, descriptions?: Array | undefined, values?: Array | undefined, variationType?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsVariationType | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemVariations = {variations?: Array | undefined}; export type JTLDataContractsKeysMerkmalWertKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemFeature = {featureId?: JTLDataContractsKeysMerkmalWertKey | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemFeatures = {features?: Array | undefined}; export type JTLDataContractsKeysAttributKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateAttributeValue = {languageIso?: string | undefined, value?: string | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateAttributeSalesChannelValues = {salesChannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, values?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateAttributeValues = {attributeId?: JTLDataContractsKeysAttributKey | undefined, defaultValues?: Array | undefined, salesChannelValues?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemAttributes = {values?: Array | undefined}; export type JTLDataContractsKeysEinheitKey = string; export type JTLDataContractsKeysMassEinheitKey = string; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemUnitPricing = {salesUnitId?: JTLDataContractsKeysEinheitKey | undefined, packagingUnitId?: JTLDataContractsKeysEinheitKey | undefined, innerQuantity?: number | undefined, innerQuantityUnitId?: JTLDataContractsKeysMassEinheitKey | undefined, isBasePriceDeclared?: boolean | undefined, basePriceReferenceUnitId?: JTLDataContractsKeysMassEinheitKey | undefined, basePriceReferenceAmount?: number | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomerGroupSpecialPrice = {customerGroupId?: JTLDataContractsKeysKundenGruppeKey | undefined, netPrice?: number | undefined, isActive?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSalesChannelSpecialPrices = {salesChannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, specialPrices?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSpecialPrices = {isActive?: boolean | undefined, startDate?: string | undefined, endDate?: string | undefined, isEndDateActive?: boolean | undefined, minimumStockQuantity?: number | undefined, isStockRestrictionActive?: boolean | undefined, salesChannelSpecialPrices?: Array | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateNegativeStockPlatform = {platformId?: JTLDataContractsKeysPlattformKey | undefined, isNegativeStockAllowed?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateNegativeStockSalesChannel = {salesChannelId?: JTLWawiRestContractsModelsSalesChannelId | undefined, isNegativeStockAllowed?: boolean | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsSerialNumberType = 0 | 1 | 2; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemStorageConstraints = {allowNegativeStock?: boolean | undefined, itemPlatformNegativeStocks?: Array | undefined, itemSalesChannelNegativeStocks?: Array | undefined, buffer?: number | undefined, globalMinimumStockLevel?: number | undefined, hasBatch?: boolean | undefined, isInventoryManagementActive?: boolean | undefined, isBestBeforeManaged?: boolean | undefined, isStockDivisible?: boolean | undefined, serialNumberType?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsSerialNumberType | undefined}; export type JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCommandRequest = {productGroupId?: JTLDataContractsKeysWarengruppeKey | undefined, shippingClassId?: JTLDataContractsKeysVersandklasseKey | undefined, manufacturerId?: JTLDataContractsKeysHerstellerKey | undefined, categories?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCategories | undefined, identifiers?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemIdentifiers | undefined, descriptions?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemDescriptions | undefined, prices?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemPrices | undefined, suppliers?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSuppliers | undefined, measurements?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemMeasurements | undefined, images?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemImages | undefined, customFields?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCustomFields | undefined, variations?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemVariations | undefined, features?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemFeatures | undefined, attributes?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemAttributes | undefined, unitPricing?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemUnitPricing | undefined, specialPrices?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemSpecialPrices | undefined, storageConstraints?: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemStorageConstraints | undefined}; export type CreateApiV2ItemdetailsCreateArgs = {'x-tenant-id': string, 'x-runas'?: string | undefined, 'x-companyid'?: string | undefined, body: JTLWawiItemPublicApiDataTransferObjectsV2ItemdetailsCreateItemCommandRequest}; export type CreateApiV2ItemdetailsCreateOptions = {baseUrl?: string | undefined, oauth2AuthorizationCode?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates a new regular item with all specified properties. This command enables complete configuration of an item including identifiers, descriptions, prices, and measurements. * * POST /v2/itemdetails/create * * Also accepts auth: oauth2-client-credentials */ export const createApiV2ItemdetailsCreate = async (args: CreateApiV2ItemdetailsCreateArgs, options?: CreateApiV2ItemdetailsCreateOptions) => { 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/itemdetails/create${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 };