T-Mobile Support page contains a thread that covers your issue:
Last updated on: Jul 3, 2013 2:43 PM
If you purchased an eligible device, the device has been programmed with a SIM Subsidy lock that will prevent the device from operating with other compatible wireless telephone carrier’s services.
If you wish to use the device with the service of another wireless telephone carrier, you must enter a numeric SIM Subsidy unlock code to unlock the device.
Understanding SIM Unlock Requirements
As an active or former T-Mobile customer, you may request a phone unlock. T-Mobile will unlock your phone (as long it is not reported as lost, stolen, or blocked) if:
- You have purchased your device from T-Mobile or an authorized T-Mobile dealer and activated it on T-Mobile service;
- You have Postpaid service, have not requested an unlock code in the last 90 days;
- You paid for your device in full;
- Your account is in good standing;
- You have a minimum of 40 consecutive days of active Postpaid service since purchase (or for Prepaid service, have used your device within the past 60 days );
- You are under a 24-month service contract, you have made monthly payments for at least 18 consecutive months on your plan or have paid a migration fee for the device; certain exceptions may apply please call Customer Care for details;
- You are on a Prepaid plan, you have had more than $50 in total refills on the device;
- You are a former customer, your account balance is zero and you did not port out a line associated with the device during the buyer’s remorse period;
- You provide proof of purchase if T-Mobile is unable to verify purchase.
Note: Exceptions to some or all requirements may apply in certain circumstances, including for Military Personnel and Business and Government Accounts.
If you qualify for the above list, give them a call and they will help you out!
A user from XDA Developers forum answered to a problem similar to your own, you can read about it here:
I just unlocked mine a few days ago. If you meet the requirements you should be fine, http://support.t-mobile.com/docs/DOC-1588
I bought my phone from ebay from a guy in Florida (I'm in NY), I had it on my account for a few months. So I had no reciept or anything, or history of the phone. When I called they asked for my phone number, account passcode, the phones model name and IMEI. Then I gave them my email, and recieved the code via email in about 24hrs. So it was pretty painless and free.
There's a XDA Developers Thread with lots of users claiming to have successfully unlocked their devices either by changing their IMEI or by means of truth manipulation:
Read the entire thread here.