export type CreateApiResourcesApplicantActionsForApplicantApplicantIdArgs = {applicantId: string, levelName: string, body: {externalActionId: string, paymentSource?: ({fixedInfo?: ({type?: ('bankCard' | 'bankAccount' | 'bankStatement' | 'eWallet' | 'cryptoWallet') | undefined, fullName?: string | undefined, accountIdentifier?: string | undefined, institutionName?: string | undefined, country?: string | undefined, email?: string | undefined, phone?: string | undefined, validUntil?: string | undefined, cryptoChain?: string | undefined, currencyCode?: string | undefined, memo?: string | undefined}) | undefined, checksum?: ({txns?: (Array<{date?: string | undefined, amount?: number | undefined, currencyCode?: string | undefined}>) | undefined}) | undefined}) | undefined, questionnaires?: Array | undefined, email?: string | undefined, phone?: string | undefined}}; export type CreateApiResourcesApplicantActionsForApplicantApplicantIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create applicant action * * POST /resources/applicantActions/-/forApplicant/{applicantId} */ export const createApiResourcesApplicantActionsForApplicantApplicantId = async (args: CreateApiResourcesApplicantActionsForApplicantApplicantIdArgs, options?: CreateApiResourcesApplicantActionsForApplicantApplicantIdOptions) => { const {baseUrl = "https://api.sumsub.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.levelName != null) query.append("levelName", String(args.levelName)) if (sec0 !== undefined) headers.set("X-App-Token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/resources/applicantActions/-/forApplicant/${encodeURIComponent(String(args.applicantId))}${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 };