export type IndividualCurrencyExtra = {country_of_birth: unknown, country_of_issuance: unknown, currency: 'usd', id_number: unknown, ip_address?: unknown | undefined, occupation_code: unknown}; export type Gender = 'male' | 'female' | 'undefined'; export type IndividualIdentification = {country_of_issuance: unknown, expiry_date: string, number: unknown, type: 'passport'} | {country_of_issuance: unknown, expiry_date: string, number: unknown, type: 'national_id'}; export type AedLicenseIssuer = 'mainland' | 'freezone' | 'international'; export type BusinessCurrencyExtra = {currency: 'usd', industry_code: unknown, ip_address?: unknown | undefined, tax_number: unknown} | {currency: 'aed', license_issuer: AedLicenseIssuer, trade_license_expiry?: (string | null) | undefined}; export type RegulatoryLicenseType = 'banking' | 'card_acquiring' | 'card_issuer' | 'crypto_asset' | 'electronic_money' | 'forex' | 'payments' | 'none' | 'other' | 'trading'; export type UpdateCustomerRequest = {individual: {currency_extra?: (Array | null) | undefined, date_of_birth?: (string | null) | undefined, first_name?: (unknown | null) | undefined, gender?: (Gender | null) | undefined, identification?: (IndividualIdentification | null) | undefined, last_name?: (unknown | null) | undefined, middle_name?: (unknown | null) | undefined, nationality?: (unknown | null) | undefined}} | {business: {business_name?: (unknown | null) | undefined, country_of_issuance?: (unknown | null) | undefined, currency_extra?: (Array | null) | undefined, issuance_authority?: (unknown | null) | undefined, linked_documents?: (Array | null) | undefined, registration_date?: (string | null) | undefined, registration_number?: (unknown | null) | undefined, regulatory_licenses?: (Array | null) | undefined}} | null; export type PatchApiV1CustomersCustomerIdArgs = {customer_id: string, body: UpdateCustomerRequest}; export type PatchApiV1CustomersCustomerIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update customer * * PATCH /v1/customers/{customer_id} */ export const patchApiV1CustomersCustomerId = async (args: PatchApiV1CustomersCustomerIdArgs, options?: PatchApiV1CustomersCustomerIdOptions) => { const {baseUrl = "https://auth-sandbox.fuse.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/customers/${encodeURIComponent(String(args.customer_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 undefined };