The Handelsregisternummer is a number every business gets when it's listed in the German Trade Register (Handelsregister). You get a Handelsregisternummer by filling the Fragebogen zur steuerlichen Erfassung. For more details, see this guide.