export type PatchApiApiV1SalesPricesIdArgs = {id: string, body: {validFrom?: (string | null) | undefined, expiresAt?: (string | null) | undefined, amount?: (number | unknown) | undefined, packageAmount?: (number | null) | undefined, customer?: ({id: string} | null) | undefined, customerGroup?: ({id: string} | null) | undefined, price?: ({amount?: unknown | undefined, currency?: ('EUR' | 'USD' | 'JPY' | 'BGN' | 'CZK' | 'DKK' | 'GBP' | 'HUF' | 'PLN' | 'RON' | 'SEK' | 'CHF' | 'ISK' | 'NOK' | 'HRK' | 'RUB' | 'TRY' | 'AUD' | 'BRL' | 'CAD' | 'CNY' | 'HKD' | 'IDR' | 'ILS' | 'INR' | 'KRW' | 'MXN' | 'MYR' | 'NZD' | 'PHP' | 'SGD' | 'THB' | 'ZAR' | 'ARS' | 'CLP' | 'SAR' | 'AED' | 'QAR') | undefined}) | undefined, customerProductNumber?: (string | null) | undefined, isNotCalculatedFromExchangeTable?: (boolean | null) | undefined, hideInBulkPriceListing?: (boolean | null) | undefined, remark?: (string | null) | undefined}}; export type PatchApiApiV1SalesPricesIdOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update sales price * * PATCH /api/v1/salesPrices/{id} */ export const patchApiApiV1SalesPricesId = async (args: PatchApiApiV1SalesPricesIdArgs, options?: PatchApiApiV1SalesPricesIdOptions) => { const {baseUrl = "https://xentral.xentral.biz", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/salesPrices/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 undefined };