export type AddShareholderRequestV2 = {customer_id?: (unknown | null) | undefined, ownership_percentage: number}; export type CreateApiV2CustomersBusinessesBusinessIdShareholdersArgs = {business_id: unknown, body: AddShareholderRequestV2}; export type CreateApiV2CustomersBusinessesBusinessIdShareholdersOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add a shareholder to a business * * POST /v2/customers/businesses/{business_id}/shareholders */ export const createApiV2CustomersBusinessesBusinessIdShareholders = async (args: CreateApiV2CustomersBusinessesBusinessIdShareholdersArgs, options?: CreateApiV2CustomersBusinessesBusinessIdShareholdersOptions) => { const {baseUrl = "https://auth-sandbox.fuse.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v2/customers/businesses/${encodeURIComponent(String(args.business_id))}/shareholders${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 };