Veterans of the Fallout series will quickly recognize the shopping system. It is based on exchanging goods, with an occasional extra charge on the side that offers a less valuable item (or offers nothing). You can recognize barterers in the wastes by the cart icon above their heads.
The salesman has a definite amount of cash and goods. For the transaction to take place, both sides need to offer goods, or merchandize, of similar value. You will not be able to sell an item, if its value exceeds the amount of money that the salesman has (you can see it under his icon), unless you pick some additional goods, from among his wares, which will balance the excess value. To select the items to sell, simply drag them over from your equipment to the field in the middle of the screen, or right-click on them. Buying works the same way. Potential differences in value will be automatically balanced in cash. As long as this is an option. Also, it is worth noting the option to barter. Every point gives you 1% discount on goods. This is a value shared by all the party members so, if one character has this skill well developed, it is also effective on the items that the rest buy.
Each items that you sell, permanently stays in the stock of that salesman. If you sell something by mistake, you will always be able to buy that back, even several hours later. It is a good idea to "wholesale" at two or three salesmen, in big cities, at best. This way, you will not have to check every shop in the wastes, in search of something that you want to buy back and you do not remember who you sold it to. Apart from that, some salesmen pay more, for certain goods, than the others. You will be notified of that, with an entry in your log book. An example here is the Quartermaster at the Citadel, who pays much more for Broken Weapon parts than anyone else.