Get Schedules Endpoint With Extra Information (V2)

✅ CURRENT VERSION - This endpoint supports both Timed Schedules and Random Schedules.

Please, bear in mind that this endpoint is for businesses/merchants that don't want to go through a process flow like: (Fetch routes -> Choose bus -> Select Date -> Select schedule -> Select bus seats, etc) before you user can make purchase.

So, what this endpoint does is that if you don't want to allow users to go through the process of choosing bus, selecting date, selecting schedule, etc, it provides you with a list of default routes/schedules so that you show to your customer so that when they click it, you can go ahead to call the buy ticket endpoint and reduce the entire process flow.

Understanding Schedule Types

This endpoint returns schedules for both types of transport operations:

Timed Schedules

Fixed departure times that work perfectly for formal transport companies operating long-distance routes. For example:

  • GUO Transport (Lagos to Abuja): 8-hour journey with strict 6 AM departure

  • Passengers must arrive on time or miss the bus

  • Creates predictability for business travelers and long-distance journeys

  • Response includes a single bus object and fixed time with departure and arrival

Random Schedules

Flexible timing for informal transport businesses operating shorter routes. For example:

  • Star Sunny Motors (Awka to Nnewi): 1-hour journey with flexible timing

  • Passengers can arrive throughout the day and find buses leaving soon

  • Operates with time windows rather than fixed departure times

  • Response includes multiple buses array and operating_hours instead of fixed times

Example of Random Schedule structure:

  • Morning Operations (5 AM - 12 PM): Shuttle buses (7 passengers) at ₦1,500 per person

  • Evening Operations (12 PM - 10 PM): Hiace buses (14 passengers) at ₦1,200 per person

Endpoint Overview

This V2 endpoint retrieves comprehensive schedule information for any route, supporting both Timed and Random schedules. It provides all the information needed to proceed directly to ticket purchase, including schedule IDs, bus details, available seats, route information, terminal details, and business information.

Key Features

  • Supports both Timed and Random schedules - unified endpoint for all schedule types

  • Customizable query parameters to get exactly the information needed

  • Returns schedule_id and bus information for immediate ticket purchase

  • schedule_type field indicates whether each schedule is "timed" or "random"

  • Different response structure based on schedule type (see Response section)

  • Special note: Always pass the departure date to avoid requiring customers to change dates after purchase via email request

API Reference

Endpoint

Query Parameters

Parameter
Type
Required
Description
Example

route_id

Integer

No

ID of the route to fetch schedules for

11

departure_date

String

Recommended

Departure date (format: YYYY-MM-DD). Highly recommended to avoid post-purchase date changes

2024-12-25

from_city_id

Integer

No

ID of the city where the trip originates

12

to_city_id

Integer

No

ID of the destination city

3

business_id

String (UUID)

No

ID of the business offering the schedule

6e9d9432-2a1d-4a8a-a5e4-3ddfaf832523

terminal_id

Integer

No

ID of the terminal associated with the departure

7

Request & Response Example

Get bus schedules by route, departure and arrival city, terminal ID, business ID and departure date (V2 - Supports both Timed and Random schedules)

get

This endpoint retrieves available bus schedules based on the provided route ID, departure and arrival city ID, terminal ID, business ID and departure date. This V2 endpoint supports both Timed Schedules (fixed departure times) and Random Schedules (flexible timing with operating windows). The response structure varies based on the schedule_type field.

Seat Availability Note: For timed schedules, the available_seats array in the bus object is only included when the departure_date parameter is provided. This array shows the real-time seat layout and availability for the specified date, allowing users to see which seats are already booked and select from available seats. Without the departure_date parameter, seat availability information is not included.

Query parameters
route_idintegerOptional

ID of the route to fetch schedules for.

departure_datestring · dateOptional

Departure date for which to retrieve schedules (format: YYYY-MM-DD). Important: When this parameter is provided for timed schedules, the response includes the available_seats array in the bus object, showing the seat layout with real-time availability for that specific date. This allows users to see which seats are already booked and select from available seats.

