If bought in the Apple Store, then yes. Even without receipt they can look up the purchase from either your name, serial on the phone, IMEI/MEID, email address and I THINK the ICCID. Regardless, there is going to be SOME way for them to look it up if purchased in the store. You have 14 days to return the phone to the store I believe.
I've had a friend buy a black iphone 4s wanting a white and the white one came in within 14 days so she took it back they swapped the black out for the white. All within the store. The upgrade reversed, they returned the phone, then re-used the upgrade for the whte one. Simple as that. This was at our store at least, but it shouldn't be different in any other Apple Store I'd hope.