Tour API v1 - Multiple before/after index parameter support


I’m currently using the tour function in v1 API. But it seems that the API doesn’t support before/after param using multiple index.
Consider following scenario. Driver A is at point A. There are point B, C, D, that are closer to point A respectively. There are 2 pickup locations, which is point B and D. And there is a delivery location at point C. If I don’t provide before/after param, the order will be A → B → C → D. I need to make sure all the pickup tasks are done first, before proceeding to delivery location.
It will be solved by providing the delivery index using before param at pickup locations. But in my use case, 2 or more delivery locations is also possible. so if there is another delivery location at point E, I need to somehow make the order A → B → D → C → E.
I tried to use array of index in before/after param, but it doesn’t seem to support it.
Is that use case feasible ? If it’s not (yet?), is there any workaround or solution ?
Any help is appreciated.

Thank you

Unfortunately, you can not use arrays of pickup or delivery points.

There is no solution for multiple pickup and multiple delivery points. You could introduce an intermediate dummy point, have all pickups visited before that, and all deliveries after, but it may be suboptimal.

A workaround may be to use a time restriction, to prioritize the pickups before the deliveries, e.g. set a due time on B and D. You can set an arbitrary early due time, or first request an unrestricted route and use the first arrival time at one of your delivery points.

On a sidenote: the last point in your array will always be the final destination in the route. It will not be moved, so D in your first example will always be the last stop. If you set it to be a pickup point, the route will be infeasible and unreliable. You’ll need to repeat A if you want to return at the starting point.