Question: I know there are a lot of similar topics, but I couldn't find the exact answer for my question.

I need to describe a situation in which one event preceded the other and I couldn’t do it with simple past and past perfect tenses.

E.g. “I have received my order, unfortunately one of the items is damaged. **I don't know whether it was damaged during the transportation or had been defective from the beginning**.” 

I know that the second event is preceding the first; therefore I should use past perfect tense, but I can’t understand how to implement it in abovementioned sentence. Instead I used “was” because the action is over, and past perfect progressive tense (“had been”) because even thou the action is over it is still have a result as the damaged item.

So is it a correct sentence, or should I rewrite it? And is it possible to use with simple past and past perfect tenses in it? If not, how to show the sequence of events?

Answer: 
Some examples: 

* "He was happy, but had been sad not long before due to the death of his puppy."
* "She was in line for the concert by 5pm and had been standing in the cold for hours."
* "The clerk was waiting for the customer who had been indecisive to make up his mind."
* "John was going to go out with friends but he had been feeling lousy that day so he decided to stay home."

I find that "had been" refers to the action (or state of being) that starts the earliest, while "was" refers to the action (or state of being) that starts later.
I, too, would use "was": *I don't know whether it was damaged during the transportation or **was** defective from the beginning*. 

A slightly different phrasing would be my choice, but I wouldn't change the "was": *I don't know whether it was damaged in shipping or was damaged before it left the shop/warehouse/factory and nobody noticed*

As far as "sequence of events" goes, that's covered by world-knowledge: people reading understand immediately that shipping happens *after* leaving the point of origin, so you need not reflect that sequence grammatically.