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
Standard request parameters
- action = get_price
- object = domain
Request attributes
Parameters within the attributes associative array are described below:
Parameter | Obligation | Definition/Value |
---|---|---|
domain | Required | The domain to be queried. |
period | Required | The desired registration period, default is 1. |
all_periods | Optional | Return prices for all available periods. Accepted values are, 1 or 0. |
reg_type | Optional | The type of registration. Allowed values are: new—(default) renewal transfer trade |
Response parameters
Standard response parameters
- action = reply
- object = domain
- is_success = Boolean 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.
Response attributes
If the request is successful, the attributes associative array may include the following:
Parameter | Obligation | Definition/Value |
---|---|---|
price | Always returned | The price of the queried domain. This value includes the OpenSRS price and the ICANN fee. |
prices | Returned if all_periods=1 | An array containing the prices for all available periods. This value includes the OpenSRS price and the ICANN fee. |
is_registry_premium | Returned only for premium domains | Indicates whether the domain is a registry premium. |
registry_premium_group | Returned only for premium domains | Indicates the type of registry premium domain, for more information, see our help article. |
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.
3. 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.
Examples
Example 1: Standard domain
<?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>
<?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>
Example 2: Premium domain
<?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>
<?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>
<?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>
Updated almost 2 years ago