Skip to content

Clinic Booking

Build a medical clinic booking system with doctor assignment, room management, and patient intake.

Domain Mapping

Clinic ConceptAvailEngine ConceptHow to Set Up
ClinicBusinessCreate one business per clinic
DoctorResourceresource_type: "staff", capacity_min: 1, capacity_max: 1
Exam RoomResourceresource_type: "room", capacity_min: 1, capacity_max: 1
Appointment TypeServiceDuration per appointment type (checkup=15min, procedure=45min)
AppointmentBookingservice_id → auto-sets duration, customer = patient
Walk-in listWaitlistPatients waiting for a same-day slot

Step-by-Step Setup

1. Create the Business

bash
curl -X POST https://api.availengine.com/v1/developer/businesses \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MedCare Clinic",
    "business_type": "clinic"
  }'

2. Add Doctors and Rooms

bash
# Doctors
curl -X POST https://api.availengine.com/v1/manage/resources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Dr. Papadopoulos", "resource_type": "staff", "capacity_min": 1, "capacity_max": 1, "section": "General Medicine", "display_order": 1}'

curl -X POST https://api.availengine.com/v1/manage/resources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Dr. Georgiou", "resource_type": "staff", "capacity_min": 1, "capacity_max": 1, "section": "Cardiology", "display_order": 2}'

# Exam Rooms
curl -X POST https://api.availengine.com/v1/manage/resources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Room 101", "resource_type": "room", "capacity_min": 1, "capacity_max": 1, "section": "Ground Floor", "display_order": 3}'

curl -X POST https://api.availengine.com/v1/manage/resources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Room 102", "resource_type": "room", "capacity_min": 1, "capacity_max": 1, "section": "Ground Floor", "display_order": 4}'

curl -X POST https://api.availengine.com/v1/manage/resources \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "Procedure Room", "resource_type": "room", "capacity_min": 1, "capacity_max": 1, "section": "First Floor", "display_order": 5}'

3. Define Appointment Types

bash
# Service records define how long each appointment type takes:
# { "name": "General Checkup", "duration_minutes": 15, "price_cents": 0 }
# { "name": "Cardiology Consult", "duration_minutes": 30, "price_cents": 0 }
# { "name": "Minor Procedure", "duration_minutes": 45, "price_cents": 0 }
# { "name": "Full Physical", "duration_minutes": 60, "price_cents": 0 }

No-Show Protection

Medical clinics have high no-show rates. Enable deposits or require phone confirmation. Set min_notice_hours: 24 so patients must cancel at least 24 hours ahead.

4. Set Operating Hours

Clinics often have split shifts or different hours per doctor:

bash
curl -X PUT https://api.availengine.com/v1/manage/hours \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "hours": [
      {"day_of_week": 0, "is_open": false},
      {"day_of_week": 1, "is_open": true, "open_time": "08:00", "close_time": "17:00", "last_booking_time": "16:30"},
      {"day_of_week": 2, "is_open": true, "open_time": "08:00", "close_time": "17:00", "last_booking_time": "16:30"},
      {"day_of_week": 3, "is_open": true, "open_time": "08:00", "close_time": "17:00", "last_booking_time": "16:30"},
      {"day_of_week": 4, "is_open": true, "open_time": "08:00", "close_time": "17:00", "last_booking_time": "16:30"},
      {"day_of_week": 5, "is_open": true, "open_time": "08:00", "close_time": "14:00", "last_booking_time": "13:30"},
      {"day_of_week": 6, "is_open": false}
    ]
  }'

5. Configure Booking Settings

bash
curl -X PATCH https://api.availengine.com/v1/manage/settings \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "default_slot_interval_minutes": 15,
    "default_slot_duration_minutes": 30,
    "booking_window_days": 30,
    "min_notice_hours": 24,
    "max_capacity": 1,
    "auto_confirm_bookings": true
  }'

6. Book an Appointment

