In my caddy there is an aftermarket radio fitted to it and I want to replace it with the proper orginal caddy radio,

Can I just simply buy a radio of a scrapyard or eBay from a caddy and fit it to my caddy or do I also need a code with Radio or is it just plug and play ?

It's an 06 reg caddy by the way