May be easier to get one out of the shelve solution and customize it to your needs. You could use something like cubepanel.com and write calls to its API. That way you could produce your own scripts that will create, edit or remove hosting resources, reproducing the panel's actions, whilst transparently running the panel in the background.
If you have a look to
Cube Panel webservices API documentation you will find full examples written in PHP + other useful info
