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.
Remember to Pass your Authorization Token for this request to go through, read about Authorization here.
BODY PAYLOAD
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"}
Below is an actual request made and it's response.
Book Trip Request
POSThttps://api.travu.africa/api/v1/book_trip
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.
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.