# Quickstart

Activate reseller access, authenticate, check availability, and register your first domain.

This guide takes you from reseller activation to your first domain registration. Each step includes a runnable cURL example that computes the hourly authentication token inline.

<Steps>
  <Step title="Order and activate reseller access">
    Order the Domain Reseller module from the store, verify your account email, then open the Reseller Area and copy your API key. Follow [Order and activate reseller access](/guides/ordering-and-activation) for the full walkthrough.

    You need three values from **Settings → API Details**: the API URL (the endpoint), your API Email Address (your username), and your API Key.
  </Step>
  <Step title="Authenticate">
    Every request sends two headers: `username` (your reseller email) and `token` (an HMAC-SHA256 value that changes each UTC hour). See [Authentication](/guides/authentication) for the token formula and snippets in five languages.

    Confirm your credentials work by reading the API version:

    ```bash
    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/version" \
      -H "username: $EMAIL" \
      -H "token: $TOKEN"
    ```

    ```json
    "2.3.0"
    ```

    <Check>
      A `"2.3.0"`-style version string means your headers are valid.
    </Check>
  </Step>
  <Step title="Check availability">
    Look up a domain with `POST /domains/lookup`. Pass the search term and the TLDs to include.

    ```bash
    curl -s "$ENDPOINT/domains/lookup" \
      -H "username: $EMAIL" \
      -H "token: $TOKEN" \
      --data "searchTerm=hostraha-demo-42" \
      --data "tldsToInclude[]=.com"
    ```

    ```json
    {
      "domainName": "hostraha-demo-42.com",
      "tld": "com",
      "sld": "hostraha-demo-42",
      "status": "available for registration",
      "legacyStatus": "available",
      "isRegistered": false,
      "isAvailable": true,
      "isValidDomain": true,
      "isPremium": false
    }
    ```

    See [Check availability](/api-reference/availability) for every field.
  </Step>
  <Step title="Register the domain">
    Order the domain with `POST /order/domains/register`. Registration requires `regperiod`, `nameservers`, and a full set of `contacts`. See [Register a domain](/api-reference/register) for the complete body.

    ```bash
    curl -s "$ENDPOINT/order/domains/register" \
      -H "username: $EMAIL" \
      -H "token: $TOKEN" \
      --data "domain=hostraha-demo-42.com" \
      --data "regperiod=1" \
      --data "nameservers[ns1]=ns1.hostraha.com" \
      --data "nameservers[ns2]=ns2.hostraha.com" \
      --data "contacts[registrant][firstname]=Jane" \
      --data "contacts[registrant][lastname]=Doe" \
      --data "contacts[registrant][email]=you@example.com"
    ```

    ```json
    "success"
    ```

    A `"success"` response charges your reseller credits and creates the order. The domain provisions to your account once the account and order are active. Until then, management endpoints return a `403` "not found in reseller account". See [Credits and billing](/guides/credits-and-billing).
  </Step>
</Steps>

## Next steps

<Columns cols={2}>
  <Card title="Manage the domain" href="/api-reference/information">
    Update contacts, nameservers, DNS, and the registrar lock.
  </Card>
  <Card title="Handle errors" href="/guides/errors">
    Understand the status codes and response shapes you will see.
  </Card>
</Columns>
