API: OpenSRS

OpenSRS API Guide: Domains and SSL

Welcome to the OpenSRS API guide. Here you will find comprehensive documentation regarding our domain and SSL services. We hope this guide will help you start working with OpenSRS as quickly as possible. If you have any questions or concerns, please do not hesitate to contact help@opensrs.com

Get Started

get_price

Queries the price of a domain, and can be used to determine the cost of a
billable transaction for any TLD. A returned price for a given domain does not
guarantee the availability of the domain, but indicates that the requested
action is supported by the system and calculates the cost to register the
domain (if available).

Request parameters for get_price

Standard parameters

  • action = get_price
  • object = domain

Attributes

Parameters within the attributes associative array are described below.

Parameter name
Obligation
Definition/Value

domain

Required

The domain to be queried.

period

Optional

The desired registration period. The default is 1.

reg_type

Optional

The type of registration.

Allowed values are new, renewal, and trade. The default is new.

Response parameters for get_price

Standard parameters

  • action = reply
  • object = domain
  • is_success = a Boolean is returned, indicating success or failure of the
    request
  • response_code = response code indicating outcome of the request
  • response_text = message describing the outcome of the request

Attributes

If the request is successful, the attributes associative array may include the
following:

Parameter name
Obligation
Definition/Value

price

Returned if is_success =
true

The price of the queried domain. This value includes
the OpenSRS price and the ICANN fee.

Domain = Registry Premium

Note:

A value for is_registry_premium will only be returned if:

  1. The domain is registry premium
  2. The registry premium tier into which the domain falls is enabled in the reseller's account

The accurate price for the domain will always be returned, regardless of whether or not the premium tier into which the domain falls is enabled.

Parameter name
Obligation
Definition/Value

is_registry_premium

Returned if is_success =
true

Indicates whether the domain is a registry premium.

Possible value is:
1 = yes

price

Returned if in the request, the value for period = 1.

The price of the queried domain for a 1-year registration period. This value includes
the OpenSRS price and the ICANN fee.

prices

Returned if, in the request, the value for period = >1.

The price of the queried domain for the registration period indicated in the request. This value includes
the OpenSRS price and the ICANN fee.

Examples for get_price

Request

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">GET_PRICE</item>
                <item key="object">DOMAIN</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="domain">example.com</item>
                        <item key="period">1</item>
                        <item key="reg_type">new</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>

Response

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">REPLY</item>
                <item key="object">DOMAIN</item>
                <item key="is_success">1</item>
                <item key="response_code">200</item>
                <item key="response_text">Command Successful</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="price">20.2</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>

Examples for get_price for Registry Premium Domains

Example 1

In this example, the price for a single 1-year period is being queried.

Request

<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="action">GET_PRICE</item>
    <item key="attributes">
     <dt_assoc>
      <item key="domain">restful.blue</item>
      <item key="period">1</item>
      <item key="reg_type">new</item>
     </dt_assoc>
    </item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>

Response

<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="response_text">Command Successful</item>
    <item key="action">REPLY</item>
    <item key="attributes">
     <dt_assoc>
      <item key="registry_premium_group">2</item>
      <item key="price">83.99</item>
      <item key="is_registry_premium">1</item>
     </dt_assoc>
    </item>
    <item key="response_code">200</item>
    <item key="is_success">1</item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>

Example 2

In this example, the price for all periods is being queried.

Request

<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="action">GET_PRICE</item>
    <item key="attributes">
     <dt_assoc>
      <item key="domain">restful.blue</item>
      <item key="period">1</item>
      <item key="reg_type">new</item>
      <item key="all_periods">1</item>
     </dt_assoc>
    </item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>

Response

<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="response_text">Command Successful</item>
    <item key="action">REPLY</item>
    <item key="attributes">
     <dt_assoc>
      <item key="registry_premium_group">2</item>
      <item key="price">83.99</item>
      <item key="is_registry_premium">1</item>
      <item key="prices">
       <dt_assoc>
        <item key="6">503.93</item>
        <item key="3">251.96</item>
        <item key="7">587.92</item>
        <item key="9">755.89</item>
        <item key="2">167.98</item>
        <item key="8">671.90</item>
        <item key="1">83.99</item>
        <item key="4">335.95</item>
        <item key="10">839.88</item>
        <item key="5">419.94</item>
       </dt_assoc>
      </item>
     </dt_assoc>
    </item>
    <item key="response_code">200</item>
    <item key="is_success">1</item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>

get_price


Queries the price of a domain, and can be used to determine the cost of a
billable transaction for any TLD. A returned price for a given domain does not
guarantee the availability of the domain, but indicates that the requested
action is supported by the system and calculates the cost to register the
domain (if available).

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.