Request Bus Booking
This API Endpoint makes a POST request to the Travu API service in other to make a BOOKING request to to the associated Bus operator based on the selected TRIP from the customer. This makes an actual ticket reservation for your customer, obviously after you must have collected payment.
REQUEST TYPE: POST
Remember to Pass your Authorization Token for this request to go through, read about Authorization here.
The Body Payload is as below (in a case where two bus seats are selected);
{
"seat_numbers": "1,2",
"amount_per_seat": "Original Amount per seat of that bus trip as returned in the TRIP DETAILS",
"agent_email": "email of your mytripapi account",
"passengers": [
{
"title": "Traveler's title eg. Mr",
"name": "Traveler's fullname eg. Abiah Johnie",
"age": "Traveler's age eg. 32",
"sex": "Traveler's gender eg. Male",
"phone": "Traveler's phone number eg. 09100000000",
"email": "Traveler's email address eg. [email protected]",
"blood": "Traveler's blood group",
"next_of_kin": "Traveler's Next of Kin fullname eg. Benjamin Johnie",
"next_of_kin_phone": "Traveler's Next of Kin phone number eg.09000000000",
"is_primary": true (first passenger should be the primary traveler)
},
{
"title": "Mr",
"name": "Barnabas Johnnie",
"age": "32",
"sex": "Male",
"phone": "09057568594",
"email": "[email protected]",
"blood": "Traveler's blood group",
"next_of_kin": "Miracle Johnnie",
"next_of_kin_phone": "08000000000",
"is_primary": false (other travelers are not primary traveler)
}
],
"origin_id": "Get from the TRIP DETAILS if available eg. 1",
"destination_id": "Get from the TRIP DETAILS if available eg. 63",
"boarding_at": "Get from the TRIP DETAILS if available eg. 96855",
"trip_id": "Get from the TRIP DETAILS if available eg. 96855",
"trip_date": "Get from the TRIP DETAILS eg. 2021-07-04",
"order_id": "Get from the TRIP DETAILS if available eg. 03410a4b",
"provider": "This is the Bus Provider's short_name eg. GUO as available on the TRIP DETAILS"
}
post
https://api.travu.africa/
api/v1/book_trip
Book Trip Request
The Response for the above request should bring the BOOKED DETAILS/RECEIPT in the below format if successful;
{
"order_status": "confirmed",
"order_id": "49008",
"order_name": "Abiah Johnie",
"order_email": "[email protected]",
"phone_number": "09100000000",
"order_amount": 13000,
"trip_id": "96855",
"origin_id": "45",
"destination_id": "63",
"order_ticket_date": "2021-07-03",
"order_total_seat": 2,
"order_seats": "1,2",
"amount_per_seat": "6500.00",
"order_number": "03410a4b",
"vehicle_no": "1st Bus (15)",
"narration": "UMUAHIA TO LAGOS - AJAH",
"departure_terminal": "UMUAHIA",
"destination_terminal": "LAGOS - AJAH",
"seat_details": [
{
"fare": "6500.00",
"title": "Mr",
"age": "32",
"sex": "M",
"name": "Abiah Johnie",
"email": "[email protected]",
"phone": "09100000000",
"blood": "A+",
"next_of_kin": "Benjamin Johnnie",
"next_of_kin_phone": "09000000000",
"seat_number": "1"
},
{
"fare": "6500.00",
"title": "Mr",
"age": "32",
"sex": "M",
"name": "Barnabas Johnie",
"email": "[email protected]",
"phone": "09057568594",
"blood": "A+",
"next_of_kin": "Miracle Johnnie",
"next_of_kin_phone": "03000000000",
"seat_number": "2"
}
],
"provider": "GUO"
}
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.
From this response, you'll notice that the first Traveler automatically gets the first seat, while the second passenger gets the second seat, it goes on in that order if more seats are selected.
The "status" of a transaction/booking could be confirmed, failed or canceled.
Reference to Authentication for possible authentication errors that might occur during this request.
Last modified 5mo ago