Nothing additional we can say. Apple does not unlock phones. In your case, you have to deal with t-mobile. They are the only ones who can authorize the unlock. They are the ones who determine unlocking policy for their phones. Nevertheless, they should refund your money because clearly you were given the wrong info. If you did not qualify for a phone unlock, they should have told you right off the bat.
Go to a t-mobile shop and ask the case be elevated. (Sometimes it is better to deal with people face to face instead of the phone).
PS they contact Apple to process the unlock. There is no code involved.