Some Locations offer a Vendor NPC that can be bartered with. They have a stock that replenishes every Tick, but will also keep player Items that are not part of their stock indefinitely.
The vendors will agree to any barter where the value you offer is equal to or higher than the value of their side of the trade.
The value of items you offer doesn't ever change: it's the item base price. The value of vendor's items changes with their (and your!) Barter skill though:
Price=⌊BasePrice×BarterRatio−Discount⌋
BarterRatio=PlayerBarterSkill+160VendorBarterSkill+160×2
Discount={25%0%if player has Master Trader perkotherwise
So for example a Stimpak with the base price of $175, when bought by a player with Barter skill 40% (without the MasterTrader perk) from a vendor with Barter skill 80%, will cost:
Price=⌊175×40+16080+160×2−0%⌋
which amounts to $420, while a player with Barter skill 120% and the MasterTrader perk active will be able to buy the Stimpak for the price:
Price=⌊175×120+16080+160×2−25%⌋
which amounts to $225.
Caps always have the value of $1, irrespective of which side of trade they're on.