No preposition is needed, nor even customary. Google Ngrams show that buy wholesale is far more common than the others.
- Buy by wholesale is practically nonexistent.
- Buy at wholesale probably shows up as often as it does because one does say buy at wholesale prices or buy at wholesale markets.
- Buy in wholesale probably comes from buy in wholesale quantities.
So you could say:
I purchased all this stuff at wholesale prices
but that carries the implication that you bought a smaller quantity than wholesalers typically do, though you were lucky enough to pay the wholesale price.
You could also say:
I purchased all this stuff in wholesale quantities
but that emphasizes the large amount you bought rather than the lower price you paid for it.
For your sentence, though, leaving off any preposition probably the best fits your meaning. To cover both the price and the quantity at which you bought the items, you would simply say:
I purchased all this stuff wholesale.