bash
curl -X POST https://api.availengine.com/v1/bookings/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_id": "YOUR_BUSINESS_ID",
    "resource_id": "DR_PAPADOPOULOS_ID",
    "service_id": "CHECKUP_SERVICE_ID",
    "customer": {
      "first_name": "Nikos",
      "last_name": "Antoniou",
      "phone": "+306981112233",
      "email": "nikos@example.com"
    },
    "booking_date": "2026-06-15",
    "start_time": "09:00",
    "capacity": 1
  }'

Clinic-Specific Patterns

Doctor + Room Assignment

Some procedures need both a doctor AND a specific room. AvailEngine books one resource per appointment — choose the primary resource (usually the doctor) and track room assignment separately:

Option A: Use staff_notes to record the room assignment:

bash
curl -X PATCH https://api.availengine.com/v1/manage/bookings/BOOKING_ID/notes \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"staff_notes": "Assigned: Room 101. Patient needs ECG."}'

Option B: Create combined resources ("Dr. Papa + Room 101") for common doctor-room pairs.

Appointment Status Flow

Map the booking lifecycle to clinical workflow:

Booking StatusClinical Meaning
confirmedAppointment scheduled
checked_inPatient arrived, in waiting room
completedConsultation done, patient discharged
cancelledPatient cancelled (within 24h notice)
no_showPatient didn't arrive
bash
# Patient arrives → check in
curl -X PATCH https://api.availengine.com/v1/manage/bookings/BOOKING_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "checked_in"}'

# Consultation done
curl -X PATCH https://api.availengine.com/v1/manage/bookings/BOOKING_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "completed"}'

Patient Intake Notes

Use customer_notes for symptoms and staff_notes for clinical notes:

bash
# Patient-facing notes (symptoms, reason for visit)
curl -X POST https://api.availengine.com/v1/bookings/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "business_id": "YOUR_BUSINESS_ID",
    "customer": {
      "first_name": "Eleni",
      "last_name": "Vasiliou",
      "phone": "+306987778899",
      "email": "eleni@example.com"
    },
    "booking_date": "2026-06-15",
    "start_time": "09:30",
    "capacity": 1,
    "customer_notes": "Persistent cough for 2 weeks, no fever"
  }'

Multi-Provider Clinics

For clinics with multiple specialties (GP, cardiologist, dermatologist):

  1. Create sections per specialty (section: "Cardiology")
  2. In your booking widget, let patients filter by section/specialty
  3. Each doctor is a resource with their own schedule
  4. The availability endpoint auto-filters by resource

Recurring Appointments

For patients who need regular checkups (weekly physio, monthly checkup):

  1. Patient books first appointment normally
  2. On booking.completed webhook, your system creates the next appointment
  3. Send reminder SMS 24h before each appointment via webhook integration

Emergency Walk-Ins

Use the staff booking endpoint to instantly confirm walk-ins:

bash
curl -X POST https://api.availengine.com/v1/manage/bookings/staff \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "2026-06-15",
    "time": "11:00",
    "capacity": 1,
    "first_name": "Georgios",
    "last_name": "Konstantinou",
    "phone": "+306945556677",
    "notes": "Walk-in — chest pain, urgent"
  }'

Widget Integration

js
const client = new AvailEngine('avail_live_YOUR_KEY');
// Clinic booking widget flow:
// 1. Patient selects specialty (→ filters doctors by section)
// 2. Patient selects appointment type (→ sets duration)
// 3. Patient picks doctor (or any available)
// 4. Show available slots for that doctor + duration
// 5. Collect patient info + reason for visit (customer_notes)

async function getDoctorSlots(businessId, doctorId, date, appointmentType) {
  return client.availability(businessId, {
    date,
    resourceId: doctorId,
    durationMinutes: appointmentType.durationMinutes,
    capacity: 1
  });
}

Dashboard Tips

  • Audit log: Every check-in, completion, and cancellation is logged — useful for compliance
  • Google Calendar: Doctors can connect their personal calendar to block out vacation/conference days
  • Waitlist: Patients waiting for a cancellation — contact them when a slot opens
  • Resources tab: Toggle doctors is_active: false when they're on leave — their slots disappear from availability

Next: Photographer guide → | Back to Salon →

Released under the MIT License.