Jump to content

Customfield api problem


mramos

Recommended Posts

Hi

 

I'm using the whmcs (5.2.3) api and everything it's ok, but i have a few problems with the customfield, for example when i try with addclient action

 

I have a few customfields (Not Required Field) as "Condicion de IVA"

 

The first problem

When i try to add client without customfields i receive error

 

INPUT

 

Array

(

[username] => XXXXX

[password] => XXXXX

[action] => addclient

[firstname] => Jose Maria 3333

[lastname] => Alonso0001

[companyname] => Ingreso API 22

=> jl2133pejjj88wwjz1@picoypala.com.ar

[address1] => 123 Demo Street

[city] => Demo

[state] => Florida

[postcode] => AB123

[country] => AR

[phonenumber] => 123456789

[password2] => demo

[currency] => 3

[language] => Spanish

)

 

OUTPUT

 

 

<?xml version="1.0" encoding="utf-8"?>

<whmcsapi version="5.2.3">

<action>addclient</action>

<result>error</result>

<message><![CDATA[Condicion de IVA Invalid Select Option</li>]]></message>

</whmcsapi>

 

 

---------------------------------------

 

2nd Problem

 

When i try to add the same data with customfield i receive the same error

 

In the script i use the following line

$postfields["customfields"] = base64_encode(serialize(array("1"=>"Google","15"=>"Monotributo","5"=>"0001")));

 

All the id of customfields are ok and the values of the custom fields are valid.

In the frontend the customfields are ok.

 

INPUT

 

(

[username] => XXXXXX

[password] => XXXXXX

[action] => addclient

[firstname] => Jose Maria 3333

[lastname] => Alonso0001

[companyname] => Ingreso API 22

=> jl2133pejjj88wwjz1@picoypala.com.ar

[address1] => 123 Demo Street

[city] => Demo

[state] => Florida

[postcode] => AB123

[country] => AR

[phonenumber] => 123456789

[password2] => demo

[customfields] => YTozOntpOjE7czo2OiJHb29nbGUiO2k6MTU7czoxMToiTW9ub3RyaWJ1dG8iO2k6NTtzOjQ6IjAwMDEiO30=

[currency] => 3

[language] => Spanish

)

 

OUTPUT

 

 

<?xml version="1.0" encoding="utf-8"?>

<whmcsapi version="5.2.3">

<action>addclient</action>

<result>error</result>

<message><![CDATA[Condicion de IVA Invalid Select Option</li>]]></message>

</whmcsapi>

 

 

 

Considerations

If I delete the custom field Condicion de IVA the scripts its fine

If I change the custom field Condicion de IVA to the string (not DROPDONW) work ok.

In the previous version 5.1. the script work fine.

 

Tks

 

Martin

Link to comment
Share on other sites

  • 3 weeks later...

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