createacct() Sorry you must choose a package

victorcesar7

Registered
Jun 22, 2020
1
0
0
Brasil
cPanel Access Level
Website Owner
I'm using this code changing only the parts of username password and domain and when I'm going to run on git bash or on my own server it says "sorry you must choose a package" being that I put the correct pkgname what do I do?

Code:
https://hostname.example.com:2087/cpsess##########/json-api/createacct?api.version=1&username=username&domain=example.com&bwlimit=unlimited&cgi=1&[email protected]&cpmod=paper_lantern&customip=192.0.2.0&dkim=1&featurelist=feature_list&forcedns=0&frontpage=0&gid=123456789&hasshell=0&hasuseregns=1&homedir=/home/user&ip=n&language=en&owner=root&mailbox_format=mdbox&max_defer_fail_percentage=unlimited&max_email_per_hour=unlimited&max_emailacct_quota=1024&maxaddon=unlimited&maxftp=unlimited&maxlst=unlimited&maxpark=unlimited&maxpop=unlimited&maxsql=unlimited&maxsub=unlimited&mxcheck=auto&password=123456luggage&pkgname=my_new_package&plan=default"a=500&reseller=0&savepkg=1&spamassassin=1&spf=1&spambox=y&uid=123456789&useregns=1
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,304
1,249
313
Houston
This is discussed here: https://documentation.cpanel.net/display/DD/WHM+API+1+Functions+-+createacct in detail - I'd suggest looking over the parameters you're using.

pkgname is reserved for instances which you want to assign an account it's own new package
plan is to assign an account a package that exists currently

pkgnamestringA new plan name. Use this parameter to save unique account settings as a new plan.
Note:
  • If you do not use this parameter but specify 1 for the savepkg value, the system will generate a plan name.
  • If you do not use this parameter and specify 0 or do not use the savepkg parameter, the function does not save a new plan.
If you do not use this parameter, the function will not save the new account settings.
A valid plan name.

planstringThe account's hosting plan (package).
Important:
If you provide this value, do not use the optional quota-related parameters below. Instead, we recommend that you allow the account's plan to determine these values.
This parameter defaults to the default plan.
A hosting plan name on the server.default