I’m building a delivery route optimization feature. An end user can add a list of addresses (waypoints) that they’d like to optimize the route for. So the addresses are not necessarily stored in the DB. Then I run the Google Routes API which returns the waypoint sort order. Ultimately, I’d like to sort the address custom state, by the sort order list returned by the API.