# Domain pricing

Read cart pricing for registering, renewing, or transferring a specific domain.

Return the price a specific domain would cost to register, renew, or transfer, broken down by billing cycle.

`GET /order/pricing/domains/{type}`

The `{type}` path segment selects the operation: `register`, `renew`, or `transfer`. Prices are returned per billing cycle and reflect the currency configured on your reseller account.

## Parameters

<ParamField path="type" type="text" required>
  The pricing operation: `register`, `renew`, or `transfer`.
</ParamField>

<ParamField query="domain" type="text" required>
  The full domain to price, for example `hostraha-test-9931.com`.
</ParamField>

## Request

The example below reads register pricing. For renewal or transfer pricing, change the `{type}` segment to `renew` or `transfer` — the parameters and response shape are identical.

<CodeGroup>
```bash cURL
API_KEY="your-api-key"
EMAIL="you@example.com"
ENDPOINT="https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"
TS=$(date -u +"%y-%m-%d %H")
TOKEN=$(printf '%s' "$API_KEY" \
  | openssl dgst -sha256 -hmac "$EMAIL:$TS" -hex \
  | sed 's/^.*= //' | tr -d '\n' | base64 -w0)

curl -s "$ENDPOINT/order/pricing/domains/register?domain=hostraha-test-9931.com" \
  -H "username: $EMAIL" \
  -H "token: $TOKEN"
```

```php PHP
<?php
$apiKey   = "your-api-key";
$email    = "you@example.com";
$endpoint = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php";

$token = base64_encode(hash_hmac("sha256", $apiKey, "{$email}:" . gmdate("y-m-d H")));

$query = http_build_query(["domain" => "hostraha-test-9931.com"]);
$curl  = curl_init();
curl_setopt($curl, CURLOPT_URL, "{$endpoint}/order/pricing/domains/register?{$query}");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, [
    "username: {$email}",
    "token: {$token}",
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

```python Python
from datetime import datetime, timezone

API_KEY  = "your-api-key"
EMAIL    = "you@example.com"
ENDPOINT = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"

def token() -> str:
    ts = datetime.now(timezone.utc).strftime("%y-%m-%d %H")
    digest = hmac.new(f"{EMAIL}:{ts}".encode(), API_KEY.encode(), hashlib.sha256).hexdigest()
    return base64.b64encode(digest.encode()).decode()

resp = requests.get(
    f"{ENDPOINT}/order/pricing/domains/register",
    headers={"username": EMAIL, "token": token()},
    params={"domain": "hostraha-test-9931.com"},
)
print(resp.json())
```

```javascript Node.js

const API_KEY  = "your-api-key";
const EMAIL    = "you@example.com";
const ENDPOINT = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php";

function token() {
  const ts = new Date().toISOString().slice(2, 13).replace("T", " "); // "yy-mm-dd HH" UTC
  const digest = crypto.createHmac("sha256", `${EMAIL}:${ts}`).update(API_KEY).digest("hex");
  return Buffer.from(digest, "utf8").toString("base64");
}

const url = `${ENDPOINT}/order/pricing/domains/register?domain=hostraha-test-9931.com`;
const res = await fetch(url, {
  headers: { username: EMAIL, token: token() },
});
console.log(await res.json());
```

```go Go
package main

	"crypto/hmac"
	"crypto/sha256"
	"encoding/base64"
	"encoding/hex"
	"fmt"
	"io"
	"net/http"
	"time"
)

const (
	apiKey   = "your-api-key"
	email    = "you@example.com"
	endpoint = "https://portal.hostraha.com/modules/addons/DomainsReseller/api/index.php"
)

func token() string {
	ts := time.Now().UTC().Format("06-01-02 15") // yy-mm-dd HH
	mac := hmac.New(sha256.New, []byte(email+":"+ts))
	mac.Write([]byte(apiKey))
	return base64.StdEncoding.EncodeToString([]byte(hex.EncodeToString(mac.Sum(nil))))
}

