Can I use a new iPhone with AT&T if I'm on contract?

I broke my iPhone 5S a while back and since then I've been using my old 4S. When I bought my 5S in September I had renewed my 2 year contract. I just sold my broken 5S on ebay for parts and I'm going to use that money to purchase a brand new AT&T iPhone off of eBay. The iPhone has never been used or activated. Can I buy it, set it up and take it to AT&T and just have them activate it and transfer my number into it? Or can I not do that because I have a contract?

You can use a tin can and string. They don't care as long as you pay the bill on that contract. Yes, you can do that. Best luck.