Mahmudul Posted September 24, 2011 Share Posted September 24, 2011 I have been trying to add custom fields through the API. I tried the below code but it didn't add any custom values. I tried the sample code from WHMCS API. Here are the post fields: $postfields["action"] = "addclient"; $postfields["firstname"] = "Test"; $postfields["lastname"] = "User"; $postfields["companyname"] = "WHMCS"; $postfields["email"] = "demo@whmcs.com"; $postfields["address1"] = "123 Demo Street"; $postfields["city"] = "Demo"; $postfields["state"] = "Florida"; $postfields["postcode"] = "AB123"; $postfields["country"] = "US"; $postfields["phonenumber"] = "123456789"; $postfields["password2"] = "demo"; $postfields["currency"] = "1"; $customfields = array( 'CUSTOMFIELDS1' => "127.0.0.1", 'CUSTOMFIELDS2' => "localhost" ); $postfields["customfields"] = base64_encode(serialize($customfields)); [CLIENT] => Array ( [uSERID] => 35 [iD] => 35 [FIRSTNAME] => Test [LASTNAME] => User [COMPANYNAME] => WHMCS => demo@whmcs.com [ADDRESS1] => 123 Demo Street [ADDRESS2] => [CITY] => Demo [sTATE] => Florida [postCODE] => AB123 [COUNTRY] => US [COUNTRYNAME] => United States [PHONENUMBER] => 123456789 [NOTES] => [PASSWORD] => ee61ea3aa1706328bcf73fb3b10f0defKjMa [CURRENCY] => 1 [CCTYPE] => [CCLASTFOUR] => [sECURITYQID] => 0 [sECURITYQANS] => [GROUPID] => 0 [sTATUS] => Active [CREDIT] => 0.00 [TAXEXEMPT] => [LATEFEEOVERIDE] => [OVERIDEDUENOTICES] => [sEPARATEINVOICES] => [DISABLEAUTOCC] => [LANGUAGE] => [LASTLOGIN] => Date: 22/09/2011 13:32<br>IP Address: 205.251.135.186<br>Host: webhostingbuzz.com [CUSTOMFIELDS1] => [CUSTOMFIELDS2] => [bILLINGCID] => 0 [CURRENCY_CODE] => GBP ) Can anybody help? This is just a way what I found to add it. It might be wrong. Can anybody help me the exact procedure to it. Thanks in advance. Mahmudul -Mahmudul 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.