Skip to main content

Bus Booking

Manage and retrieve ticket information.

Endpoints

Search Bus Offers

Search for available bus trips between two locations on a specific date.

Endpoint: GET /api/trip/search

Example Request:

GET /api/trip/search?from=LUSAKA:RGN:0&to=JOHANNESBURG:RGN:0&date=2025-12-31

Query Parameters

ParameterTypeRequiredDescription
fromstringYesOrigin stop ID in the format CITY:RGN:0 (e.g., LUSAKA:RGN:0)
tostringYesDestination stop ID in the format CITY:RGN:0 (e.g., JOHANNESBURG:RGN:0)
datestringYesTravel date in YYYY-MM-DD format (e.g., 2025-12-31)

Response Structure

The response contains two main objects:

FieldTypeDescription
exactRouteobjectDirect routes matching the origin and destination
alternativesobjectAlternative routes or connections (if no direct routes are found)

Exact Route Object

The exactRoute object is keyed by route name (e.g., "Lusaka - Johannesburg") and contains an array of available trips.

Trip/Offer Fields

FieldTypeDescription
idstringUnique trip/frequency identifier
companyIdstringBus company MongoDB ID
companyNamestringOfficial company name
companyTradingNamestringTrading name of the company
companyLogoarrayArray of logo objects with type, name (TICKET/DARK/LIGHT), base64, and url
tinNumberstringCompany tax identification number
frequencyIdstringUnique identifier for the trip frequency
tripsIdstringInternal trip identifier (format: ROUTE:DIRECTION)
routeIdstringRoute identifier
routeNamestringHuman-readable route name
routeShortNamestringAbbreviated route name (e.g., LSK - JHB)
routeColorstringHex color code for route display
routeTextColorstringHex color code for text on route color
originstringOrigin city name
destinationstringDestination city name
headsignstringFull route description with intermediate stops
pricenumberBase ticket price in local currency
priceCurrencystringCurrency code for prices (e.g., ZMW)
departureDatestringDeparture date in ISO 8601 format
departureTimestringDeparture time in HH:mm format
reportingTimestringRecommended arrival time at station (before departure)
travelTimestringFormatted travel duration
estimatedTravelobjectDetailed travel time with hours, minutes, formatted, and formattedLong
estimatedArrivalTimestringExpected arrival time at destination
estimatedArrivalDatestringExpected arrival date in ISO 8601 format
estimatedArrivalDaysnumberNumber of days after departure for arrival (0 = same day, 1 = next day, etc.)
timezonestringTimezone for departure (e.g., Africa/Lusaka)
directionstringTrip direction: OUTBOUND or INBOUND
hasLeftOriginbooleanWhether the bus has already departed
canceledbooleanWhether the trip is canceled
availableSeatsnumberNumber of seats still available
agentCommissionnumberCommission amount for booking agents

Important Information Array

FieldTypeDescription
custombooleanWhether this is a custom message
iconstringIcon identifier (e.g., passport)
iconTypestringIcon type classification
codestringInformation code (e.g., ID_REQUIRED)
valuesarrayAdditional values for dynamic messages

Stop Times Array

Each stop in the route is represented as:

FieldTypeDescription
stopIdstringUnique stop identifier
stopNamestringStop/city name
stopDescriptionstringFull address/description
stopSequencenumberOrder in the route (0 = first stop)
arrivalTimestringArrival time at this stop
departingTimestringDeparture time from this stop
latitudenumberStop GPS latitude
longitudenumberStop GPS longitude
estimatedArrivalDatestringExpected arrival date at this stop
estimatedDepartureDatestringExpected departure date from this stop
estimatedArrivalDaysnumberDays from trip start to arrival at this stop
estimatedDepartureDaysnumberDays from trip start to departure from stop
stop_timezonestringTimezone of the stop
city_geohashstringGeohash for location-based queries
popularitynumberStop popularity score

Vehicle Object

FieldTypeDescription
idstringVehicle MongoDB ID
plateNumberstringVehicle registration plate
typestringVehicle type (e.g., BUS)
vehicleClassstringClass: LUXURY, SEMI_LUXURY, or ORDINARY
seatsnumberTotal seat capacity
seatingColumnsnumberNumber of seat columns
numberOfDoorsnumberNumber of doors
steeringWheelPositionstringLEFT or RIGHT
amenitiesarrayAvailable amenities (e.g., ["AC", "TV"])
seatingGridobjectDetailed seat layout by section

Seating Grid

The seatingGrid contains sections keyed by unique identifiers. Each section includes:

FieldTypeDescription
sectionNamestringSection class (e.g., ORDINARY)
seatingRowsstringNumber of rows
seatingColumnsstringNumber of columns
seatsstringTotal seats in section
seatsReservednumberNumber of reserved seats
seatsAvailablenumberNumber of available seats
seatingGridarrayArray of seat objects

Each seat object in the grid:

FieldTypeDescription
idstringUnique seat identifier
labelstringSeat number label displayed to passengers
positionXnumberColumn position (0-indexed)
positionYnumberRow position (0-indexed)
keystringGrid key (usually same as id)
typestringSEAT, AISLE, DOOR, or DRIVER
classstringSeat class: LUXURY, SEMI_LUXURY, or ORDINARY
orientationstringSeat orientation (e.g., UP)
availablebooleanWhether the seat is available for booking

Fare Rules Array

Each fare rule defines pricing between specific stops:

FieldTypeDescription
idstringUnique fare rule identifier
originIdstringOrigin stop ID
destinationIdstringDestination stop ID
originCitystringOrigin city/region name
destinationCitystringDestination city/region name
baseCurrencystringBase currency code
pricesobjectPrices by class (LUXURY, SEMI_LUXURY, ORDINARY, agentCommission)
otherCurrenciesobjectConverted prices in multiple currencies

Route Stations Object

Organizes pickup and dropoff points by region:

{
"Lusaka (Lusaka Province)": {
"pickUpStations": ["LUSAKA:RGN:0"],
"dropOffStations": ["LUSAKA:RGN:0"]
},
"Gauteng": {
"pickUpStations": ["JOHANNESBURG:RGN:0", "MIDRAND:RGN:0", "PRETORIA:RGN:0"],
"dropOffStations": ["JOHANNESBURG:RGN:0", "MIDRAND:RGN:0", "PRETORIA:RGN:0"]
}
}

From/To Stop Objects

The fromStop, toStop, firstStop, and lastStop objects contain the same fields as items in the stopTimes array, providing quick access to key stops without iterating through the full route.

Settings Object

Route-specific configuration options:

FieldTypeDescription
seatReservationbooleanWhether seat selection is enabled
bulkTicketingbooleanWhether bulk ticket purchases are allowed
sendTextMessagebooleanWhether SMS confirmations are sent
flexibleTicketPricebooleanWhether dynamic pricing is enabled
flexibleOriginbooleanWhether passengers can board at any stop
flexibleDestinationbooleanWhether passengers can alight at any stop
allowOnlineSalesbooleanWhether online booking is permitted
enterCustomerNamebooleanWhether passenger name is required
enterCustomerPhoneNumberbooleanWhether phone number is required
enterCustomerEmailbooleanWhether email is required
enterCustomerNationalitybooleanWhether nationality is required
enterCustomerPassportNumberbooleanWhether passport/ID number is required
noBetweenBookingsbooleanWhether intermediate stop bookings are disabled

Get Tickets

Retrieve tickets with various filters.

Endpoint: GET /api/ticket

Query Parameters:

  • ticketId: Filter by ticket ID
  • bookingReference: Filter by booking reference
  • email: Filter by passenger email
  • phoneNumber: Filter by phone number