export type GetApiStoresStoreIdCustomerPortalArgs = {storeId: string, token?: string | undefined, order_id?: string | undefined}; export type GetApiStoresStoreIdCustomerPortalOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Navigate to Customer Portal * * GET /stores/{storeId}/customer-portal */ export const getApiStoresStoreIdCustomerPortal = async (args: GetApiStoresStoreIdCustomerPortalArgs, options?: GetApiStoresStoreIdCustomerPortalOptions) => { const {baseUrl = "https://api.getredo.com/v2.2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.token != null) query.append("token", String(args.token)) if (args.order_id != null) query.append("order_id", String(args.order_id)) const url = `${baseUrl.replace(/\/+$/, '')}/stores/${encodeURIComponent(String(args.storeId))}/customer-portal${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 undefined };