I've tried setting the address to the empty string and a single space (and also after testing it seems city, state, postcode and phonenumber are also required). Neither of those worked, so I'm now just setting them to '-', which does work but is kind of ugly.
Also, the API docs imply that the welcome email will be sent automatically unless noemail=true, but that doesn't seem to be the case. (Setting noemail=false doesn't make a difference.)
Here's an excerpt from my code if you're interested (this is in Python):
Code:
class WHMCS:
def execute(self, action, args):
args.update({'username': self.user, 'password': self.password, 'action': action})
params = urllib.urlencode(args)
result = urllib.urlopen(self.url, params).read()
out = dict()
for field in result.split(';'):
if len(field) > 0:
pair = field.split('=', 1)
if len(pair) == 2:
out.update({pair[0]:pair[1]})
if out['result'] == 'error':
raise WHMCSAPIException(out['message'])
return out
def addclient(self, firstname, lastname, email, **kwargs):
kwargs.update({'firstname': firstname, 'lastname': lastname, 'email': email})
defaults = {'password2': random_password()}
blank_defaults = ['address1', 'city', 'state', 'postcode', 'phonenumber']
for (k,v) in zip(defaults.keys(), defaults.values()):
if not k in kwargs:
kwargs.update({k:v})
for k in blank_defaults:
if not k in kwargs:
kwargs.update({k:'-'})
return self.execute('addclient', kwargs)