How can we only enable checkout with a valid discount code?

We have created a new webstore but would only like to enable customers to complete checkout if they enter a valid code (which can be tagged against their account and visible on order export data). We will need several codes set up which allow access and the option for more to be added at later dates. Without a code the customers can still add products to their cart but will be blocked from checking out.

We have looked into out of the box apps but nothing quite fits.

Any help would be much appreciated!