export type GetApiCustomersStatusCustomerIdArgs = {customerId: string, 'api-key': string, 'auth-key': string}; export type GetApiCustomersStatusCustomerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get KYC Status * * GET /customers/status/{customerId} */ export const getApiCustomersStatusCustomerId = async (args: GetApiCustomersStatusCustomerIdArgs, options?: GetApiCustomersStatusCustomerIdOptions) => { const {baseUrl = "https://uatclientapi-v2.stockal.com/client/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args['api-key'] != null) headers.set("api-key", String(args['api-key'])) if (args['auth-key'] != null) headers.set("auth-key", String(args['auth-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/customers/status/${encodeURIComponent(String(args.customerId))}${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 (await res.json()) as unknown };