Putting a redeem code function in my game

Hello
Basically i need a player to receive i custom item when they input a correct code in a text box. Any idea how to do this?
thanks