PayPal and shopping cart inventory

Hi, does anyone know anything about or of any articles/tutorials on how to set up an inventory that updates a database after every sale using paypal’s Instant Payment Notification system.
Its for a clothes store which runs dynamically with PHP and paypal. There are multiple sizes per item and the inventory would need to work for multiple sales, these problems are what i can’t get my head round.

some advice or a push in the right direction would be brilliant,

Thanks
Tom