There is no way to know when bartering first became part of the human experience. It is likely that it has been going on since before civilization existed.
It is possible to say, however, that barter helped to bring civilization about. It was necessary for people to trade with one another in order for civilization to exist. In order to have civilization, people need to live together in towns. Typically, people in towns all do different jobs. None of them are typically able to produce everything they need. Therefore, they have to barter. For example, a farmer will grow crops and will need to have some clothing. The farmer will need to trade some of his crops in order to get clothing. Without barter, people have to make everything for themselves. They have to grow their own food and make their own clothing. There cannot be any diversification of the economy because it is not possible to have anything like specialized artisans. Civilization cannot exist when there is no specialization and everyone is just making all the things that they need for themselves. Therefore, it is necessary to have barter in order for towns and civilization to exist.