Register Domain

To register domain you must send POST Request to https://globalr.com/api/domain

For domain registration you must send 3 type contacts, minimum 2 unique valid name server, domain name, and optional registration period in year (by default year is equiwalent to 1);

Contact model

{
    "name": "string",
    "surname": "string",
    "organisation": "string (Optional)",
    "email": "string",
    "phone":  "string (/^\+?[^a-zA-Z]{5,}$/)",
    "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
    "fax": "string  (Optional)",
    "country": "string (Country code or Name)",
    "city": "string",
    "state": "string",
    "address": "string",
    "address2": "string  (Optional)",
    "zip": "number",
}

NS model

{
    "name": "string",
    "ip": "string (Optional)"
}

Additional Fields

{
    "_domainName-additionalField": "string/boolean"
}

Attention

Please, check domains additional fields Additional Fields.

Domain registration request model

{
  "name": "string",
  "periods": "int (optional)",
  "contacts": {
    "owner": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",

    },
    "admin": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",

    },
    "billing": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",

    }"technical": {
      "name": "string",
      "surname": "string",
      "organisation": "string (Optional)",
      "email": "string",
      "phone": "string (/^\+?[^a-zA-Z]{5,}$/)",
      "mobile_phone": "string (/^\+?[^a-zA-Z]{5,}$/) (Optional)",
      "fax": "string  (Optional)",
      "country": "string (Country code or Name)",
      "city": "string",
      "state": "string",
      "address": "string",
      "address2": "string  (Optional)",
      "zip": "number",

    }
  }"ns":
  [
    {
      "ns1name": "string",
      "ns1ip": "string (Optional)",

    },
    {
      "name": "string",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",

    },
    {
      "name": "string (Optional)",
      "ip": "string (Optional)",
    }
  ],
  "_am-privacy":"boolean(optional, only for am)"
}

Test request in php for domain create

<?php
    $contact = array(
        'name' => "Jhone",
        'surname' => "Smith",
        'email' => "smith@gmail.com",
        'phone' => "+37455555555",
        'country' => "US",
         'city' => "New York",
        'address' => "Example Street",
        'zip' => "001110"
    );
    $domainModel = [
        'name' => 'test-for-globalr.am',
        'periods' => 2,
        'contacts' => [
            'owner' => $contact,
            'admin' => $contact,
            'billing' => $contact,
            'technical' => $contact,
        ],
        'ns' => [
            ['name'=>'ns1.globalr.com'],
            ['name'=>'ns2.globalr.com'],

        ],
        "_am-privacy"=>1
    ];
    $resault = sendToGlobalR($domainModel, 'POST', '/domain', 'xXGsvO26ntTHTESTKEYSOICKu8nOvMzKKiwg');
    $domain = json_decode($resault);

Example response

{
  "status": 201,
  "textStatus": "completed",
  "message": "Domain\/s registered Successfully",
  "errors": [

  ]
}

Available status codes

  • Status: 200 - success
  • Status: 201 - completed
  • Status: 402 - Payment Required
  • Status: 422 - invalid data (in this case field will be provided in errors array)
  • Status: 500 - Internal Error

Example error response

{
  "status": 422,
  "textStatus": "invalid data",
  "errors": {
    "contacts": {
      "owner": {
        "country": "country in owner contact was incorrect",
        "address": "address in owner contact was incorrect",
        "zip": "zip in owner contact was incorrect",
        "name": "name in owner contact was incorrect",
        "surname": "surname in owner contact was incorrect"
      },
      "admin": {
        "country": "country in admin contact was incorrect",
        "address": "address in admin contact was incorrect",
        "zip": "zip in admin contact was incorrect",
        "name": "name in admin contact was incorrect",
        "surname": "surname in admin contact was incorrect",
        "email": "email in admin contact was incorrect",
        "phone": "phone in admin contact was incorrect"
      },
      "billing": {
        "country": "country in billing contact was incorrect",
        "address": "address in billing contact was incorrect",
        "zip": "zip in billing contact was incorrect",
        "name": "name in billing contact was incorrect",
        "surname": "surname in billing contact was incorrect",
        "email": "email in billing contact was incorrect",
        "phone": "phone in billing contact was incorrect"
      },
      "technical": {
        "country": "country in technical contact was incorrect",
        "address": "address in technical contact was incorrect",
        "zip": "zip in technical contact was incorrect",
        "name": "name in technical contact was incorrect",
        "surname": "surname in technical contact was incorrect",
        "email": "email in technical contact was incorrect",
        "phone": "phone in technical contact was incorrect"
      }
    },
    "names": {
      "massage": "Please provide domain names to register",
      "status": 422
    },
    "ns": "Please provide ns for domain\/s"
  }
}