# Setup domain pricing on PNLCS

> **Writer's brief**
> - **Audience:** a reseller who wants to sell domains (.com, .co.ke...) at their own prices.
> - **Promise:** "Sell domains under your brand, at your prices, registered automatically through Truehost."
> - **Keywords:** sell domains reseller Kenya, domain pricing PNLCS, Truehost domain reseller API, .co.ke reseller.
> - **Call to action:** search for a domain on your own site.
> - **Idea:** a short "how much margin can I make?" table (cost vs. your price), with prices from the reseller's own price list.

Selling domains takes three things: a **registrar** that registers the names
(Truehost, through your reseller account), a **price** for each extension, and
**money in your reseller balance**.

**You need:** your Truehost Domains Reseller API details and a topped-up
balance. See [Before you start](00-before-you-start.md#domains-truehost-domains-reseller-api).

## Step 1: switch on the Truehost registrar

1. Go to **Setup → Modules** and **enable** Truehost (listed as a registrar).
2. Go to **Setup → Domain Registrars → Truehost**, tick **Enable**, and enter:

| Field | What to enter |
|---|---|
| **Truehost Client Area Site** | The Truehost site where your reseller account is, e.g. `truehost.co.ke`. The address is enough |
| **API Username** | The email you log in to that site with |
| **API Key** | From that site's client area → **Domains Reseller** → **API settings** |
| **Default Nameservers 1–5** | The nameservers new domains get when the customer gives none. Leave the pre-filled Truehost ones, or use your own: see [Custom nameservers](05-custom-nameservers.md) |

3. **Save.** Saving tests the connection by reading your balance, and tells you
   what's wrong if it fails. **Test connection** repeats the check at any time.

> 📸 **IMAGE 1: Truehost registrar settings**
> - **Show:** Setup → Domain Registrars → Truehost, filled in.
> - **Highlight:** Truehost Client Area Site and the success message after saving.
> - **Blur:** API Username (email) and API Key.
> - **File:** `images/domain-pricing/01-truehost-registrar.png`
> - **Alt text:** "Truehost registrar settings in PNLCS"

**Common errors when saving:**

| Message says | Meaning |
|---|---|
| "has no reseller account" | Your account is on a different Truehost site. Pick the site you log in to |
| "knows … but not this API key" | The key belongs to another Truehost site, or was regenerated. Copy it again |
| A server error from the site | That site doesn't have domain reselling switched on yet. Ask Truehost support |

> ⚠️ The panel server's clock must be correct: the connection uses a token that
> changes every hour.

## Step 2: add your extensions and prices

1. Go to **Setup → Domain Pricing → Add TLD**.
2. Fill in:

| Field | What to enter |
|---|---|
| **Extension** | With the dot: `.com`, `.co.ke`, `.africa` |
| **Register Price** | What customers pay for the first year |
| **Transfer Price** | What customers pay to move a domain to you |
| **Renew Price** | What customers pay each year after |
| **Popular** | Listed under the *Popular* filter on the domain search and pricing pages |
| **Category** | **Generic** (.com, .net), **Local extensions** or **Country** (.co.ke), for the pricing page tabs |
| **Restore fee** | Charged to recover a domain after it expired |
| **WHOIS privacy price (per year)** | Empty: not offered. `0`: free. An amount: sold at that price per year |
| **Grace Period (days)** | Days after expiry when it can still be renewed normally |
| **Min Years / Max Years** | How many years customers can register for at once (usually 1 to 10) |
| **Auto Registrar** | `truehost`. This is what makes paid orders register automatically |
| **Sort Order** | Lower numbers show first |
| **Enabled** | Ticked to sell it |

3. Save, then repeat for each extension.

Prices are entered in your shop's default currency (**Setup → Currencies**).

> 📸 **IMAGE 2: Add TLD form** (GIF suggested: filling in .co.ke)
> - **Show:** the Add TLD window filled in for `.co.ke`.
> - **Highlight:** Register / Transfer / Renew Price and **Auto Registrar** = `truehost`.
> - **Blur:** nothing.
> - **File:** `images/domain-pricing/02-add-tld.png`
> - **Alt text:** "Adding the .co.ke extension with prices and the Truehost registrar"

> 📸 **IMAGE 3: Domain Pricing list**
> - **Show:** Setup → Domain Pricing with several extensions.
> - **Highlight:** the Registrar column.
> - **Blur:** nothing.
> - **File:** `images/domain-pricing/03-pricing-list.png`
> - **Alt text:** "Domain Pricing page listing .com, .co.ke and .net"

> ⚠️ **Price above your cost.** Check your Truehost reseller price list for
> each extension's register, transfer and renew cost. Renewals often cost more
> than the first year, so set **Renew Price** with that in mind.

> ⚠️ **Leave Auto Registrar empty only on purpose.** An extension with no
> registrar is billed normally, but you have to register each paid domain
> yourself.

## Step 3: top up your balance

Registrations, transfers and renewals are paid from your reseller balance on
the Truehost site. With too little balance, a paid domain stays **Pending**
and you get a "registration failed" notification showing your balance.

To get a warning before it runs out: **Setup → General Settings → Registrar
balance watch**.

## Step 4: try it as a customer

1. Open `https://<your panel>/client/domain-search` in a private window and
   search for a name.
2. Check the price, and that your extensions appear.
3. Customers see all prices on `https://<your panel>/client/domain-pricing`.

> 📸 **IMAGE 4: Domain search results**
> - **Show:** the public domain search with a result and its price.
> - **Blur:** nothing.
> - **File:** `images/domain-pricing/04-domain-search.png`
> - **Alt text:** "Domain search on the reseller's site showing an available .co.ke name"

## What happens after an order

- **Paid order:** the domain is registered at Truehost, then marked **Active**
  once Truehost lists it in your reseller account.
- **Registration failed:** it stays **Pending**. Open it under **Clients →
  Domains** and use **Register** (or **Retry registration**) once the problem
  (balance, contact details) is fixed. Every call to Truehost and its answer are in
  **Utilities → System Logs → Module** (module `Truehost`).
- **Renewals:** PNLCS sends the renewal invoice before expiry and renews at
  Truehost when it's paid.
- **Every night** PNLCS reads each domain's expiry date, status and
  nameservers from Truehost and updates its records.

Customers manage their own domains in the client area: nameservers, auto-renew,
transfer lock, EPP code and contact details.
