In the games I run, if you're in a large enough city (as given by the DMG town gold limit guidelines) you say "I'm selling magic items X, Y, and Z", and you exchange the magic items for gold equal to 50% of their price. (I abstract all buying and selling, on the principle that shopping is boring.)