Deductions & credits

Does that count as a loss?

To be clear; purchase price of vehicle #2 was $29.5k, we put $5k into it. 

We brought it to a dealership who agreed to pay the remaining $2k loan, apply $5k to our new lease, and then we received a check for $15k to purchase the 2nd vehicle from a private party a week later.

So we received $22k for it when we originally paid $29.5k. Is that a $7.5k loss, and/or do we have to pay tax on this?