跳到主要内容

API Reference

This document provides the API reference for iHospita HMS services.


Base URL

Production: https://api.ihospita.com
Staging: https://api-staging.ihospita.com
Development: http://localhost:8000

Authentication

All API requests require a valid JWT token in the Authorization header:

Authorization: Bearer <token>

Response Format

Success Response

{
"success": true,
"data": { ... },
"meta": {
"page": 1,
"limit": 20,
"total": 100
}
}

Error Response

{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Human readable message",
"details": { ... }
}
}

HMS Service Endpoints

Patients

MethodEndpointDescription
GET/api/hms/patientsList patients
POST/api/hms/patientsCreate patient
GET/api/hms/patients/:idGet patient
PUT/api/hms/patients/:idUpdate patient
DELETE/api/hms/patients/:idDelete patient

Employees

MethodEndpointDescription
GET/api/hms/employeesList employees
POST/api/hms/employeesCreate employee
GET/api/hms/employees/:idGet employee
PUT/api/hms/employees/:idUpdate employee

CRM Service Endpoints

Families

MethodEndpointDescription
GET/api/crm/familiesList families
POST/api/crm/familiesCreate family
GET/api/crm/families/:idGet family
POST/api/crm/families/:id/membersAdd member

VIP

MethodEndpointDescription
GET/api/crm/vip/tiersList VIP tiers
GET/api/crm/vip/families/:idGet family VIP status

Payment Service Endpoints

Invoices

MethodEndpointDescription
GET/api/payment/invoicesList invoices
POST/api/payment/invoicesCreate invoice
GET/api/payment/invoices/:idGet invoice
POST/api/payment/invoices/:id/payProcess payment

Payments

MethodEndpointDescription
GET/api/payment/paymentsList payments
GET/api/payment/payments/:idGet payment

Queue Service Endpoints

Appointments

MethodEndpointDescription
GET/api/queue/appointmentsList appointments
POST/api/queue/appointmentsCreate appointment
PUT/api/queue/appointments/:idUpdate appointment
DELETE/api/queue/appointments/:idCancel appointment

Queue

MethodEndpointDescription
GET/api/queue/entriesList queue entries
POST/api/queue/entriesAdd to queue
PUT/api/queue/entries/:id/callCall patient
PUT/api/queue/entries/:id/completeComplete

Report Service Endpoints

MethodEndpointDescription
GET/api/report/financial/dailyDaily revenue report
GET/api/report/financial/monthlyMonthly summary
GET/api/report/clinical/visitsVisit statistics
GET/api/report/operational/queueQueue analytics

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
429Rate Limited
500Internal Error