Your iPhone was probably locked to O2. Contact O2 about
unlocking your iPhone. Only the carrier to which the iPhone
is locked can unlock it.
If your original receipt showed the iPhone as unlocked, pursue
the matter with the seller.
If the iPhone was purchased at CarWarehouse, it locks to the
first carrier used.