export type GetApiApiVVersionCustomersImportIndividualTemplateArgs = {version: string, 'X-Tenant': string}; export type GetApiApiVVersionCustomersImportIndividualTemplateOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download template for importing individual customers * * GET /api/v{version}/customers/import/individual/template */ export const getApiApiVVersionCustomersImportIndividualTemplate = async (args: GetApiApiVVersionCustomersImportIndividualTemplateArgs, options?: GetApiApiVVersionCustomersImportIndividualTemplateOptions) => { const {baseUrl = "https://api.zrexpress.app", fetch: fetchFn = fetch, bearerAuth, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Tenant'] != null) headers.set("X-Tenant", String(args['X-Tenant'])) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) if (apiKey !== undefined) headers.set("X-Api-Key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/customers/import/individual/template${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 };