export type GetApiApiPayersTransferExtIdArgs = {transfer_ext_id: string}; export type GetApiApiPayersTransferExtIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get basic payer info * * GET /api/payers/{transfer_ext_id} */ export const getApiApiPayersTransferExtId = async (args: GetApiApiPayersTransferExtIdArgs, options: GetApiApiPayersTransferExtIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/payers/${encodeURIComponent(String(args.transfer_ext_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };