There is no single answer to this question: it all depends what you mean by 'correct'!
In purely grammatical terms, it's generally accepted that "You've got it" is OK, while "You got it" is wrong. As far as the grammar of the language is concerned, "You've got it" is standard English, while "You got it" is not standard English.
However, the question here is not about grammar: it's about function. "You got it!" can be seen as a fixed phrase which has come to mean a particular thing in a particular context. Like idioms, fixed phrases are what they are, and they don't have to follow strict grammatical rules. In this context, "You got it!" is a functional exponent performing the function of agreement to a request. When used in the dialogue above, "You got it!" means"Yes, of course I'll buy you a hat!". In this context, "You got it!" is the appropriate response, while "You've got it!" is not.