Delivery
The Delivery API manages medication delivery, specimen collection, and medical equipment delivery services. Track deliveries in real-time and receive status updates.
Endpoints
POST
/api/v1/deliveries/Create a delivery orderGET
/api/v1/deliveries/List deliveriesGET
/api/v1/deliveries/{id}/Get delivery detailsGET
/api/v1/deliveries/{id}/track/Track deliveryPOST
/api/v1/deliveries/{id}/cancel/Cancel deliveryCreate a Delivery Order
Create a new delivery order for medication, specimen collection, or equipment.
POST
/api/v1/deliveries/Request Body
patient_uhidstringrequiredPatient UHID
delivery_typestringrequiredType: medication, specimen, equipment
pickup_addressstringrequiredPickup location
delivery_addressstringrequiredDelivery location
pickup_facility_iduuidoptionalPickup facility ID
itemsarrayrequiredItems to deliver
prioritystringoptionalPriority: standard, express, urgent
special_instructionsstringoptionalSpecial handling instructions
scheduled_pickupdatetimeoptionalScheduled pickup time
Request
bash
curl -X POST https://api.mediloop.co/api/v1/deliveries/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"delivery_type": "medication",
"pickup_address": "City Pharmacy, Kampala Road",
"delivery_address": "Plot 45, Ntinda, Kampala",
"items": [
{"name": "Amoxicillin 500mg", "quantity": 21},
{"name": "Paracetamol 500mg", "quantity": 10}
],
"priority": "standard"
}'RESPONSE201
{
"id": "del-123-456-789",
"order_number": "DEL-2024-001234",
"patient_uhid": "UG123456789A",
"delivery_type": "medication",
"status": "pending",
"estimated_delivery": "2024-01-15T16:00:00Z",
"created_at": "2024-01-15T10:00:00Z"
}Track Delivery
Get real-time tracking information for a delivery.
GET
/api/v1/deliveries/{id}/track/Request
bash
curl https://api.mediloop.co/api/v1/deliveries/del-123-456/track/ \
-H "Authorization: Bearer sk_test_..."RESPONSE200
{
"id": "del-123-456",
"order_number": "DEL-2024-001234",
"status": "in_transit",
"courier": {
"name": "James Okello",
"phone": "+256700555666",
"vehicle": "Motorcycle"
},
"current_location": {
"latitude": 0.3234,
"longitude": 32.5678,
"updated_at": "2024-01-15T14:30:00Z"
},
"estimated_arrival": "2024-01-15T15:00:00Z",
"timeline": [
{
"status": "pending",
"timestamp": "2024-01-15T10:00:00Z"
},
{
"status": "assigned",
"timestamp": "2024-01-15T10:15:00Z"
},
{
"status": "picked_up",
"timestamp": "2024-01-15T14:00:00Z"
},
{
"status": "in_transit",
"timestamp": "2024-01-15T14:05:00Z"
}
]
}Delivery Status
| Status | Description |
|---|---|
pending | Order created, awaiting assignment |
assigned | Courier assigned to order |
picked_up | Items picked up from origin |
in_transit | En route to destination |
delivered | Successfully delivered |
failed | Delivery attempt failed |
cancelled | Order cancelled |
Delivery Types
| Type | Description |
|---|---|
medication | Prescription medication delivery |
specimen | Lab specimen collection from patient |
equipment | Medical equipment delivery |
documents | Medical documents/records |