export type GetApiApiCheckoutPvtConfigurationWindowToChangeSellerArgs = {'Content-Type': string, Accept: string, individualShippingEstimates?: boolean | undefined}; export type GetApiApiCheckoutPvtConfigurationWindowToChangeSellerOptions = {baseUrl?: string | undefined, appKey?: string | undefined, appToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get window to change seller * * GET /api/checkout/pvt/configuration/window-to-change-seller * * Also accepts auth: VtexIdclientAutCookie */ export const getApiApiCheckoutPvtConfigurationWindowToChangeSeller = async (args: GetApiApiCheckoutPvtConfigurationWindowToChangeSellerArgs, options?: GetApiApiCheckoutPvtConfigurationWindowToChangeSellerOptions) => { const {baseUrl = "https://apiexamples.vtexcommercestable.com.br", fetch: fetchFn = fetch, appKey, appToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/plain") 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: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.text() };