export type CreateApiDiditV3AmlArgs = {body: {full_name: string, entity_type?: string | undefined, date_of_birth?: string | undefined, nationality?: string | undefined, document_number?: string | undefined, aml_score_approve_threshold?: number | undefined, aml_score_review_threshold?: number | undefined, aml_name_weight?: number | undefined, aml_dob_weight?: number | undefined, aml_country_weight?: number | undefined, aml_match_score_threshold?: number | undefined, include_adverse_media?: boolean | undefined, include_ongoing_monitoring?: boolean | undefined, save_api_request?: boolean | undefined, vendor_data?: string | undefined}}; export type CreateApiDiditV3AmlOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * The AML Screening API allows you to screen individuals or companies against global watchlists and high-risk databases. This API provides real-time screening capabilities to detect potential matches and mitigate risks associated with financial fraud and terrorism. You can screen both persons and companies by specifying the `entity_type` parameter. * * POST /didit/v3/aml */ export const createApiDiditV3Aml = async (args: CreateApiDiditV3AmlArgs, options?: CreateApiDiditV3AmlOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/didit/v3/aml${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 };