export type JTLDataContractsKeysArtikelKey = string; export type JTLDataContractsKeysFirmaKey = string; export type JTLDataContractsKeysKundeKey = string; export type JTLDataContractsKeysRueckhaltegrundKey = string; export type JTLDataContractsKeysZahlungsartKey = string; export type JTLDataContractsKeysFarbeKey = string; export type JTLDataContractsKeysVorgangsstatusKey = string; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationAddress = {salutation?: string | undefined, title?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, company?: string | undefined, additionalCompanyLine?: string | undefined, street?: string | undefined, additionalAddressLine?: string | undefined, city?: string | undefined, postalCode?: string | undefined, state?: string | undefined, countryIso?: string | undefined, postId?: string | undefined, emailAddress?: string | undefined, phoneNumber?: string | undefined, mobilePhoneNumber?: string | undefined, fax?: string | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationDepartureCountry = {countryIso?: string | undefined, currencyIso?: string | undefined, currencyFactor?: number | undefined, state?: string | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedExternalSalesInvoiceType = 0 | 1 | 2; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationExternalDetails = {externalCreatedDate?: string | undefined, externalInvoiceType?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedExternalSalesInvoiceType | undefined, externalSalesQuotationNumber?: string | undefined}; export type JTLDataContractsKeysVerkaufAuftragPositionKey = string; export type JTLDataContractsKeysSteuerklasseKey = string; export type JTLDataContractsKeysSteuerschluesselKey = string; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedBillOfMaterialsType = 0 | 1 | 2; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedConfigurationItemType = 0 | 1 | 2; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedLineItemType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21; export type JTLDataContractsKeysVariationKey = string; export type JTLDataContractsKeysVariationWertKey = string; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationLineItemVariant = {extraWeight?: number | undefined, name?: string | undefined, surchargeNet?: number | undefined, value?: string | undefined, itemVariantId?: JTLDataContractsKeysVariationKey | undefined, itemVariantValueId?: JTLDataContractsKeysVariationWertKey | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationLineItem = {itemId?: JTLDataContractsKeysArtikelKey | undefined, parentSalesQuotationLineItemId?: JTLDataContractsKeysVerkaufAuftragPositionKey | undefined, taxClassId?: JTLDataContractsKeysSteuerklasseKey | undefined, taxCodeId?: JTLDataContractsKeysSteuerschluesselKey | undefined, billOfMaterialsType?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedBillOfMaterialsType | undefined, configurationItemType?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedConfigurationItemType | undefined, discountPercent?: number | undefined, fnSku?: string | undefined, name?: string | undefined, note?: string | undefined, purchasePriceNet?: number | undefined, quantity?: number | undefined, salesPriceNet?: number | undefined, salesUnit?: string | undefined, sku?: string | undefined, taxRate?: number | undefined, type?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedLineItemType | undefined, variants?: Array | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationPaymentDetails = {cashDiscount?: number | undefined, cashDiscountDays?: number | undefined, financingCosts?: number | undefined, paymentDueDateInDays?: number | undefined, currencyIso?: string | undefined, currencyFactor?: number | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationPaymentInfo = {accountHolder?: string | undefined, bankName?: string | undefined, bIC?: string | undefined, creditorId?: string | undefined, dueDate?: string | undefined, endToEndId?: string | undefined, iBAN?: string | undefined, mandateReference?: string | undefined, paymentInfo?: string | undefined, paymentReference?: string | undefined, referenceEmail?: string | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationShippingDetails = {deliveryFromDate?: string | undefined, estimatedDeliveryDate?: string | undefined, extraWeight?: number | undefined, maxDeliveryDays?: number | undefined, shippingDate?: string | undefined, shippingPriority?: number | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedSpecialTaxTreatment = 0 | 1 | 2 | 3; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedTaxSetting = 0 | 10 | 15 | 20; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationTaxDetails = {specialTaxTreatment?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedSpecialTaxTreatment | undefined, taxSetting?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedTaxSetting | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationText = {comment?: string | undefined, customerComment?: string | undefined, printText?: string | undefined, processStatus?: string | undefined}; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedItemDescriptionType = 0 | 1 | 2; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedReadOnlyType = 0 | 1 | 2; export type JTLDataContractsKeysVersandartKey = string; export type JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateSalesQuotationCommandRequest = {disableAutomaticWorkflows?: boolean | undefined, useBillingAddressAsShipmentAddress?: boolean | undefined, cartonItemId?: JTLDataContractsKeysArtikelKey | undefined, companyId?: JTLDataContractsKeysFirmaKey | undefined, customerId?: JTLDataContractsKeysKundeKey | undefined, onHoldReasonId?: JTLDataContractsKeysRueckhaltegrundKey | undefined, paymentMethodId?: JTLDataContractsKeysZahlungsartKey | undefined, processColourId?: JTLDataContractsKeysFarbeKey | undefined, processStatusId?: JTLDataContractsKeysVorgangsstatusKey | undefined, billingAddress?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationAddress | undefined, departureCountry?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationDepartureCountry | undefined, externalDetails?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationExternalDetails | undefined, lineItems?: Array | undefined, paymentDetails?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationPaymentDetails | undefined, paymentInfo?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationPaymentInfo | undefined, shipmentAddress?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationAddress | undefined, shippingDetails?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationShippingDetails | undefined, taxDetails?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationTaxDetails | undefined, text?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateCreateSalesQuotationText | undefined, customerSalesQuotationNumber?: string | undefined, customerVatId?: string | undefined, itemDescriptionType?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedItemDescriptionType | undefined, languageIso?: string | undefined, readOnlyType?: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SharedReadOnlyType | undefined, salesQuotationDate?: string | undefined, salesQuotationNumber?: string | undefined, shippingMethodId?: JTLDataContractsKeysVersandartKey | undefined, vatId?: string | undefined}; export type CreateApiV2SalesquotationCreateArgs = {'x-tenant-id': string, 'x-runas'?: string | undefined, 'x-companyid'?: string | undefined, body: JTLWawiVerkaufsverwaltungPublicApiDataTransferObjectsV2SalesQuotationDomainCreateSalesQuotationCommandRequest}; export type CreateApiV2SalesquotationCreateOptions = {baseUrl?: string | undefined, oauth2AuthorizationCode?: string | undefined, fetch?: typeof fetch | undefined}; /** * Creates a new sales quotation. * * POST /v2/salesquotation/create * * Also accepts auth: oauth2-client-credentials */ export const createApiV2SalesquotationCreate = async (args: CreateApiV2SalesquotationCreateArgs, options?: CreateApiV2SalesquotationCreateOptions) => { 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/salesquotation/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 };