Jump to content

[Help] Add Custom Fields Through API


Mahmudul

Recommended Posts

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated