To check how the plugin send the command to the module , check the cron.php it has a good road to begin with it .
For other side the plugin should have a controller that lisen to command like
Plugins/licence_api/api/(add/cancel/reissue)
Licence_ami = plugin directory
api = api.php inside controller
(Add cancel reissue) = function inside api file
Now you have the logic , you can use your way of coding .