Please give some idea for below question

I need a same kind of setup, i am using a 10% Discount print when customer spend $100 can be used next visit , what I notice is the bar code is not a random for that so each scan the discount is increasing +10% , So I need a help from any member that create entity like coupons with random numbers used once only and with expiry , can anybody plz guide setting auto create entity of 10% discount

If made easy then first create only code consumption
for example only use one code for one time