Designing route optimisation api request for carpooling


We are using a route optimization API for carpooling. Here’s how it works: when the first passenger makes a request for a ride to a certain location at a specific time, we record this request. If another passenger makes a similar request around the same time, the API(algorithm) tries to combine these two requests, essentially creating a carpool. However, it seems to prioritize the second passenger.

For example, let’s say Passenger 1 booked a ride for 3 p.m. and was supposed to be dropped off at 3:05 p.m. But then Passenger 2 requested a ride for 3:22 p.m., to be dropped off at 3:28 p.m. The system combines these two rides, but changes Passenger 1’s pickup to 3:14 p.m. and drop-off to 3:19 p.m. This doesn’t seem right. Ideally, Passenger 1’s pickup should remain at 3:05 p.m. and drop-off at 3:15 p.m. at the latest. It should be Passenger 2’s timings that are adjusted. The system should inform Passenger 2 to be ready for pickup earlier, instead of delaying Passenger 1’s pickup.

We have tried to set the priority key in the request under the shipment array of objects, but that also doesn’t work for us it still changes passenger 1 pickup time.

Is there any field by which we can solve this problem?

Let me know if more inputs are required from my end.

If you don’t want the pickup time changed, you can specify a time window for it. If this would not help, why is that and do you have a specific example JSON?

The priority is only to help with unassigned jobs if necessary.