How can I start programing on automatic payments with paypal API

I am working on a website that will be host a x number of stores to help them deliver their product. On each transaction I will be deducting some percent but I am not sure how to approach the paypal API application to deduct automatically the percent to the website from each store transaction made through the website.

is there such a possibility on getting this done?

http://php.net/manual/en/refs.creditcard.php will help you.