Drivers are the supply side of TrustRide. They register vehicles, publish intercity trips, verify payments from riders via receipt chat, and manage the full booking lifecycle including refunds and ambassador approvals. All driver-facing endpoints requireDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/trustride/llms.txt
Use this file to discover all available pages before exploring further.
role=driver and, for trip publication, is_driver_verified=True.
Driver Registration and Verification
Drivers register atPOST /users/register/ with role=driver. The registration process is identical to rider registration — the same fields (email, phone, first_name, last_name, gender, password) are required.
After registration the driver account is inactive for trip publication until an admin sets is_driver_verified=True.
The UserManager provides a verified_drivers() queryset shortcut:
is_driver_verified from being set on a non-driver account:
Driver Dashboard
GET /driver/dashboard/ — requires login and role=driver.
The driver dashboard aggregates everything a driver needs to manage their business:
- Active trips — upcoming published trips with departure date ≥ today.
- Pending bookings — count of bookings awaiting payment approval (
reservedorpending_verification). - Earnings summary — total earnings from confirmed bookings (
SUM(price)wherestatus=confirmed). - Vehicle count — number of vehicles in the driver’s fleet.
- Pending refunds — count of open refund requests on the driver’s trips.
- Pending driver reports — count of unreviewed
DriverReportrecords. - Ambassador requests — count of pending ambassador approval requests.
- Average rating — computed from all
Ratingrecords wherereviewee=driver.
Vehicle Management
A driver must add at least one vehicle before creating a trip. Vehicles are linked to trips and determine seat capacity.Add a Vehicle
GET/POST /driver/vehicles/add/ — renders a vehicle form alongside an image formset (1–10 images, minimum 1 required).Edit a Vehicle
GET/POST /driver/vehicles/<uuid>/edit/ — pre-fills the form with the existing vehicle’s data.Vehicle Model Fields
ABC-123DE or ABCD-123DE) by validate_plate_number in apps/core/validators.py.
Seat Layout JSON Format
Theseat_layout field is a JSON object that describes how seats are arranged in the vehicle. The total_seats property iterates over the layout to compute total capacity:
A1, A2, B1, …) based on seating_capacity.
Creating Trips
POST /create/ — drivers fill in the trip form. Required fields:
| Field | Description |
|---|---|
vehicle | UUID of one of the driver’s active vehicles |
origin | Departure city (free text, validated from Nigerian states list) |
destination | Arrival city |
departure_date | Must be today or a future date for publishing |
departure_time | 24-hour time |
price_per_seat | Price in NGN (must be ≥ 0) |
gender_restriction | anyone, ladies_only, or gentlemen_only |
driver_note | Optional note shown to riders (e.g., “Arrive 10 minutes early”) |
stop_count | Number of intermediate stops |
stop_<n>_city, stop_<n>_arrival, stop_<n>_departure, stop_<n>_price | Per-stop data |
Trips created via the form are published directly (
status='published'). To create a trip in draft and publish later, use the duplicate-and-edit workflow. A trip in draft status is invisible to riders until POST /trip/<uuid>/publish/ is called.Trip Status Lifecycle
| Status | Description |
|---|---|
draft | Newly duplicated trips or trips awaiting edits. Not visible to riders. |
published | Live and bookable. Shown in search results. |
in_progress | Trip has started (driver called /start-trip/<uuid>/). No new bookings allowed. |
completed | Trip finished (driver called /complete-trip/<uuid>/). Riders can now rate. |
cancelled | Cancelled by driver. Pending bookings are automatically cancelled. |
expired | Set by admin or a background task for stale trips. |
Trip Management
All trip management actions are accessible from the trip manage page atGET /trip/<uuid>/manage/.
| Action | Endpoint | Notes |
|---|---|---|
| Edit trip | POST /trip/<uuid>/edit/ | Blocked if status is completed or cancelled. |
| Pause / resume | POST /trip/<uuid>/pause/ | Toggles is_active. Hides trip from search without cancelling bookings. |
| Publish | POST /trip/<uuid>/publish/ | Moves draft → published. Departure date must not be in the past. |
| Cancel | POST /trip/<uuid>/cancel/ | Sets status=cancelled and cancels all pending bookings. Notifies riders via chat. |
| Start | POST /start-trip/<uuid>/ | Moves published → in_progress. |
| Complete | POST /complete-trip/<uuid>/ | Moves in_progress → completed. Increments total_rides for driver and all confirmed riders. Purges waitlist and chat messages. |
| Duplicate | POST /trip/<uuid>/duplicate/ | Creates a new draft trip with the same settings. Departure date defaults to today; driver must update and publish. |
Payment Verification
When a rider books a seat, an automated chat message is sent to the booking conversation with the driver’s bank account details and payment instructions. The rider transfers funds and uploads a receipt screenshot in the chat. The driver reviews the receipt and approves:POST /booking/<uuid>/approve/ — driver only. Transitions booking to confirmed, sets confirmed_at, sends the rider a QR-code confirmation email, and creates an in-app notification.
Refund Management
Riders request refunds from their booking detail page. Drivers see all refund requests for their trips atGET /driver/refunds/, which shows counts for requested, approved, and rejected statuses.
| Action | Endpoint | Outcome |
|---|---|---|
| Approve refund | POST /refund/<uuid>/approve/ | Sends approval email to rider, releases the seat, deletes the booking. |
| Reject refund | POST /refund/<uuid>/reject/ | Sends rejection email with reason. Booking remains confirmed. |
Ambassador Requests
Drivers control which approved ambassadors can sell seats on their specific trips. The workflow has two views:GET/POST /driver/ambassador-requests/— shows pendingAmbassadorTripApprovalrecords (is_approved=False) and allows the driver to approve or reject each one.GET/POST /driver/manage-ambassadors/— shows all approved and paused ambassadors grouped by trip. Drivers can pause, resume, or permanently remove an ambassador from a trip.
Driver Reports
Riders can submit aDriverReport against any trip the driver runs. Drivers view their reports at GET /driver/reports/.
driver/reports/ page shows pending_count and resolved_count alongside admin contact details so drivers can follow up.
Commission Rate and Payouts
Thecommission_rate field on User represents the platform’s percentage cut from a driver’s earnings. It is set per driver by admin and must be between 0 and 100.
Drivers do not initiate withdrawals themselves. Payouts are processed manually by the TrustRide admin team based on confirmed booking totals. Drivers can see their
total_earnings figure on the dashboard, but the payout transfer is handled off-platform by admin.