Traditionally, the opposite of "retail" is "wholesale."
The entire path by which goods get from the producer to the consumer is called "distribution."
The reason I said "traditionally" is that in recent decades, things have changed and gotten complex because of globalization, cheap shipping, electronic payments, credit cards, and the Internet.
The traditional distribution system involved several steps. For example, a "wholesaler" might sell to a "jobber," who sold to a "retailer," with fees being charged at every step in the process. The people in the middle of the chain are "middlemen." Distribution is more efficient, and thus cheaper, if you can "cut out the middleman." The fancy word for this is "disintermediation."