Amazon has patented a system that would let people exchange unwanted gifts for those they actually want.