export type CreateApiCustomersCustomerIdArgs = {'api-key'?: string | undefined, 'auth-key'?: string | undefined, customerId: string, body: {firstName?: string | undefined, middleName?: string | undefined, lastName?: string | undefined, phone?: string | undefined, email?: string | undefined, gender?: string | undefined, country?: string | undefined, usTaxPayer?: boolean | undefined, dob?: string | undefined, politicallyExposedNames?: string | undefined, address1?: string | undefined, address2?: string | undefined, city?: string | undefined, state?: string | undefined, postalCode?: string | undefined, employmentStatus?: string | undefined, employmentPosition?: string | undefined, employmentCompany?: string | undefined, employmentType?: string | undefined, employmentCountry?: string | undefined, isBroker?: boolean | undefined, directorOf?: string | undefined, investmentObjectives?: string | undefined, investmentExperience?: string | undefined, annualIncome?: number | undefined, networthLiquid?: number | undefined, networthTotal?: number | undefined, riskTolerance?: string | undefined, partnerToken?: string | undefined}}; export type CreateApiCustomersCustomerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update User * * POST /customers/{customerId} */ export const createApiCustomersCustomerId = async (args: CreateApiCustomersCustomerIdArgs, options?: CreateApiCustomersCustomerIdOptions) => { const {baseUrl = "https://uatclientapi-v2.stockal.com/client/v2", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") 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/${encodeURIComponent(String(args.customerId))}${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 (await res.json()) as unknown };