Create a new trip instance with a POST request:
POST /trip-instances
{
"coach_id": 2,
"bus_id": 1,
"schedule_id": 1,
"seat_plan_id": 1,
"route_id": 1,
"coach_type": 1,
"trip_date": "2025-09-18",
"boarding_dropping_points": [
{
"counter_id": 1,
"type": 1,
"time": "08:00",
"starting_point_status": true,
"ending_point_status": false,
"status": 1
},
{
"counter_id": 2,
"type": 1,
"time": "08:30",
"starting_point_status": false,
"ending_point_status": false,
"status": 1
},
{
"counter_id": 3,
"type": 2,
"time": "14:00",
"starting_point_status": false,
"ending_point_status": false,
"status": 1
},
{
"counter_id": 4,
"type": 2,
"time": "14:30",
"starting_point_status": false,
"ending_point_status": true,
"status": 1
}
]
}
{
"status": "success",
"code": 201,
"message": "Trip instance created successfully",
"data": {
"data": {
"trip_instance": {
"coach_id": 2,
"bus_id": 1,
"schedule_id": 1,
"seat_plan_id": 1,
"route_id": 1,
"coach_type": 1,
"driver_id": null,
"supervisor_id": null,
"trip_date": "2025-09-28T00:00:00.000000Z",
"status": 1,
"migrated_trip_id": null,
"created_by": 2,
"id": 5,
"updated_at": "2025-08-17T10:28:31.000000Z",
"created_at": "2025-08-17T10:28:31.000000Z"
},
"seat_inventory_created": true,
"seat_inventory": {
"trip_id": 5,
"total_seats": 24,
"created_inventories": 24,
"inventories": [
{
"trip_id": 5,
"seat_id": 1,
"booking_status": 1,
"blocked_until": null,
"booking_id": null,
"last_locked_user_id": null,
"created_by": 2,
"id": 196,
"updated_at": "2025-08-17T10:28:31.000000Z",
"created_at": "2025-08-17T10:28:31.000000Z"
},
{
"trip_id": 5,
"seat_id": 2,
"booking_status": 1,
"blocked_until": null,
"booking_id": null,
"last_locked_user_id": null,
"created_by": 2,
"id": 198,
"updated_at": "2025-08-17T10:28:31.000000Z",
"created_at": "2025-08-17T10:28:31.000000Z"
}
]
}
},
"message": "Trip instance created successfully with seat inventory"
}
}