"to traffic or trade by exchanging one commodity for another," mid-15c., apparently from Old French barater "to barter, cheat, deceive, haggle" (also, "to have sexual intercourse"), 12c., which is of uncertain origin, perhaps from a Celtic language (compare Irish brath "treachery"). Connection between "trading" and "cheating" exists in several languages. Related: Bartered; bartering.
As a noun, "act of exchanging, commerce by exchange of commodities" (rather than buying and selling for money), 1590s, from the verb.