Trigger recording for affiliate plugin

I have just installed the affiliate plugin and I am pretty happy with its reporting and Mass paypal payment exports?

The problem is that I use a custom-made "shopping-cart" plugin (which is obligatory to use as it connects and shares info with an ERP, a CRM and a SAGE system).

How is it possible to extend the affiliate plugin into recoding purchases made by my plugin? Is there an API? A specific function to be called, something like function add_purchase($affiliate_id,$product_id,$payment)? Should I manually insert data to a database table?

I am very adequate with PHP and Wordpress so implementing this won't be a problem, I just need some info on how the plugin works