{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-api/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"GetClientsDetails","description":"Developer documentation for the WHMCS API — the","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"getclientsdetails","__idx":0},"children":["GetClientsDetails"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Obtain the Clients Details for a specific client"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note this function returns the client information in the top level array. This information"," ","is deprecated and may be removed in a future version of WHMCS."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"request-parameters","__idx":1},"children":["Request Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Required"},"children":["Required"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["action"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["\"GetClientsDetails\""]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Required"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["clientid"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["int"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The client id to obtain the details for. $clientid or $email is required"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["email"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The email address of the client to search for"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["stats"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["bool"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Also return additional client statistics."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Optional"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"response-parameters","__idx":2},"children":["Response Parameters"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["result"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The result of the operation: success or error"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["client"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The information on the client."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["stats"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["array"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional statistics for the client returned."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-request-curl","__idx":3},"children":["Example Request (CURL)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, 'https://www.example.com/includes/api.php');\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS,\n    http_build_query(\n        array(\n            'action' => 'GetClientsDetails',\n            // See https://developers.whmcs.com/api/authentication\n            'username' => 'IDENTIFIER_OR_ADMIN_USERNAME',\n            'password' => 'SECRET_OR_HASHED_PASSWORD',\n            'clientid' => '1',\n            'stats' => true,\n            'responsetype' => 'json',\n        )\n    )\n);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n$response = curl_exec($ch);\ncurl_close($ch);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-request-local-api","__idx":4},"children":["Example Request (Local API)"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"$command = 'GetClientsDetails';\n$postData = array(\n    'clientid' => '1',\n    'stats' => true,\n);\n$adminUsername = 'ADMIN_USERNAME'; // Optional for WHMCS 7.2 and later\n\n$results = localAPI($command, $postData, $adminUsername);\nprint_r($results);\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example-response-json","__idx":5},"children":["Example Response JSON"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"{\n    \"result\": \"success\",\n    \"client\": {\n        \"client_id\": 1,\n        \"owner_user_id\": 1,\n        \"userid\": 1,\n        \"id\": 1,\n        \"uuid\": \"f08ea4d1-c578-441a-9b0a-aa3aff8b1acf\",\n        \"firstname\": \"Test\",\n        \"lastname\": \"Client\",\n        \"fullname\": \"Test Client\",\n        \"companyname\": \"\",\n        \"email\": \"test-client@example.com\",\n        \"address1\": \"123 Test Street\",\n        \"address2\": \"\",\n        \"city\": \"Test\",\n        \"fullstate\": \"Tester\",\n        \"state\": \"Tester\",\n        \"postcode\": \"TE5 5ST\",\n        \"countrycode\": \"GB\",\n        \"country\": \"GB\",\n        \"phonenumber\": \"01234567890\",\n        \"tax_id\": \"\",\n        \"email_preferences\": {\n            \"general\": \"1\",\n            \"invoice\": \"1\",\n            \"support\": \"1\",\n            \"product\": \"1\",\n            \"domain\": \"1\",\n            \"affiliate\": \"1\"\n        },\n        \"statecode\": \"Tester\",\n        \"countryname\": \"United Kingdom\",\n        \"phonecc\": \"44\",\n        \"phonenumberformatted\": \"+44.1234567890\",\n        \"telephoneNumber\": \"+44.1234567890\",\n        \"billingcid\": 0,\n        \"notes\": \"\",\n        \"currency\": 1,\n        \"defaultgateway\": \"\",\n        \"groupid\": 0,\n        \"status\": \"Active\",\n        \"credit\": \"0.00\",\n        \"taxexempt\": false,\n        \"latefeeoveride\": false,\n        \"overideduenotices\": false,\n        \"separateinvoices\": false,\n        \"disableautocc\": false,\n        \"emailoptout\": false,\n        \"marketing_emails_opt_in\": true,\n        \"overrideautoclose\": false,\n        \"allowSingleSignOn\": 1,\n        \"email_verified\": true,\n        \"language\": \"\",\n        \"isOptedInToMarketingEmails\": true,\n        \"lastlogin\": \"Date: 03\\/10\\/2016 10:26<br>IP Address:<br>Host:\",\n        \"currency_code\": \"USD\",\n        \"customfields\": [\n            {\n                \"id\": 1,\n                \"value\": \"Custom Field Value\"\n            }\n        ],\n        \"customfields1\": \"Custom Field Value\",\n        \"users\": {\n            \"user\": [\n                {\n                    \"id\": 1,\n                    \"name\": \"Testing User\",\n                    \"email\": \"testuser@whmcs.com\",\n                    \"is_owner\": true\n                }\n            ]\n        }\n    },\n    \"stats\": {\n        \"numdueinvoices\": 19,\n        \"dueinvoicesbalance\": \"$2645.80 USD\",\n        \"incredit\": false,\n        \"creditbalance\": \"$0.00 USD\",\n        \"grossRevenue\": \"$0.00 USD\",\n        \"expenses\": \"$0.00 USD\",\n        \"income\": \"$0.00 USD\",\n        \"numoverdueinvoices\": 19,\n        \"overdueinvoicesbalance\": \"$2645.80 USD\",\n        \"numDraftInvoices\": 0,\n        \"draftInvoicesBalance\": \"$0.00 USD\",\n        \"numunpaidinvoices\": 19,\n        \"unpaidinvoicesamount\": \"$2645.80 USD\",\n        \"numpaidinvoices\": 0,\n        \"paidinvoicesamount\": \"$0.00 USD\",\n        \"numcancelledinvoices\": 0,\n        \"cancelledinvoicesamount\": \"$0.00 USD\",\n        \"numrefundedinvoices\": 0,\n        \"refundedinvoicesamount\": \"$0.00 USD\",\n        \"numcollectionsinvoices\": 0,\n        \"collectionsinvoicesamount\": \"$0.00 USD\",\n        \"numpaymentpendinginvoices\": 0,\n        \"paymentpendinginvoicesamount\": \"$0.00 USD\",\n        \"productsnumactivehosting\": 0,\n        \"productsnumhosting\": 0,\n        \"productsnumactivereseller\": 0,\n        \"productsnumreseller\": 0,\n        \"productsnumactiveservers\": 0,\n        \"productsnumservers\": 0,\n        \"productsnumactiveother\": 2,\n        \"productsnumother\": 2,\n        \"productsnumactive\": 2,\n        \"productsnumtotal\": 2,\n        \"numactivedomains\": 2,\n        \"numdomains\": 2,\n        \"numacceptedquotes\": 0,\n        \"numquotes\": 0,\n        \"numtickets\": 0,\n        \"numactivetickets\": 0,\n        \"numaffiliatesignups\": 0,\n        \"isAffiliate\": false\n    }\n}\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"warning-responses","__idx":6},"children":["Warning Responses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Warning responses are returned when using API functionality that has been removed or marked as deprecated."," ","We suggest following any recommended actions in the warning to ensure future compatibility."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Possible warning messages include:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Credit Card related parameters are now deprecated and have been removed. Use GetPayMethods instead."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"error-responses","__idx":7},"children":["Error Responses"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Possible error condition responses include:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Either clientid Or email Is Required"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Client Not Found"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"version-history","__idx":8},"children":["Version History"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Version"},"children":["Version"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Changelog"},"children":["Changelog"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["1.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Initial Version"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["7.8"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Credit Card related parameters have been removed due to the introduction of support for multiple credit cards per client. Use GetPayMethods instead."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["7.10"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Added email preferences parameters"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["8.0"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Added users parameter"]}]}]}]}]}]},"headings":[{"value":"GetClientsDetails","id":"getclientsdetails","depth":1},{"value":"Request Parameters","id":"request-parameters","depth":3},{"value":"Response Parameters","id":"response-parameters","depth":3},{"value":"Example Request (CURL)","id":"example-request-curl","depth":3},{"value":"Example Request (Local API)","id":"example-request-local-api","depth":3},{"value":"Example Response JSON","id":"example-response-json","depth":3},{"value":"Warning Responses","id":"warning-responses","depth":3},{"value":"Error Responses","id":"error-responses","depth":3},{"value":"Version History","id":"version-history","depth":3}],"frontmatter":{"title":"GetClientsDetails","seo":{"title":"GetClientsDetails"}},"lastModified":"2026-08-03T17:00:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/api-reference/getclientsdetails","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}