Flexible Cupon Service

Hello all, I was wondering if I could get some questions answered about how cupons work in the work place. I have an idea which involves creating a very flexible cupon service, but would require knowing the rudiments of how cupons work. The main question I have is how is tax calculated on a ware as it is sold under a cupon service. I believe that would be the only thing I would have to stringently mandate as far as the cupon goes, since the institution wishes to clear the merchendise from the floor. The service would involve some C# back end classes which would be passed to an IronPython sandbox such that the users could be very flexible with their cupons, and the domain specific-ness of it could be passed various aspects of the order, such as items, the order it's self, etc. I don't want code, this is a generic discussion on the best way to implement a cupon service using a python sandbox. The classes would be stored in the database as clobs, and I would probably have a seperate service for implementing the registration of said cupon.

The real susbstance of this question is (so make sure you answer this one question) what are the legalities as far as implementing cupons that I have to implement such that I am in good standing with the authorities? These would be implemented as sealed methods or objects.