export type CreateApiRegisteredUrlForReceiptPaymentRequestedEventsArgs = {body: {service: string, event: 'receipt_payment.requested', event_time: number, transaction_id: string, timestamp: number, business_id: string, client_id?: string | undefined, data: {appointment_id: string, doctor_id: string, patient_id: string, net_amount: number, url: string}}}; export type CreateApiRegisteredUrlForReceiptPaymentRequestedEventsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Payment Link Requested * * POST /registered_url_for_receipt_payment_requested_events */ export const createApiRegisteredUrlForReceiptPaymentRequestedEvents = async (args: CreateApiRegisteredUrlForReceiptPaymentRequestedEventsArgs, options?: CreateApiRegisteredUrlForReceiptPaymentRequestedEventsOptions) => { 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_payment_requested_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 };