Robert Stone

NAME WWW::LogicBoxes - Interact with LogicBoxes Reseller API


    use strict;
    use warnings;
    use WWW::LogicBoxes;

    my $logic_boxes = WWW::LogicBoxes->new({
        username        => "resellid",

        # You may specify a password OR an apikey
        password        => "resellpw",
        apikey      => "apikey",

        response_type => "xml",
        sandbox           => 1

    my $response = $logic_boxes->domains__available({
        'domain-name'   => ["google", "cnn"],
        'tlds'          => ["com","net"]
    } );



Constructs a new object for interacting with the LogicBoxes API. If the "sandbox" parameter is specified then the API calls are made against the LogicBoxes test server instead of the production server.

response_type is also an object argument that dictates the format in which the responses from LogicBoxes' API will be in. The default is XML, all supported protocols are:

  • xml

  • json

  • xml_simple

Suggest Domains (and many others)

    my $response = $logic_boxes->domains__suggest_names({
        'keyword'       => 'car',
        'tlds'          => ['com', 'net', 'org'],
        'no-of-results' => 10,
        'hypehn-allowed'=> 'false',
        'add-related'   => 'true',

This module implements all of the API methods available using the LogicBoxes API by abstracting out the need to specify the HTTP method (POST or GET) and automagically building the request URI according to the documentation provided by Logic Boxes (see the Logic Boxes API user guide at To fully understand the method names it's best to take a specific example (in this case the suggestion of domain names).

Logic Boxes' API states that this method is part of their HTTP API, specifically the Domain Category and more specifically the Suggest Names method. The sample URI for this request would then be:

The method name is built using the URI that the request is expected at in a logical way. Since this method is a member of the Domains Category and is specifically Suggest Names we end up:


Where everything before the first "__" is the category and everything following it is the specific method (with - replaced with _ and / replaced with __).

Arguments Passed to Methods

The specific arguments each method requires is not enforced by this module, rather I leave it to the developer to reference the LogicBoxes API (again at and to pass the correct arguments to each method as a hash. There are two "odd" cases that you should be aware of with respect to the way arguments must be passed.

Repeated Elements

For methods such as domains__check that accept the same "key" multiple times:

This module accepts a hash where the key is the name of the argument (such as domain-name) and the value is an array of values you wish to pass:

        'domain-name'   => ["google", "cnn"],
        'tlds'          => ["com","net"]

This is interpreted for you automagically into the repeating elements when the API's URI is built.

Array of Numbered Elements

For methods such as contacts__set_details that accep the same key multiple times except an incrementing digit is appended:

This module still accepts a hash and leaves it to the developer to handle the appending of the incrementing digit to the keys of the hash:

        'contact-id'    => 1337,
        'attr-name1'    => 'sponsor',
        'attr-value1'   => '0',
        'attr-name2'    => 'CPR',
        'attr-value2'   => 'COO',
        'product-key'   => 'dotcoop'

In this way you are able to overcome the need for unique keys and still pass the needed values onto LogicBoxes' API.


Robert Stone, <drzigman AT cpan DOT org >


Thanks to Richard Simoes for his assistance in putting this module together and for writing the WWW::eNom module that much of this is based on. Also thanks to for funding the development of this module and providing test resources.


Copyright 2012 Robert Stone This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU Lesser General Public License as published by the Free Software Foundation; or any compatible license.

See for more information.