EXCLUSIVE

50 Cent's all smiles after the bankruptcy judge signed off on a deal that officially ends his case ... but at a price.

The rapper will pay out $23 million to his creditors over the next 5 years -- $17 million to Sleek Audio and $6 million to Lastonia Leviston ﻿... according to legal docs obtained by TMZ.

As we first reported ... Fiddy presented the plan back in April ... the judge just approved it.

50's attorney tells TMZ, "Mr. Jackson is pleased that the Bankruptcy Court approved his plan of reorganization today, less than one year after filing for chapter 11 to reorganize his financial affairs." The lawyer goes on to say, "Mr. Jackson appreciates the fresh start this process provides."