Using the API how do I determine which warehouses have stock on hand for a specific item?

Using the API how do I determine which warehouses have stock on hand for a specific item?

Business Objective:  when creating a sales order via the API, we want to associate it with the closest warehouse that has inventory on-hand (in-stock).

Via the API I have the list of warehouses and list of items, and the documentation for creating a sales order says you can set the warehouse_id for each item in the sales order.
 
Question: using the API how do I determine which warehouses have stock on hand for a specific item?