export type CreateApiRegisteredUrlForReceiptEventsArgs = {body: {event: 'receipt.created' | 'receipt.updated' | 'receipt.deleted', event_time: number, timestamp: number, client_id: string, business_id: string, data: {receipt_id: number, aid: string, doctor_oid: string, clinic_id: string, patient_oid: string, created_at: number, updated_at: number, receipt_number: string, receipt_url: string, receipt_status: string, receipt_amount: number, additional_discount_value: number, additional_discount_type: string, additional_discount_amount: number, net_amount: number, name: string, mobile: string, flavour: string, sku_discount_amount: number, amount_due: number, archive: number, remarks: string, ref_trx_id: string, payment_id: string, payment_link: string, amount_paid: number, actor: string}}}; export type CreateApiRegisteredUrlForReceiptEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Receipt Events * * POST /registered_url_for_receipt_events */ export const createApiRegisteredUrlForReceiptEvents = async (args: CreateApiRegisteredUrlForReceiptEventsArgs, options?: CreateApiRegisteredUrlForReceiptEventsOptions) => { const {baseUrl = "https://api.eka.care", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/registered_url_for_receipt_events${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 };