Routing and Route Stops or The Traveling Salesman Problem

Trying to solve the “Traveling Salesman Problem” with Tadabase! Travelling salesman problem - Wikipedia

So Routific’s Routing API (Routific Engine API) allows for the submission of multiple waypoints and returns those waypoints as a routed list based on multiple conditions.

For example,

Salesman A starts at 123 Main Street for the day. He has 5 stops that day: 663 Main Street, 345 Main Street, 678 Main Street, 3 Main Street, 123 Main Street. At the end of the day he needs to return to 123 Main Street. Every one of those stops is stored in a Route assigned to him for the day.

I need to send that list in that specific Route to Routific, sort it in the most efficient manner (with traffic, etc.) and then update that sorted list in Tadabase. On top of that, some of the Route Stops will be booked appointments with a specific window (2 hours or so) that they have to arrive in.

What I cannot figure out is how to submit the multiple stops to the API. How do I POST the multiple records from the Pipe to the Routific API, and then take the returned data and update the individual records so that I can set a Data Source sort on it and/or number the stops?