souzadavi Posted January 23, 2019 Share Posted January 23, 2019 I'm building a form for free orders, everything goes fine.. But now when I created my customer in the docs said: https://developers.whmcs.com/api-reference/addclient/ 'address1' => '123 Main Street', //required 'city' => 'Anytown', //required 'state' => 'State', //required 'postcode' => '12345', //required 'country' => 'US', //required All this field is required, My question is: why is it required? There is any work around to disable this requirements? I want to create a whmcs user only with name, email and password.... Thanks 🙂 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted January 23, 2019 Share Posted January 23, 2019 Maybe you can avoid specifying it by going to Setup > General Settings > Other and define 'Optional Client Profile Fields' to be address, city, state, country and postcode? Haven't tried it yet. 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted January 23, 2019 Author Share Posted January 23, 2019 Thanks for your attention... But I cant do it, because in paid plans I need those fields... My guess is how to be optional this required fields in API add customer.... Thanks 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted January 24, 2019 Share Posted January 24, 2019 Hmm, I see that. Maybe create the accounts with some dummy info at first, and then have your hook delete that info from the database? I don't know if that would cause any issues, but it might be the only way to achieve it if you want to run it from the same installation. 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted January 24, 2019 Author Share Posted January 24, 2019 Thanks DennisMidjord this why Im asking here it, to understand why those fields is required, for me there is no clue to be required those fields... From API I could populate with any values but this isn't the nice solution... Many other company like WIX only email and password is required... I think this field could be optional in API add client.... I hope some one from whmcs team give me some explanation or just remove this requirements from API add client. Thanks 🙂 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted January 24, 2019 Author Share Posted January 24, 2019 Here is a 2 years old request about this: https://requests.whmcs.com/topic/unrequired-fields-in-api without comment of whmcs team... toooo bad!!! Please whmcs team could you have a look for this little modification?? thanks 0 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted January 24, 2019 Author Share Posted January 24, 2019 In the docs there is a option: skipvalidation bool Pass as true to ignore required fields validation Just set it to true and it's possible to add customers without those required fields!!! I tried to answer in the request comments but it's already closed. So it's here for somebody like me who do not full read the docs with attention :) 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted January 24, 2019 Share Posted January 24, 2019 from your Add Client API documentation link, have you tried setting skipvalidation to true ?? the implication is that setting that value to true stops the API checking if the "required" fields are present. 1 Quote Link to comment Share on other sites More sharing options...
souzadavi Posted January 24, 2019 Author Share Posted January 24, 2019 yes this was the solution!!!! thanks again!!! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.