export type CreateApiResourcesApplicantsApplicantIdInfoCompanyInfoBeneficiariesArgs = {applicantId: string, body: {applicant: {id: string}, applicantId: string, positions?: Array | undefined, type: 'ubo' | 'shareholder' | 'representative' | 'director'}}; export type CreateApiResourcesApplicantsApplicantIdInfoCompanyInfoBeneficiariesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Link beneficiary to company (KYB 1.0) * * POST /resources/applicants/{applicantId}/info/companyInfo/beneficiaries */ export const createApiResourcesApplicantsApplicantIdInfoCompanyInfoBeneficiaries = async (args: CreateApiResourcesApplicantsApplicantIdInfoCompanyInfoBeneficiariesArgs, options?: CreateApiResourcesApplicantsApplicantIdInfoCompanyInfoBeneficiariesOptions) => { 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))}/info/companyInfo/beneficiaries${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 };