Jump to: navigation, search


This command can be used to validate an email address and password against a registered user in WHMCS. If a match is found, it will return successful with the userid and password hash which can then be used to set the $_SESSION['uid'] and $_SESSION['upw'] values respectively in the users session to auto log the user in to WHMCS.


  • email - the email address of the user trying to login
  • password2 - the password they supply for authentication

Example Command

External API

 $postfields["action"] = "validatelogin";
 $postfields["email"] = "[email protected]";
 $postfields["password2"] = "abc123";

Internal API

 $command = "validatelogin";
 $adminuser = "admin";
 $values["email"] = "[email protected]";
 $values["password2"] = "abc123";
 $results = localAPI($command,$values,$adminuser);

Successful Response

 result = success
 userid = matching client ID (if successful)
 contactid = (if a sub-account of a client)
 passwordhash = the password hash needed for the login session

Error Response

result=error&message=Email or Password Invalid # Invalid Email or Password Given.

API Functions
Client Management
Add Client - Update Client - Delete Client - Close Client - Get Clients
Get Clients Details - Get Clients Products - Get Clients Password - Add Contact - Update Contact
Delete Contact - Update Client Product - Upgrade Product - Validate Login - Send Email
Support Tickets
Get Support Departments - Get Support Statuses - Get Tickets - Get Ticket - Get Ticket Predefined Cats
Get Ticket Predefined Replies - Open Ticket - Reply Ticket - Add Ticket Note - Delete Ticket - Update Ticket
Create Quote - Update Quote - Delete Quote - Send Quote - Accept Quote
Module Commands
Module Create - Module Suspend - Module Unsuspend - Module Terminate
Domain Commands
Renew Domain - Get Domain Lock - Get Nameservers - Get WHOIS - Request EPP
Update Lock - Update Nameservers - Update WHOIS - Domain WHOIS Lookup
Order Handling
Get Orders - Get Order Statuses - Add Order - Accept Order - Pending Order - Cancel Order - Fraud Order - Delete Order
Get Invoice - Get Payment Methods - Create Invoice - Update Invoice - Add Billable Item - Add Invoice Payment
Add Transaction - Add Credit - Capture Payment
Get Activity Log - Get Admin Details - Update Admin Notes - Get Currencies - Get Email Templates
Get To-Do Items - Get To-Do Item Statuses - Get Staff Online - Get Stats - Encrypt Password - Decrypt Password