If your phone is out of contract, or free of the contract, then your carrier should be able to give you the unlock code. If it's still under contract, then it is up to their discretion. Some will provide the unlock code regardless because you still have to complete the contract obligation so it's not going to effect their sales.