from_city_idintegerOptional

ID of the city where the trip originates.

Example: 6
to_city_idintegerOptional

ID of the destination city.

Example: 8
business_idstringOptional

ID of the business offering the schedule (UUID format).

Example: 61e634bc-028c-4e33-a83f-7f77d5befc70
terminal_idintegerOptional

ID of the terminal associated with the departure.

Example: 3
Responses
chevron-right
200

List of bus schedules (both Timed and Random).

application/json
successbooleanOptionalExample: true
statusintegerOptionalExample: 200
messagestringOptionalExample: List of bus schedules
get
/api/v2/merpi/transport/schedules/packages

Response Fields

Common Fields (Both Schedule Types)

Field
Type
Description

schedules

Array

List of available bus schedules (both Timed and Random)

id

Integer

Schedule ID (use for buy ticket endpoint)

name

String

Schedule name

slug

String

Unique schedule identifier

schedule_type

String

"timed" or "random" - indicates the schedule type

from / to

String

Departure and arrival cities

days

Object

Operating days (1 = active, 0 = inactive)

route

Object

Complete route details including addresses and city information

route.price

Number

Base route price

terminal

Object

Departure terminal information

business

Object

Transport company details

next_page

String/Null

Pagination cursor for next page

count

Integer

Total number of schedules

per_page

Integer

Results per page (default: 20)

Timed Schedule Specific Fields

Field
Type
Description

time

Object

Fixed departure and arrival times

time.departure

String

Fixed departure time (e.g., "07:00 AM")

time.arrival

String

Expected arrival time (e.g., "03:00 PM")

bus

Object

Single bus information for this timed schedule

bus.id

Integer

Bus ID

bus.name

String

Bus name/type

bus.image

String

Bus image URL

bus.seats

Integer

Total number of seats

bus.price

Number

Additional bus-specific pricing (if any)

amount

Integer

Total ticket amount for this schedule

Random Schedule Specific Fields

Field
Type
Description

buses

Array

List of buses operating during different time windows

buses[].bus_id

Integer

Bus ID for this time window

buses[].start_time

String

Start of operating window for this bus(24-hour format: "06:00:00")

buses[].end_time

String

End of operating window for this bus(24-hour format: "23:36:00")

buses[].bus_type

String

Type/name of the bus

buses[].price

String

This is the price of this bus - and the price you must use for the route for random schedules.

buses[].image

String

Bus image URL

operating_hours

Object

Overall operating hours for the schedule

operating_hours.start

String

Earliest departure time (24-hour format)

operating_hours.end

String

Latest departure time (24-hour format)

Understanding the Response Structure

How to Identify Schedule Type

Check the schedule_type field in each schedule object:

For Timed Schedules:

  • Present the fixed departure time from time.departure

  • Show the single bus option from bus

  • Emphasize that customers must arrive on time

For Random Schedules:

  • Present the operating hours from operating_hours

  • Show multiple bus options from buses array with their time windows

  • Emphasize flexible departure within the operating window

Important Notes

  1. Departure Date: Always include the departure_date parameter to ensure customers don't need to change dates after purchase

  2. Schedule Type Detection: Always check the schedule_type field to determine how to parse the response

  3. Timed vs Random: Timed schedules have a bus object and time field; Random schedules have buses array and operating_hours

  4. Schedule ID: The id field from the response is required for the buy ticket endpoint

  5. Operating Days: Use the days object to show customers which days the schedule operates

Integration Examples

Handling Mixed Results

Migration from V1

If you're migrating from the V1 endpoint:

  1. Update Endpoint URL: Change /api/v1/... to /api/v2/...

  2. Add Schedule Type Check: Implement logic to handle both schedule_type values

  3. Handle Different Response Structures:

    • Check for bus vs buses

    • Check for time vs operating_hours

  4. Update UI: Show appropriate information based on schedule type

  5. Test Both Types: Ensure your integration works with both Timed and Random schedules

Last updated