title: Offer Engine - Architecture
body: <p>I am trying to implement offer engine for e-commerece website. I envision offer engine having CRUD APIs. It should be a rule based system wherein the offer post api (or create api) will create a rule. Like for example: consumers who have shopped more than 3 times and have London as delivery city will get discount of 10%. </p>
  
  <p>The Offer GET API will get context and return the applicable offers.</p>
  
  <p>Now, offer can have usage constraints:</p>
  
  <p>-> applicable for each customer only once
  -> applicable for first 1000 users</p>
  
  <p>I understand I need to make a table which tracks the usage of the offers. My question is it should be the system which uses the offers, which in my case would be payment. I would make this assertion on the belief that client of offers should know the usage. And the task of offer engine is limited to providing/creating rule given the context.</p>
  
  <p>Or should it be offer engine itself which tracks the usage of the offers?</p>