Programmatically adding registration type (Entity Registration module)
Registration _type is just an entity type so is exactly the same as creating any other entity:

$registration_type = entity_create('registration_type', array(
    'name' =&gt; 'flake',
    'label' =&gt; 'Flake',
));
entity_save('registration_type', $registration_type);


Sometimes it helps to create an entity via the UI provided with a module and then load and inspect it to help understand what values can be provided.

For example after creating a registration type visit /devel/php (make sure devel module is enabled) and run this code:

dpm(entity_load_single('registration_type', 1));


You should see an output similar to this: