It is permissible for you to buy the car directly from the agency in your name, and then sell it to a second purchaser after holding and possessing it, whether or not you bought it in cash or on credit, even if you will sell it at a price higher than that for which you bought it for. However, you should not state in the contract that the second purchaser bought it directly from the agency because this is a lie and it may also result in some problems. If you have not taken the car from the agency and have not taken possession of it, then selling it to a second purchaser is invalid whether it is in cash or on credit. This is so even if you will sell it to him at the same price that you bought it for. The Prophet (peace be upon him) forbade
selling commodities till they are taken possession of or owned by the purchaser.