Get Bus Trips
This API Endpoint makes a POST request to the Travu API service in other to get a response of AVAILABLE BUS TRIPS from all our aggregated Bus operators based on the requested DEPARTURE STATE, DESTINATION STATE and DATE.
ENDPOINT URL
REQUEST TYPE: POST
LIVE URL: https://api.travu.africa/api/v1/check_trip
TEST URL: https://api.travu.africa/test/api/v1/check_trip
Remember to Pass your Authorization Token for this request to go through, read about Authorization here.
BODY PAYLOAD
The Body Payload format is as below;
{
"departure_state": "Supported string e.g ABIA",
"destination_state": "Supported string e.g LAGOS",
"trip_date": "date(YYYY-MM-DD)e.g 2021-07-04",
"sort": "(Optional) if you need to uniform response based on departure date, use 'date'"
}Our Supported States Strings (UPPERCASE SENSITIVE) to be used for both departure_state and destination_state are;
ABIA, ADAMAWA, AKWA IBOM, ANAMBRA, BAUCHI, BAYELSA, BENUE, BORNO, CROSS RIVER, DELTA, EBONYI, EDO, EKITI, ENUGU, GOMBE, IMO, JIGAWA, KADUNA, KANO, KATSINA, KEBBI, KOGI, KWARA, LAGOS, NASARAWA, NIGER, OGUN, ONDO, OSUN, OYO, PLATEAU, RIVERS, SOKOTO, TARABA, YOBE, ZAMFARA, FCT (ABUJA), LOME, COTONOU, ACCRA.
Check Trip Request
POST https://api.travu.africa/api/v1/check_trip
This API Endpoint makes a POST request to the MytripAPI service in other to get a response of AVAILABLE BUS TRIPS from all our aggregated Bus operators based on the requested DEPARTURE STATE, DESTINATION STATE and DATE.
Request Body
departure_state*
LAGOS
Departure State
destination_state*
IMO
Destination state
trip_date*
2023-04-01
Intending date of travel
sort
String
Sorting result by an order
RESPONSE
The Response for this request should bring the TRIP DETAILS in the below format if the sort parameter is sent as empty or not included in the payload entirely.;
ALSO: The Response for this request should bring the TRIP DETAILS in the below format if the sort parameter is sent as "date", this combines all results based on the departure time.
Always convert these response values (Strings and Integers) into Strings so as to always correspond as our responds might return those values in either form.
The above responses are an example of a situation where One operator has available trip (GUO in this case) and the other does not operate around that route.
Reference to Authentication for possible authentication errors that might occur during this request.
Seat Layout
The next thing you want to do is present the seat layouts to your users in our supported formats, this enables your users pick specific seats and positions from a bus.
Last updated
Was this helpful?