i am searching a lot here
https://documentation.cpanel.net/display/SDK/Guide+to+cPanel+API+2
https://documentation.cpanel.net/display/SDK/Guide+to+cPanel+API+1
but didn't found any correct way. what my requirement is i need to host a domain on my server programmatically, where my clients provide me its domain name (ex: test.com) via a form and when he submit that form, i will set a wordpress site for it using that domain. Currently i setup a subdomain programmatically using cpanel api, what my requirement here is hosting a domain on my server and i have to do this using api.
Above I have suggested the way to create addon domain on a cpanel. Hereunder is the code to generate new cpanel account on WHM or server