export type CreateApiResourcesApplicantsApplicantIdEkycConfirmConfirmationIdArgs = {applicantId: string, confirmationId: string, body: {otp?: {code: string} | undefined, oauth?: {completeUrl: string} | undefined}}; export type CreateApiResourcesApplicantsApplicantIdEkycConfirmConfirmationIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Confirm applicant data for Non-Doc Verification * * POST /resources/applicants/{applicantId}/ekyc/confirm/{confirmationId} */ export const createApiResourcesApplicantsApplicantIdEkycConfirmConfirmationId = async (args: CreateApiResourcesApplicantsApplicantIdEkycConfirmConfirmationIdArgs, options?: CreateApiResourcesApplicantsApplicantIdEkycConfirmConfirmationIdOptions) => { 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 (sec0 !== undefined) headers.set("X-App-Token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/resources/applicants/${encodeURIComponent(String(args.applicantId))}/ekyc/confirm/${encodeURIComponent(String(args.confirmationId))}${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 };