export type CreateApiResourcesApplicantsApplicantIdRejectArgs = {applicantId: string, body: {note?: string | undefined, tags?: Array | undefined, reasons: {fraud?: Array | undefined, finance?: Array | undefined, regulation?: Array | undefined, abuse?: Array | undefined, device?: Array | undefined, manual?: Array | undefined}}}; export type CreateApiResourcesApplicantsApplicantIdRejectOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Reject applicant * * POST /resources/applicants/{applicantId}/-/reject */ export const createApiResourcesApplicantsApplicantIdReject = async (args: CreateApiResourcesApplicantsApplicantIdRejectArgs, options?: CreateApiResourcesApplicantsApplicantIdRejectOptions) => { 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))}/-/reject${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 };