AT&T allows you one device exchange within your first 30 days. It is clearly stated. It does not matter if you purchased online or at the local AT&T Corp retail location. The only issue is finding a store with stock of the whie iPhone that you want.
There is a $35 restocking fee that may be charged if you opened your iPhone 5. There is no fee if you did not open the sealed package and return / exchange within the first 30 days.
Here is the official AT&T reference with the details: