'Did you have eaten last night' - this one is not an English sentence.
"Did you eat last night" is probably what you meant. My correction is just a question about your meal habits last night. It does not convey a sense of being part of a larger dialogue. It is just a question that could be asked in casual conversation.
''Had you eaten last night'' - This is an English sentence. It has the sense of being part of a larger conversation. Almost as if someone is querying about a problem and asking you what happened that might have contributed. An example - "You were very drunk last night. I wonder what could have caused that. Had you eaten last night ?"