Credits are used in the StarCraft II: Wings of Liberty single player campaign to purchase unit and structure upgrades, and hire mercenaries. Credits are earned by completing missions (and sometimes from completing bonus objectives), except for the final Char missions, collecting more than twenty-five zerg research points, and collecting more than twenty-five protoss research points.
There are not enough credits on a single playthrough to upgrade or hire everything. At one time there was a bug that once all missions were completed prior to the final Char missions, additional credits could be earned by replaying missions through the archive on any difficulty, but that has now been corrected by Blizzard.
After a mission in which excess protoss or zerg research points are collected, they can be traded for credits by using the research console in the laboratory.