1. Home
  2. Docs
  3. Reseller Guide
  4. Reseller API

Reseller API

Resellers can automate their business with the CWP API — for example connect WHMCS, Blesta or their own shop so that paid orders create hosting accounts automatically and overdue invoices suspend them.

Reseller-owned API keys

A key owned by a reseller works exactly like a normal API key, but is limited to that reseller:

  • account list returns only the reseller’s own customers,
  • packages sees and manages only the reseller’s packages,
  • new accounts are created as the reseller’s customers and count towards the reseller’s limits.

Create the key in the user panel under Reseller → Api Manager:

  1. Click Create new api token.
  2. Enter a Short Name, the Ip Origin of your billing system and click Generate for the key.
  3. Tick only the API Functions you need — typically Account creation, Account Update, Suspend account, Activate account, Account Delete, Change of password, List packages and Autologin.
  4. Save.

The server administrator can also create a key in the admin API Manager with the reseller as Owner — it has the same limits.

Calling the API

The API address, parameters and responses are the same for resellers and administrators:

curl -X POST https://server.example.com:2304/v1/account/ \
  -d "key=YOUR_RESELLER_KEY&action=add&domain=customer.com&user=customer1&pass=S3cretPass&email=owner@customer.com&package=Starter&server_ips=203.0.113.10"

See the full reference:

Note: Use the package names you created as a reseller (or their IDs from packages list). If the reseller account limit is reached, account add fails — check the Reseller Dashboard.

Related

Was this article helpful to you? No Yes