Jump to content

API:Add Order:customfields How?


Klangaroo

Recommended Posts

How exactly do you parse an array to the customfields parameter in the API's "Add Order" action?

 

I have these fields I need for people registering .com.au domains, in the MySQL database they are called:

Registrant Name

Registrant ID

Registrant ID Type

Eligibility Name

Eligibility ID

Eligibility ID Type

Eligibility Type

Eligibility Reason

 

So anyway I tried this:

$postfields["customfields"] = base64_encode(serialize(array("1"=>$_POST['domainfield_0'], "2"=>$_POST['domainfield_1'], "3"=>$_POST['domainfield_2'], "4"=>$_POST['domainfield_3'], "5"=>$_POST['domainfield_4'], "6"=>$_POST['domainfield_5'], "7"=>$_POST['domainfield_6'], "8"=>$_POST['domainfield_7'])));

 

but it didnt parse anything, so I tried actually manually entering the array item names, like this:

$postfields["customfields"] = base64_encode(serialize(array("Registrant Name"=>$_POST['domainfield_0'])));

and that didn't work either, what am I meant to do?

Link to comment
Share on other sites

  • 8 months later...

Figure out the id of the custom field and that is what the *number* should be.

 

So say it is '2', then "2"=>$_POST['some_value']

 

I had to go to product config page and look at the html for the custom field to figure out the id for it.

 

Hope this helps.

Link to comment
Share on other sites

  • 1 year later...

$postfields["domainfields"] = base64_encode(serialize(array("0"=>"RegName","1"=>"RegId123","2"=>"ACN","3"=>"EligName","4"=>"EligID123","5"=>"VIC Business Number","6"=>"Registered Business","7"=>"Domain name is an Exact Match Abbreviation or Acronym of your Entity or Trading Name.")));

 

Well I hope this helps out there, as I see many people have asked, and not one has given an example nor result.

 

Good luck to you all.

 

If anyone finds out how to add Registrar via API, please let me know.

 

:)

 

Jay

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