func main() {
	req, _ := http.NewRequest("GET", endpoint+"/order/pricing/domains/register?domain=hostraha-test-9931.com", nil)
	req.Header.Set("username", email)
	req.Header.Set("token", token())
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	body, _ := io.ReadAll(resp.Body)
	fmt.Println(string(body))
}
```
</CodeGroup>

## Response

The response is a single pricing object. Setup-fee fields (`msetupfee`…`tsetupfee`) hold the one-time fee for each cycle, and the cycle fields (`monthly`…`triennially`) hold the recurring price for that cycle. A value of `-1.00` means the cycle is not offered for this operation.

### Register

```json
{
  "id": 3423,
  "type": "domainregister",
  "currency": 1,
  "relid": 1,
  "msetupfee": "10.00",
  "qsetupfee": "25.00",
  "ssetupfee": "38.00",
  "asetupfee": "50.00",
  "bsetupfee": "63.00",
  "tsetupfee": "0.00",
  "monthly": "75.00",
  "quarterly": "88.00",
  "semiannually": "100.00",
  "annually": "113.00",
  "biennially": "125.00",
  "triennially": "0.00"
}
```

### Renew

```json
{
  "id": 3424,
  "type": "domainrenew",
  "currency": 1,
  "relid": 1,
  "msetupfee": "12.00",
  "qsetupfee": "25.00",
  "ssetupfee": "38.00",
  "asetupfee": "50.00",
  "bsetupfee": "63.00",
  "tsetupfee": "0.00",
  "monthly": "75.00",
  "quarterly": "88.00",
  "semiannually": "100.00",
  "annually": "113.00",
  "biennially": "-1.00",
  "triennially": "0.00"
}
```

### Transfer

```json
{
  "id": 3425,
  "type": "domaintransfer",
  "currency": 1,
  "relid": 1,
  "msetupfee": "12.00",
  "qsetupfee": "-1.00",
  "ssetupfee": "-1.00",
  "asetupfee": "-1.00",
  "bsetupfee": "-1.00",
  "tsetupfee": "0.00",
  "monthly": "-1.00",
  "quarterly": "-1.00",
  "semiannually": "-1.00",
  "annually": "-1.00",
  "biennially": "-1.00",
  "triennially": "0.00"
}
```

### Fields

<ResponseField name="id" type="number">
  Internal identifier for the pricing record.
</ResponseField>

<ResponseField name="type" type="string">
  The operation this pricing applies to: `domainregister`, `domainrenew`, or `domaintransfer`.
</ResponseField>

<ResponseField name="currency" type="number">
  Identifier of the currency the prices are quoted in.
</ResponseField>

<ResponseField name="relid" type="number">
  Related product or TLD identifier.
</ResponseField>

<ResponseField name="msetupfee" type="string">
  One-time setup fee for the monthly cycle.
</ResponseField>

<ResponseField name="qsetupfee" type="string">
  One-time setup fee for the quarterly cycle.
</ResponseField>

<ResponseField name="ssetupfee" type="string">
  One-time setup fee for the semiannual cycle.
</ResponseField>

<ResponseField name="asetupfee" type="string">
  One-time setup fee for the annual cycle.
</ResponseField>

<ResponseField name="bsetupfee" type="string">
  One-time setup fee for the biennial cycle.
</ResponseField>

<ResponseField name="tsetupfee" type="string">
  One-time setup fee for the triennial cycle.
</ResponseField>

<ResponseField name="monthly" type="string">
  Recurring price for the monthly cycle. `-1.00` means the cycle is not offered.
</ResponseField>

<ResponseField name="quarterly" type="string">
  Recurring price for the quarterly cycle. `-1.00` means the cycle is not offered.
</ResponseField>

<ResponseField name="semiannually" type="string">
  Recurring price for the semiannual cycle. `-1.00` means the cycle is not offered.
</ResponseField>

<ResponseField name="annually" type="string">
  Recurring price for the annual cycle. `-1.00` means the cycle is not offered.
</ResponseField>

<ResponseField name="biennially" type="string">
  Recurring price for the biennial (two-year) cycle. `-1.00` means the cycle is not offered.
</ResponseField>

<ResponseField name="triennially" type="string">
  Recurring price for the triennial (three-year) cycle. `-1.00` means the cycle is not offered.
</ResponseField>

For per-TLD list pricing across every supported currency, see [TLDs](/api-reference/tlds). Placing an order charges your reseller credits — see [Credits and billing](/guides/credits-and-billing).
