export type DeleteApiKybFormsCompanyIdBeneficiariesIdArgs = {companyId: string, id: string}; export type DeleteApiKybFormsCompanyIdBeneficiariesIdOptions = {baseUrl?: string | undefined, kybTokenAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete beneficiary * * DELETE /kyb/forms/{companyId}/beneficiaries/{id}/ * * Also accepts auth: apiKeyPair */ export const deleteApiKybFormsCompanyIdBeneficiariesId = async (args: DeleteApiKybFormsCompanyIdBeneficiariesIdArgs, options?: DeleteApiKybFormsCompanyIdBeneficiariesIdOptions) => { const {baseUrl = "https://ivs.idenfy.com", fetch: fetchFn = fetch, kybTokenAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (kybTokenAuth !== undefined) headers.set('authorization', `Bearer ${kybTokenAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/kyb/forms/${encodeURIComponent(String(args.companyId))}/beneficiaries/${encodeURIComponent(String(args.id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };