export type DeleteApiV1ReceiptsIdArgs = {id: number}; export type DeleteApiV1ReceiptsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a receipt * * DELETE /v1/receipts/{id} */ export const deleteApiV1ReceiptsId = async (args: DeleteApiV1ReceiptsIdArgs, options?: DeleteApiV1ReceiptsIdOptions) => { const {baseUrl = "https://api.altoviz.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/receipts/${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 };