Jump to content

help on how to pass an additional field for Domain registration pass through Domain Reseller API


Go to solution Solved by Aiman H,

Recommended Posts

Hello all,

I need your help on how to pass an additional field for Domain registration pass through Domain Reseller API

He have an additional field called ( IDCard ) ; an extension to Registrant contact and we need to let our reseller to get the data sent by him in order to create the registrant contact while registering a new domain name.

 

As you know the Domain Reseller API is like this

 

$endpoint   = "https://whmcs.example.com/modules/addons/DomainsReseller/api/index.php";
$action     = "/order/domains/renew";
$params     = [
    "domain"    => "example.com",
    "regperiod" => "3",
    "addons"    => [
        "dnsmanagement"     => 0,
        "emailforwarding"   => 1,
        "idprotection"      => 1,
    ]
];
$headers = [
    "username: email@example.com",
    "token: ". base64_encode(hash_hmac("sha256", "1234567890QWERTYUIOPASDFGHJKLZXCVBNM", "email@example.com:".gmdate("y-m-d H")))
];

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "{$endpoint}{$action}");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($curl);
curl_close($curl);

the reseller try to send an API request like this

 

{"action":"RegisterDomain","request":{"type":"register","domain":"exemple.ctld","nameservers":{"ns1":"ns1.dondominio.com","ns2":"ns2.dondominio.com"},"addons":{"dnsmanagement":"0","emailforwarding":"0","idprotection":"0"},"contacts":{"registrant":{"firstname":"My First","lastname":"Last","address1":"Your address","city":"City","postcode":"04711","state":"New York","country":"US","email":"example@gmail.com","phonenumber":"12465567578","IDCard":"45592437C"},"admin":{"firstname":"My First","lastname":"Last","address1":Address","city":"City","postcode":"04711","state":"NY","country":"US","email":"example@gmail.com","phonenumber":"12465567578","IDCard":"45592437C"},"billing":{"firstname":"My First","lastname":"Last","address1":"Address","city":"City","postcode":"04711","state":"City","country":"US","email":"example@gmail.com","phonenumber":"12465567578","IDCard":"45592437C"},"tech":{"firstname":"My First","lastname":"Last","address1":"Adress","city":"City","postcode":"04711","state":"City","country":"US","email":"example@gmail.com","phonenumber":"12465567578","IDCard":"45592437C"},"IDCard":"45592437C","idcard":"45592437C"},"idcard":"45592437C","idcard":"45592437C","regperiod":"1"}}

and he got an error 

 

{"response":{"message":"Registrar Error: RegisterDomain\/domain-create(example.cctld): Code (2306) Parameter value policy error; Registrant must have a National ID, Please use Contact Update extension or Web Portal to add the required ID for the registrant contact.","data":null},"message_base":"RegisterDomain"}

 

Edited by Aiman H
add code
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