> ## Documentation Index
> Fetch the complete documentation index at: https://help.exy.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Resellers and WHMCS

> Resell exy.sh servers: reseller status and discount, your own references on servers, abuse responsibility and the WHMCS module.

You can sell exy.sh servers to your own customers from one exy.sh account: order them with the [API](https://help.exy.sh/api/use-the-exy-api.md), tag each with your own reference, and run them from your billing system. The WHMCS module below does this for WHMCS.

## Reseller status

Reseller status is granted by our staff on request. [Open a support ticket](https://panel.exy.sh/tickets) from the account you want to resell from. When we switch it on, you accept the reseller section of our [Terms](https://exy.sh/terms) (§ 3 e).

With reseller status:

* **15 % discount**, set on your account. It comes off the plan price of every new order and every renewal of the account, before VAT. A quote shows it as `discountAmount`; `subtotal` is the amount before it, and VAT is charged on what is left.
* The discount covers the plan, not the backup add-on, upgrades or IP changes.
* Coupons cannot be combined with it, and the account earns no affiliate commission while it is a reseller.
* Invoices issued before the status was switched on stay as they were issued.

The contract stays between exy.sh and you. You are our customer, your customers are yours: invoices go to your account under your tax profile, and every notice about a server goes to your account.

## You answer for abuse

As a reseller you are responsible for how your customers use their servers, and for abuse coming from them, as if it were your own use. Per the [Terms](https://exy.sh/terms):

* Pass the acceptable use rules on to your customers.
* Keep a contact that answers abuse reports without delay.
* After repeated violations we can withdraw the reseller status and take the measures the Terms provide for the servers concerned.

Abuse detection and suspensions work the same for API orders as for orders in the dashboard. Subscribe to the `vm_suspended` [webhook](https://help.exy.sh/api/webhooks.md) to learn about a suspension right away; its `reason` tells you whether it is `abuse`.

## Your own reference: `externalRef`

Each server can carry your own reference, for example your billing system's service ID. Set it with `PATCH /v1/servers/{id}` (scope `vms.manage`):

```bash theme={null}
curl -X PATCH https://api.exy.sh/v1/servers/123 \
  -H "Authorization: Bearer $EXY_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"externalRef": "whmcs:4711"}'
```

Find servers by it with `GET /v1/servers?externalRef=whmcs:4711`, which returns only the servers with exactly that reference. Send `"externalRef": null` to clear it.

* 1 to 64 characters: letters, digits and `.`, `_`, `:`, `-`.
* It is not unique: two servers can share it.
* **No personal data.** Names and email addresses do not fit the allowed characters on purpose. That way we hold no data about your customers.

## WHMCS module

The exy.sh provisioning module for WHMCS orders, renews, suspends and deletes servers on your exy.sh account through the API. It is open source under the MIT license. It needs WHMCS 7.2 or newer.

Download: [exy.sh/downloads/exysh-whmcs.zip](https://exy.sh/downloads/exysh-whmcs.zip)

### Install

**1. Upload the module**

Unpack the archive and copy the module into your WHMCS installation so that it is at `modules/servers/exysh/exysh.php`, next to its `lib/` folder and `clientarea.tpl`.

**2. Create an API token**

In the exy.sh dashboard, go to **Settings → API** and create a token with the scopes `vms.read`, `vms.operate`, `vms.manage`, `billing.read` and `billing.manage`. `billing.manage` needs two-factor authentication on your exy.sh login. Note the expiry date: a token lives at most 365 days, and WHMCS needs the new one before the old one expires.

**3. Check the System URL**

In WHMCS, **Setup → General Settings** must have a System URL. The module derives its idempotency keys from it, so that two WHMCS installations on the same exy.sh account never share a key.

**4. Add the server**

In WHMCS, add a server with the module **exy.sh**. Hostname: `api.exy.sh` (also the default when you leave it empty). Password: the API token. Leave the port empty or at 443. **Test Connection** checks the token and tells you which of the scopes above it lacks.

**5. Set up products**

For each product, choose the module **exy.sh** and fill in its settings:

| Setting | Value |
| - | - |
| Plan ID | The plan `id` from `GET /v1/plans?location=DE` |
| Location Code | The two-letter `code` from `GET /v1/locations`, for example `DE` |
| Billing Cycle | `1month`, `3months`, `6months` or `12months`. Match the WHMCS product's billing cycle |
| Image | The image slug from `GET /v1/images`. The admin Reinstall button uses it too |
| Backups | Buy the backup add-on where the plan lists it as `purchasable` |

Keep enough balance on your exy.sh account: every order and renewal is paid from it. Without enough balance, the WHMCS action fails with the API's error and nothing is charged.

### What the module does

| WHMCS action | On exy.sh |
| - | - |
| Create | Orders the server, paid from your balance. The idempotency key comes from your System URL and the WHMCS service ID, so a repeated Create returns the same order and charges once. The server gets the `externalRef` `whmcs:<service ID>` |
| Suspend | Stops the server |
| Unsuspend | Starts the server |
| Terminate | Deletes the server with its disks and backups. This cannot be undone, and the rest of the term is not refunded |
| Renew | Renews the server for the product's billing cycle when WHMCS calls Renew after a renewal invoice is paid. One key per service and due date, so a retry charges once |
| Change Package | Not supported yet. Order a new service and terminate the old one, or contact exy.sh support for an upgrade |

The module stores the exy.sh order and server on the WHMCS service in the fields **exy Order ID** and **exy Server ID**. To take over a server you already have, enter its ID in **exy Server ID**.

The server is built after Create returns. Until it exists, other actions answer that it is still being provisioned; try again a few minutes later. If the build fails, Create says so: exy.sh retries for about 15 minutes and refunds the order to your balance after 24 hours, see [When a build fails](https://help.exy.sh/api/order-and-renew-servers.md#when-a-build-fails). Run Create again once the order is completed or refunded.

Admins get the buttons **Start**, **Stop**, **Reboot** and **Reinstall (configured image)**. Your customers get **Start**, **Stop** and **Reboot** in the client area, for active services only, and see the server's status, IPv4 and IPv6 address and the date it is paid until. Every API call is written to the WHMCS module log; the token is left out of it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.