Jump to content

Custom API "gettldprices"


Recommended Posts

Hi,

 

Made this custom API call to return TLD prices. it include price slabs as well as categories for each tld.

 

Example:

 

Request:

array('action' => 'gettldprices', 'slabs' => array('Domain Volume Discount'))

 

Response:

Array
(
   [result] => success
   [tlds] => Array
       (
           [.com] => Array
               (
                   [prices] => Array
                       (
                           [domainregister] => 14.99
                           [domaintransfer] => 14.99
                           [domainrenew] => 14.99
                       )

                   [slabs] => Array
                       (
                           [Domain Volume Discount] => Array
                               (
                                   [domainregister] => 9.99
                                   [domaintransfer] => 9.99
                                   [domainrenew] => 9.99
                               )

                       )

                   [categories] => Array
                       (
                           [0] => gTLD
                           [1] => Popular
                       )

               )
     )
);

 

The way the domain price slabs work is with client groups. So if you want the API to return them you need to add the parameter "slabs". If you are passing a querystring it needs to be in the following format: "slabs[]=Group Name 1&slabs[]=Group Name 2". Ofcourse you need to have a client group with that specific name and have activated the domain price slab for some tlds.

 

You can also pass the parameter "categories" to retrieve only specified TLDs within those categories. If you are passing a querystring it needs to be in the following format: "categories[]=ccTLD&categories[]=Shopping".

 

Thats it!

gettldprices.zip

Link to comment
Share on other sites

  • 4 months later...

Thank you for this, I was unaware that you could write your own API's for WHMCS. There are three in particular I need to write as WHMCS does not have them:

 

- Get tax rates

- Get boolean if product is taxable

- Get if clients country is taxable

 

Your add-on will give me a great starting point.

Link to comment
Share on other sites

  • 2 months 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