export type GetApiProviderReceiptsReceiptIdArgs = {receipt_id: string}; export type GetApiProviderReceiptsReceiptIdOptions = {baseUrl?: string | undefined, ProviderKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve one receipt owned by the authenticated provider * * GET /provider/receipts/{receipt_id} */ export const getApiProviderReceiptsReceiptId = async (args: GetApiProviderReceiptsReceiptIdArgs, options?: GetApiProviderReceiptsReceiptIdOptions) => { const {baseUrl = "https://nothumansearch.ai/api/v1", fetch: fetchFn = fetch, ProviderKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ProviderKey !== undefined) headers.set("X-NHS-Provider-Key", ProviderKey) const url = `${baseUrl.replace(/\/+$/, '')}/provider/receipts/${encodeURIComponent(String(args.receipt_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 };