Code or function to add estimates from Books into a list in Deluge

Code or function to add estimates from Books into a list in Deluge

I'm probably stating this wrong,  but I have branches in my zoho books - my materials handling platform send me completed transactions by a webhook, and I need to find a way to match the customer and Facility/branch before I can put the transaction to an estimate - most clients have only one facility, but a couple have transactions in 2 facilities or and one has actions in each of my facilities. 

the solution would seem to be in flow - put the draft estimates into a Collection/List/Dictionary - then take the customer ID from the materials handling [that matches a custom field in books] then use the facility ID variable (already set and the Estimate lead (first 3) to find out what estimate I need to put the transaction on. 

I dont want to send the transactions straight to invoice as there are some additional steps before they can ben sent to customer. 

any one have information, or ideas how best to do this?