Is it possible to look up where and when an iPhone was purchased, based only on the serial number or other unique info inside the phone?
I don't know of a public tool for looking this up. However, if you befriend an Apple Genius, I know that the system they use for creating tickets allows them to view the purchase date and sales channel it was purchased through. However, there is no way to tell direct location (i.e. Best Buy on Main Street in St. Paul), only the channel (i.e. Best Buy).
You can also deduce the purchase date yourself by going to Apple's Check Your Service and Support Coverage page. If you locate the expiration date for repair coverage, subtract a year from that to identify original purchase date. If AppleCare was purchased, subtract an extra year.
Not an exact answer but may help... this page has instructions that will let you determine the manufacture date of a refurbished phone (i.e. one for which you might not have a receipt).
Summary: If the serial number begins with 5, it's a refurbished phone. The third digit is the last digit of the year of manufacture (so if your serial number begins 5K3, this is a refurbished phone manufactured in 2013). The fourth and fifth digits are the week of manufacture, so 02 would be in January, 51 in December, etc.
You can try this : https://selfsolve.apple.com/agreementWarrantyDynamic.do
But it won't say much.
If you have a Mac, you can download coconutID, which lets you check your Mac's serial number as well as any other Apple device's serial number.
You can check iPhone/iPad purchase date and contract status with this IMEI checker - www.iphoneox.com
It doesn't show where you purchased the phone, but it should show the original carrier which narrows things down substantially.
Also this checker shows whether a carrier lock is active against that device.