# Creating packages on PNLCS

> **Writer's brief**
> - **Audience:** a reseller setting up what they sell for the first time.
> - **Promise:** "Your first hosting package live in the shop in 10 minutes."
> - **Keywords:** create hosting package PNLCS, add hosting plan, reseller hosting packages, PNLCS products.
> - **Call to action:** open the shop as a customer and see the package.
> - **Note:** the panel calls packages **products**. Use "package" in headings and "product" when naming screens.

A **package** is something customers can order: a hosting plan, a VPS, an SSL
certificate. Packages live in **groups** (for example *Shared Hosting*,
*Business Hosting*), which is how customers browse the shop.

**You need:** a connected hosting server and the plan names on it, if
accounts should be created automatically. See [Before you start](00-before-you-start.md#hosting-server-for-packages).

## Step 1: connect your hosting server (once)

Skip this if you create accounts by hand.

1. Go to **Setup → Servers → Add Server**.
2. Pick the **type** (cPanel, Panelica, DirectAdmin, Plesk...). The form changes
   to ask for what that type needs.
3. Enter a **name** (only you see it), the **hostname**, and the credentials
   from your hosting provider.
4. Optional but recommended: the server's **Nameservers**. Customers are told
   to point their domains at them. See [Custom nameservers](05-custom-nameservers.md).
5. Save, then press **Test** next to the server in the list.

> 📸 **IMAGE 1: Add Server form**
> - **Show:** Setup → Servers → Add Server, type set to cPanel.
> - **Highlight:** the Type field and the Test button.
> - **Blur:** API token, password, access hash, IP address.
> - **File:** `images/creating-packages/01-add-server.png`
> - **Alt text:** "Add Server form in PNLCS with the server type set to cPanel"

> ⚠️ Fix a failing **Test** before going on. Most problems are a wrong token,
> or a firewall blocking the panel's port (2087 for WHM, 8443 for Panelica).

## Step 2: create a group

1. Go to **Setup → Products/Services → New Group**.
2. Give it the name customers will see, e.g. **Shared Hosting**, and save.

> 📸 **IMAGE 2: Products/Services page**
> - **Show:** Setup → Products/Services with one group.
> - **Highlight:** **New Group** and **New Hosting Product**.
> - **Blur:** nothing.
> - **File:** `images/creating-packages/02-products-page.png`
> - **Alt text:** "Products and services page with the New Group button"

## Step 3: create the package

Go to **Setup → Products/Services → New Hosting Product** and fill in:

| Field | What to enter |
|---|---|
| **Product Type** | **Shared Hosting**, **Reseller Hosting**, **VPS/Dedicated**, **SSL Certificate** or **Other** |
| **Product Group** | The group from step 2 |
| **Product Name** | What customers see, e.g. "Starter 5GB" |
| **Description** | What's included: disk, bandwidth, email accounts... Customers see it in the shop |
| **Server module** | Which panel creates the account: the type of server from step 1. Choose none to set accounts up by hand |
| **Server group** | Leave **Any server of that type** unless you use server groups |
| **Plan on the server** | The package (plan) on your server that this product sells, e.g. `starter_5gb` |
| **Auto Setup** | When the account is created (below) |
| **Payment Type** | **Recurring** for hosting; **One Time** or **Free** for others |
| **Pricing** | A price per billing cycle, per currency |

**Auto Setup** choices:

- **As soon as the first payment is received**: recommended. Nobody gets a
  live account without paying.
- **As soon as the order is placed**: before payment. Use only for trusted
  customers or free packages.
- **Only when an admin accepts the order**: you check every order first.

**Pricing:** there's a box for **monthly, quarterly, semi-annually, annually,
biennially and triennially**, for each currency you have. Enter `-1` to
**hide** a cycle. To sell annual-only hosting, put the price in *annually*
and `-1` everywhere else.

Save.

> 📸 **IMAGE 3: New product form** (GIF suggested: scroll from top to pricing)
> - **Show:** a filled-in form for "Starter 5GB".
> - **Highlight:** Plan on the server, Auto Setup, and the pricing table with `-1` in unused cycles.
> - **Blur:** nothing.
> - **File:** `images/creating-packages/03-new-product.png`
> - **Alt text:** "New hosting product form with plan, auto setup and pricing filled in"

## Step 4: fine-tune it (optional)

Open the package again (**Setup → Products/Services**, click its name) for more options:

| Option | What it does |
|---|---|
| **Offer a domain on the order form** | Customers register, transfer or use their own domain while ordering |
| **Free domain with this product** | First year of a domain free, for the billing cycles and extensions you tick. Renews at the normal price |
| **Stock** | Limit how many can be sold |
| **Hidden** | Not shown in the shop; you can still add it to a customer from the admin area |
| **Featured** | Highlighted in the shop |
| **Retired** | No new orders; existing customers keep it |
| **Upgrade paths** | Which packages a customer may upgrade or downgrade to |
| **Custom fields** | Extra questions on the order form, e.g. "Company KRA PIN" |

Related screens under **Setup**: **Product Addons** (extras sold with a
package), **Promotions** (discount codes), **Product Bundles**.

## Step 5: check it as a customer

1. Open your shop in a private browser window: `https://<your panel>/client/store`.
2. Find the group and the package, and check the price and cycles.
3. Place a test order and pay with a test payment method. The account
   appears on your server when the invoice is paid.

> 📸 **IMAGE 4: The package in the shop**
> - **Show:** the client-area store with the new package card.
> - **Highlight:** the price and the Order button.
> - **Blur:** nothing.
> - **File:** `images/creating-packages/04-store.png`
> - **Alt text:** "The Starter 5GB package as customers see it in the store"

## Troubleshooting

| Problem | Fix |
|---|---|
| Package not in the shop | Is it **Hidden** or **Retired**? Is its group hidden? Does at least one cycle have a price other than `-1`? |
| Paid, but no account was created | **Auto Setup** set to manual? Test the server under **Setup → Servers**. The service page in the admin area shows the module's error, and **Utilities → System Logs** has the details |
| "Package not found" from the server | **Plan on the server** must match the plan name on the server exactly |
