I need a function that accepts a JSON input, does some data analysis with two databases, and returns a JSON output.
------ more specific details --------
An image says a thousand words ...
![][1]
Inputs: payerID, sellerID
Database1 has tables named using payerIDs. Each table has one column, containing 6-digit alphanumeric codes.
Database2 has tables named using sellerIDs. Each table has two columns, one column contains 6-digit alphanumeric codes, the other column contains integers.
The function will use payerID and sellerID to determine if any of the alphanumeric codes contained in the payerID table exist in the sellerID table. If so, the function will select the code-integer pair with the highest integer.
It will then lookup the description of the alphanumeric code (contained in another database) and output.
outputs: code, description, integer
#Also (and this might be implied by the JSON req, but I'm not familiar enough with coding to know), the input & output will be coming-from / going-to a third-party server.