Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/FlasheyEstudi/Oasis-Liquido/llms.txt

Use this file to discover all available pages before exploring further.

The Delivery Orders API is the backbone of the Oasis Express dispatch system. Orders are created automatically when a sale is processed with is_delivery: true. Pharmacy managers and dispatchers can then list pending orders, assign an available driver, and track the delivery through its status lifecycle. Drivers update their GPS position with each status transition, enabling real-time tracking.

GET /api/v1/delivery-orders

Return a paginated list of delivery orders. Results are filtered by the caller’s role — drivers see only their own assigned orders, pharmacy managers see orders from their pharmacy, and admins see all.

Query parameters

status
string
Filter by delivery status. One of: pending, assigned, picked_up, in_transit, delivered, cancelled.
pharmacy_id
string
Filter by originating pharmacy UUID.
driver_id
string
Filter by assigned driver UUID.
date_from
string
ISO 8601 lower bound on order_date.
page
number
default:"1"
Page number.
limit
number
default:"20"
Results per page.

curl example

curl "http://localhost:8000/api/v1/delivery-orders?status=pending&pharmacy_id=pharm-uuid-001" \
  --header "Authorization: Bearer <access_token>"

POST /api/v1/delivery-orders/:id/assign

Assign a delivery driver to an order. The order must be in pending status. After assignment the status transitions to assigned.

Path parameters

id
string
required
UUID of the delivery order.

Request body

driver_id
string
required
UUID of the delivery driver to assign. The driver must have is_available: true.

curl example

curl --request POST http://localhost:8000/api/v1/delivery-orders/order-uuid-001/assign \
  --header "Authorization: Bearer <access_token>" \
  --header "Content-Type: application/json" \
  --data '{"driver_id": "driver-uuid-001"}'

PATCH /api/v1/delivery-orders/:id/status

Update the status of a delivery order. Drivers call this endpoint as they move through the delivery workflow. GPS coordinates are used to update the driver’s recorded position.

Path parameters

id
string
required
UUID of the delivery order.

Request body

status
string
required
New delivery status. One of: pending, assigned, picked_up, in_transit, delivered, cancelled.
current_lat
number
Driver’s current latitude. Recommended when updating to picked_up, in_transit, or delivered.
current_lng
number
Driver’s current longitude. Recommended when updating to picked_up, in_transit, or delivered.

curl example

curl --request PATCH http://localhost:8000/api/v1/delivery-orders/order-uuid-001/status \
  --header "Authorization: Bearer <access_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "status": "in_transit",
    "current_lat": 19.4300,
    "current_lng": -99.1400
  }'

Delivery status lifecycle

StatusDescription
pendingOrder created, awaiting driver assignment
assignedA driver has been assigned
picked_upDriver has collected the order from the pharmacy
in_transitOrder is on the way to the delivery address
deliveredOrder successfully delivered to the patient
cancelledOrder was cancelled before delivery

DeliveryOrder key response fields

id
string
required
UUID of the delivery order.
pharmacy_id
string
required
UUID of the originating pharmacy.
patient_id
string
UUID of the receiving patient.
delivery_driver_id
string
UUID of the assigned delivery driver. Null until assigned.
status
string
required
Current delivery status.
pickup_address
string
Street address of the pharmacy (pickup point).
delivery_address
string
required
Street address of the delivery destination.
order_date
string
required
ISO 8601 timestamp when the order was created.
delivered_at
string
ISO 8601 timestamp when the order was delivered. Null until status is delivered.

Build docs developers (and LLMs) love