API Documentation | MediStack Developer Platform

MediStack REST API v2.0

API Documentation & Reference

Integrate EHR records, USSD menus, IoT hospital sensors, payment gateways, and medical logistics using our high-performance REST APIs.

GET
/api/patients
Patients
Auth Required
100 req/min
List & search patient records
Returns paginated patient records with optional filters by name, national ID, or ward.

Parameters

limit
query
(number)
Number of results (default: 50, max: 100)
search
query
(string)
Search query for patient name or national ID
wardId
query
(string)
Filter patients assigned to a specific ward
{
  "success": true,
  "patients": [
    {
      "id": "pat_98124",
      "name": "Ama Owusu",
      "age": 34,
      "gender": "female",
      "status": "Active",
      "bloodGroup": "O+"
    }
  ],
  "total": 1
}
POST
/api/patient-portal
Patients
Auth Required
30 req/min
Patient portal operations
Execute patient self-service actions such as linking health records, updating demographics, or messaging doctors.
{
  "success": true,
  "appointmentId": "apt_77812",
  "status": "scheduled"
}
GET
/api/appointments
Appointments
Auth Required
100 req/min
Query provider schedule & appointments
Fetch real-time consultation and clinical bookings for doctors, clinics, or facility wards.

Parameters

doctorId
query
(string)
Filter by physician ID
date
query
(string)
ISO date string (YYYY-MM-DD)
status
query
(string)
scheduled | in-progress | completed | cancelled
{
  "success": true,
  "appointments": [
    {
      "id": "apt_101",
      "patientId": "pat_98124",
      "doctorId": "doc_554",
      "time": "10:30 AM",
      "type": "In-Person"
    }
  ]
}
GET
/api/iot?action=get-iot-data
IoT & Devices
Auth Required
120 req/min
Fetch IoT fleet status & vital telemetry
Retrieves connected medical devices (ECG, Pulse Oximeters, Vital Monitors), active sensor streams, and battery health.
{
  "success": true,
  "results": {
    "stats": {
      "totalDevices": 14,
      "activeDevices": 12,
      "criticalAlerts": 0,
      "averageBatteryLevel": 88
    },
    "devices": [
      {
        "id": "dev_ecg_01",
        "name": "ICU Monitor Bed 1",
        "type": "vital-monitor",
        "status": "active"
      }
    ]
  }
}
POST
/api/iot
IoT & Devices
Auth Required
300 req/min
Record IoT telemetry or register hardware
Ingest real-time vital readings, acknowledge threshold alarms, or deploy firmware payloads.
{
  "success": true,
  "readingId": "rdg_9921",
  "timestamp": "2026-09-01T01:00:00.000Z"
}
POST
/api/ussd
USSD & Telco
500 req/min
Universal Telco USSD gateway handler
Receives and routes USSD session menus for Twilio, Africa's Talking, MTN, Airtel, and Vodafone networks.
{
  "response": "CON Select Appointment Date:\n1. Tomorrow 9:00 AM\n2. Tomorrow 2:00 PM\n0. Back",
  "action": "continue",
  "sessionId": "ussd_ses_99182"
}
GET
/api/subscription?action=get-subscriptions
Billing & Subscription
Auth Required
60 req/min
Retrieve active SaaS subscriptions
Get organization subscription status, monthly premium, seat quotas, and renewal dates.

Parameters

organizationId
query
(string)
required
Organization unique identifier
{
  "success": true,
  "results": [
    {
      "id": "sub_enterprise_01",
      "planName": "Enterprise Hospital Tier",
      "monthlyPremium": 850,
      "status": "active"
    }
  ]
}
POST
/api/billing
Billing & Subscription
Auth Required
60 req/min
Generate invoice or record transaction
Issue clinical billings, insurance co-pays, or patient receipts with automated tax and currency conversions.
{
  "id": "inv_88231",
  "totalAmount": 150,
  "status": "pending",
  "invoiceNumber": "INV-2026-0045"
}
GET
/api/duck-credit-loans
Duck+ Finance
Auth Required
50 req/min
Query Duck+ credit facility and loans
Access revolving inventory credit lines, vendor financing terms, and repayment schedules.
{
  "success": true,
  "availableCredit": 50000,
  "activeLoans": [
    {
      "id": "loan_441",
      "amount": 12000,
      "purpose": "Pharmacy Stock Refill",
      "status": "approved",
      "rate": "1.5%"
    }
  ]
}
POST
/api/webhooks/stripe
Webhooks
Unlimited
Stripe webhook receiver
Processes Stripe payment_intent.succeeded, invoice.payment_succeeded, and refund events.
{
  "success": true,
  "processed": true,
  "eventType": "payment_intent.succeeded"
}
POST
/api/webhooks/paystack
Webhooks
Unlimited
Paystack & Mobile Money webhook receiver
Processes Mobile Money (MTN MoMo, Telecel Cash) and debit card settlement webhooks.
{
  "success": true,
  "processed": true,
  "eventType": "charge.success"
}
POST
/api/developer
Developer
Auth Required
30 req/min
Manage API keys and developer webhooks
Provision live/sandbox keys, set permission scopes, or register webhook event endpoints.
{
  "success": true,
  "keyId": "key_88912",
  "apiKey": {
    "prefix": "sk_live_9f81",
    "status": "active"
  }
}