export type CreateApiResourcesApplicantsApplicantIdFixedInfoCompanyInfoBeneficiariesArgs = {applicantId: string, body: {applicantId?: string | undefined, types: Array, subtypes?: Array | undefined, natureOfControl?: string | undefined, shareSize?: number | undefined, beneficiaryInfo?: ({email?: string | undefined, phone?: string | undefined, firstName?: string | undefined, lastName?: string | undefined, middleName?: string | undefined, dob?: string | undefined, countryOfBirth?: string | undefined, stateOfBirth?: string | undefined, placeOfBirth?: string | undefined, legalName?: string | undefined, gender?: string | undefined, nationality?: string | undefined, country?: string | undefined, tin?: string | undefined, taxResidenceCountry?: string | undefined, companyName?: string | undefined, registrationNumber?: string | undefined, registrationLocation?: string | undefined, type?: string | undefined, legalForm?: ('privateLimitedCompany' | 'closedStockCorporation' | 'cooperativeCompany' | 'jointStockCompany' | 'openStockCorporation' | 'publicLimitedCompany' | 'unregisteredSoleProprietorship' | 'registeredSoleProprietorship' | 'selfEmployedProfessional' | 'generalPartnership' | 'limitedPartnership' | 'consortiumPartnership' | 'jointVenture' | 'trust' | 'investmentFund' | 'communityInterestCompany' | 'friendlySociety' | 'foundation' | 'association' | 'charity' | 'stateOwnedEnterprise' | 'publicInstitutionOrAgency' | 'nationalGovernmentDepartment' | 'localGovernmentDepartment') | undefined, incorporatedOn?: string | undefined, legalAddress?: string | undefined, postalAddress?: string | undefined, controlScheme?: string | undefined, taxId?: string | undefined, website?: string | undefined, street?: string | undefined, subStreet?: string | undefined, buildingNumber?: string | undefined, flatNumber?: string | undefined, town?: string | undefined, state?: string | undefined, postCode?: string | undefined, externalUserId?: string | undefined, metadata?: Array | undefined}) | undefined}}; export type CreateApiResourcesApplicantsApplicantIdFixedInfoCompanyInfoBeneficiariesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Link beneficiary to company * * POST /resources/applicants/{applicantId}/fixedInfo/companyInfo/beneficiaries */ export const createApiResourcesApplicantsApplicantIdFixedInfoCompanyInfoBeneficiaries = async (args: CreateApiResourcesApplicantsApplicantIdFixedInfoCompanyInfoBeneficiariesArgs, options?: CreateApiResourcesApplicantsApplicantIdFixedInfoCompanyInfoBeneficiariesOptions) => { 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))}/fixedInfo/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 };