export type WaitingTime = {waitingTime: number}; export type CreateApiApiCheckoutPvtConfigurationWindowToChangeSellerArgs = {'Content-Type': string, Accept: string, individualShippingEstimates?: boolean | undefined, body: WaitingTime}; export type CreateApiApiCheckoutPvtConfigurationWindowToChangeSellerOptions = {baseUrl?: string | undefined, appKey?: string | undefined, appToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update window to change seller * * POST /api/checkout/pvt/configuration/window-to-change-seller * * Also accepts auth: VtexIdclientAutCookie */ export const createApiApiCheckoutPvtConfigurationWindowToChangeSeller = async (args: CreateApiApiCheckoutPvtConfigurationWindowToChangeSellerArgs, options?: CreateApiApiCheckoutPvtConfigurationWindowToChangeSellerOptions) => { const {baseUrl = "https://apiexamples.vtexcommercestable.com.br", fetch: fetchFn = fetch, appKey, appToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['Content-Type'] != null) headers.set("Content-Type", String(args['Content-Type'])) if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (args.individualShippingEstimates != null) query.append("individualShippingEstimates", String(args.individualShippingEstimates)) if (appKey !== undefined) headers.set("X-VTEX-API-AppKey", appKey) if (appToken !== undefined) headers.set("X-VTEX-API-AppToken", appToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/checkout/pvt/configuration/window-to-change-seller${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 undefined };