It expresses something that happened at a previous point in time.
I know this refers to a past time when you bought but still want to know whether we can construct a sentence like this.
The particular formula for asking a question in the past perfect tense is different from the standard past perfect.