Retrieve data from a CRM system (2 fields), make a simple calculation with these 2 fields (substracting) and update the CRM system in a 3rd field with the result of the substraction.
The CRM has a full blown API available including documentation: [url removed, login to view]
The CRM contains an object called 'Deals' (or 'Sales').
Every deal has a 'Total price' calculated by the CRM. Every deal also has a field with an amount called 'Pre-Payment'.
For every created or updated deal, you will substract the Pre-Payment field from the Total price field and send in a new field the result of the substraction.
The CRM solution offers a webhook functionality allowing you to receive a notification as soon as a deal is created or updated.