export type CreateApiBankingEntitiesEntityIdOnboardingsArgs = {entity_id: string, 'x-idempotency-key': string, body: {account_id: string, yuno_connection_id: string, onboarding_type: 'ONE_STEP' | 'PREVIOUSLY_ONBOARDED', compliance_declaration?: ({terms_of_service?: ({accepted: boolean, version?: string | undefined, accepted_at: string, accepted_ip?: string | undefined}) | undefined, privacy_policy?: ({accepted: boolean, version?: string | undefined, accepted_at: string, accepted_ip?: string | undefined}) | undefined}) | undefined, risk_assessment?: ({assessed_at?: string | undefined, pep_status?: ({is_pep?: boolean | undefined, pep_level?: ('DIRECT' | 'CLOSE_ASSOCIATE' | 'FAMILY_MEMBER' | 'null' | null) | undefined, position?: (string | null) | undefined, country?: (string | null) | undefined}) | undefined, rca_status?: ({risk_level?: ('LOW' | 'MEDIUM' | 'HIGH') | undefined, classified_at?: string | undefined, assessed_by?: string | undefined}) | undefined, sanctions_screening?: ({appears_on_sanctions_list?: boolean | undefined, sanctions_list_name?: (string | null) | undefined, screened_at?: string | undefined}) | undefined}) | undefined, source_of_funds?: ({primary_source?: ('EMPLOYMENT_SALARY' | 'BUSINESS_INCOME' | 'INVESTMENTS' | 'RENTAL_INCOME' | 'PENSION' | 'GOVERNMENT_BENEFITS' | 'INHERITANCE' | 'FAMILY_SUPPORT' | 'SAVINGS' | 'LOTTERY_GAMBLING' | 'SALE_OF_ASSETS' | 'CRYPTOCURRENCY' | 'FREELANCE_CONSULTING' | 'OTHER') | undefined, secondary_sources?: Array | undefined, description?: string | undefined, estimated_annual_income?: ({amount?: number | undefined, currency?: string | undefined}) | undefined}) | undefined, documentation?: (Array<{type: 'IDENTITY_DOCUMENT' | 'PROOF_OF_ADDRESS' | 'BANK_STATEMENT' | 'BUSINESS_DOCUMENT' | 'TAX_INFORMATION' | 'FINANCIAL_DOCUMENT' | 'BIOMETRIC_VERIFICATION' | 'EMPLOYMENT_INFORMATION', identity_document?: ({subtype?: ('PASSPORT' | 'DRIVERS_LICENSE' | 'NATIONAL_ID' | 'STATE_ID') | undefined, document_number?: string | undefined, issuing_country?: string | undefined, issuing_state?: string | undefined, issued_at?: string | undefined, expires_at?: string | undefined, front_image?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined, back_image?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, proof_of_address?: ({subtype?: ('UTILITY_BILL' | 'BANK_STATEMENT' | 'LEASE_AGREEMENT' | 'MORTGAGE_STATEMENT' | 'TAX_DOCUMENT') | undefined, provider_name?: string | undefined, bill_type?: string | undefined, issued_at?: string | undefined, account_number?: string | undefined, verified_address?: ({address_line_1?: string | undefined, city?: string | undefined, state?: string | undefined, zip_code?: string | undefined, country?: string | undefined}) | undefined, file?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, bank_statement?: ({bank_name?: string | undefined, account_number_last_4?: string | undefined, statement_period_start?: string | undefined, statement_period_end?: string | undefined, file?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, business_document?: ({subtype?: ('ARTICLES_OF_INCORPORATION' | 'BUSINESS_LICENSE' | 'EIN_CONFIRMATION' | 'OPERATING_AGREEMENT' | 'CERTIFICATE_OF_GOOD_STANDING') | undefined, registration_number?: string | undefined, registered_at?: string | undefined, issuing_state?: string | undefined, issuing_authority?: string | undefined, file?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, tax_information?: ({tax_records?: (Array<{country?: string | undefined, tax_id?: string | undefined, tax_id_type?: ('SSN' | 'EIN' | 'ITIN' | 'VAT' | 'ABN' | 'NIF' | 'TIN' | 'OTHER') | undefined, is_primary?: boolean | undefined}>) | undefined, tax_document_type?: ('W9' | '1099' | 'TAX_RETURN' | 'SSN_CARD' | 'ITIN_LETTER' | 'EIN_CONFIRMATION' | 'VAT_CERTIFICATE') | undefined, tax_year?: string | undefined, issuing_authority?: string | undefined, file?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, financial_document?: ({subtype?: ('BALANCE_SHEET' | 'PROFIT_LOSS_STATEMENT' | 'CASH_FLOW_STATEMENT' | 'FINANCIAL_AUDIT') | undefined, period_start?: string | undefined, period_end?: string | undefined, fiscal_year?: string | undefined, audited?: boolean | undefined, auditor_name?: (string | null) | undefined, file?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, biometric_verification?: ({verification_method?: ('FACIAL_RECOGNITION' | 'FINGERPRINT' | 'VOICE' | 'IRIS_SCAN') | undefined, capture_method?: ('LIVE_CAPTURE' | 'UPLOADED') | undefined, capture_timestamp?: string | undefined, liveness_check_passed?: boolean | undefined, confidence_score?: number | undefined, verification_provider?: string | undefined, live_image?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined, reference_image?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined, employment_information?: ({status?: ('EMPLOYED' | 'SELF_EMPLOYED' | 'UNEMPLOYED' | 'RETIRED' | 'STUDENT') | undefined, employer_name?: string | undefined, occupation?: string | undefined, industry?: string | undefined, started_at?: string | undefined, annual_income?: ({amount?: number | undefined, currency?: string | undefined}) | undefined, verification_document?: ({file_name?: string | undefined, content_type?: string | undefined, content?: string | undefined}) | undefined}) | undefined}>) | undefined}}; export type CreateApiBankingEntitiesEntityIdOnboardingsOptions = {baseUrl?: string | undefined, publicApiKey?: string | undefined, privateSecretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Entity Onboarding (Banking Connectivity) * * POST /banking/entities/{entity_id}/onboardings */ export const createApiBankingEntitiesEntityIdOnboardings = async (args: CreateApiBankingEntitiesEntityIdOnboardingsArgs, options?: CreateApiBankingEntitiesEntityIdOnboardingsOptions) => { const {baseUrl = "https://api-sandbox.y.uno/v1", fetch: fetchFn = fetch, publicApiKey, privateSecretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-idempotency-key'] != null) headers.set("x-idempotency-key", String(args['x-idempotency-key'])) if (publicApiKey !== undefined) headers.set("PUBLIC-API-KEY", publicApiKey) if (privateSecretKey !== undefined) headers.set("PRIVATE-SECRET-KEY", privateSecretKey) const url = `${baseUrl.replace(/\/+$/, '')}/banking/entities/${encodeURIComponent(String(args.entity_id))}/onboardings${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 undefined };