Reseller
The five endpoints that manage a client's reseller status and the program's installation-wide settings.
Overview
A reseller partnership is a client buying from you at a discount and selling on to their own customers. These endpoints run two separate layers that should not be confused.
The first three look at one client: their reseller status, credit threshold and discount tiers. The last two run the program itself: how applications are approved, whether verification is required, whether resellers get API access. Whether the path carries a client id tells you which layer you are on.
Structure
Discount Tiers
The per-client discounts and the program-wide discount_rates share one shape. Each tier key maps to a list of rows with from, to and rate.
| Tier key | Applies to | Example |
|---|---|---|
default | Every product, domain and add-on | default |
<group> | A whole group: hosting, server, software, ssl, domain (every extension) or addon (every add-on) | hosting |
special/<group_id> | A special product group | special/446 |
<group>/<category_id> | A product category, including the products in its sub-categories | hosting/550 |
<group>/0 | The group's products filed under no category | hosting/0 |
special-<group_id>/0 | The uncategorized products of one special group; special/0 covers every special group | special-445/0 |
<type>-<product_id> | A single product; a special-group product is special-<product_id> | hosting-15 |
domain-<tld> | A single domain extension | domain-com |
addon-<addon_id> | A single add-on | addon-8 |
Keys written by earlier versions still resolve. special-<group_id> is read as a special group when no special-group product has that id. domain-<tld_id> is read as the extension's numeric id. A key that matches none of the formats is stored as sent but never applies to a line. A row whose three values are all 0 is dropped on save.
Which tiers a reseller gets. The program-wide discount_rates apply to every active reseller. A key the reseller has tiers for replaces the program-wide tiers of that key as a whole. The two row lists are not merged. Every other program-wide key still applies, so a reseller with no tiers of their own is priced by the program-wide rates.
Which tier prices a line. The narrowest target with a matching row wins: product, add-on, domain extension, category, uncategorized, group, then default. For a category, the product's own category comes first, then each parent up the tree. Within a key, the first row whose range contains the count applies. A key with no matching row, or whose row has rate 0, falls through to the next target.
What is counted. A tier is chosen by the services the client holds at that tier's level. A product tier counts that product, and a category tier counts the category with its sub-categories. An uncategorized tier counts the group's uncategorized products, and a group tier the whole group. The addon group counts the client's add-ons, and default counts every service. A domain tier counts that extension, and an add-on tier that add-on. Orders, the cart and the reseller dashboard count every service that is not cancelled, pending ones included. Invoice lines count active services only: renewals, upgrades and lines written on the invoice screens.
Reference
Reading the Reseller Status
Returns the client's reseller status and the settings that belong to them.
active or inactive.default, hosting, hosting/550, hosting-15, domain-com, addon-8) to discount tiers.0 means no upper limit.curl 'https://panel.example.com/api/v1/admin/clients/42/reseller' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.example.com/api/v1/admin/clients/42/reseller', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();
// With no reseller record the response holds a single field.
if (!body.data.is_reseller) return;$ch = curl_init('https://panel.example.com/api/v1/admin/clients/42/reseller');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetClientReseller(['id' => 42]);
// The other fields only arrive when a record exists - read them null-safe.
$minCredit = $response['data']['min_credit']['amount'] ?? 0;{
"data": {
"is_reseller": true,
"status": "active",
"activation_time": "2026-02-01 12:00:00",
"min_credit": { "amount": 100.00, "currency_id": 840 },
"min_discount": { "amount": 50.00, "currency_id": 840 },
"only_credit_payment": false,
"discounts": {
"hosting": [{ "from": 1, "to": 10, "rate": 15.0 }, { "from": 11, "to": 0, "rate": 17.5 }]
}
}
}{
"data": {
"is_reseller": false
}
}Saving the Reseller Settings
Saves the reseller settings that belong to the client and switches the partnership on or off.
default, hosting, hosting/550, hosting-15, domain-com, addon-8) to discount tiers.0 or empty means no upper limit.curl -X PATCH 'https://panel.example.com/api/v1/admin/clients/42/reseller' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"active":true,"min_credit":{"amount":100,"currency_id":840},"only_credit_payment":true}'const res = await fetch('https://panel.example.com/api/v1/admin/clients/42/reseller', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
active: true,
min_credit: { amount: 100, currency_id: 840 },
only_credit_payment: true,
discounts: {
5: [{ from: 1, to: 10, rate: 15 }],
},
}),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/clients/42/reseller');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'active' => true,
'min_credit' => ['amount' => 100, 'currency_id' => 840],
'only_credit_payment' => true,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);// While the partnership is on, a setting you omit REMOVES that limit - read the current state first.
$current = Api::Clients()->GetClientReseller(['id' => 42])['data'];
$response = Api::Clients()->UpdateClientReseller([
'id' => 42,
'active' => true,
'min_credit' => $current['min_credit'],
'min_discount' => $current['min_discount'],
'only_credit_payment' => true,
'discounts' => $current['discounts'],
]);Changing the Reseller Status
Switches an existing reseller record on or off. The settings stay as they are.
activate or terminate.action is neither of the two values.curl -X PUT 'https://panel.example.com/api/v1/admin/clients/42/reseller/status' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"action":"activate"}'const res = await fetch('https://panel.example.com/api/v1/admin/clients/42/reseller/status', {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ action: 'activate' }),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/clients/42/reseller/status');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['action' => 'activate']),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->SetClientResellerStatus([
'id' => 42,
'action' => 'activate',
]);Reading the Program Settings
Returns the installation-wide settings of the reseller program. It looks at no single client.
manuel or auto.default, hosting, hosting/550, hosting-15, domain-com, addon-8) to discount tiers.0 means no upper limit.curl 'https://panel.example.com/api/v1/admin/clients/reseller/config' \
-H "Authorization: Bearer $API_KEY"const res = await fetch('https://panel.example.com/api/v1/admin/clients/reseller/config', {
headers: { Authorization: `Bearer ${apiKey}` },
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/clients/reseller/config');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . $apiKey],
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->GetResellerConfig();Saving the Program Settings
Saves the installation-wide settings of the reseller program.
manual, automatic or auto. An unrecognised value falls back to manual approval.default, hosting, hosting/550, hosting-15, domain-com, addon-8) to discount tiers. Send the complete set; tiers left out are removed.0 or empty means no upper limit.curl -X PUT 'https://panel.example.com/api/v1/admin/clients/reseller/config' \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"enabled":true,"activation":"manual","api_access":true}'const res = await fetch('https://panel.example.com/api/v1/admin/clients/reseller/config', {
method: 'PUT',
headers: {
Authorization: `Bearer ${apiKey}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
enabled: true,
activation: 'manual',
api_access: true,
}),
});
const body = await res.json();$ch = curl_init('https://panel.example.com/api/v1/admin/clients/reseller/config');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . $apiKey,
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'activation' => 'manual',
'api_access' => true,
]),
]);
$body = json_decode(curl_exec($ch), true);
curl_close($ch);$response = Api::Clients()->SaveResellerConfig([
'enabled' => true,
'activation' => 'manual',
'api_access' => true,
]);Pitfalls
Saving settings while the partnership is on drops any limit you did not send; the old value is not kept. Forgetting the credit threshold while you only meant to change the payment restriction removes that threshold. Read the current settings, edit them, and send all of it back.
With no reseller record the status endpoint returns only is_reseller and the other fields are absent. Read them null-safe rather than directly, or every non-reseller client will break your code.
The quick toggle only changes an existing record; on a client without one it returns not_reseller. Opening a new partnership is the settings endpoint's job.
A tier whose to is 0 (or sent empty) has no upper limit: it covers from and above. Do not read it as an empty range. Tier keys are strings such as hosting or hosting-15; a bare number matches no product.
Related Articles
Дякуємо за відгук!
Наша служба підтримки на зв’язку цілодобово з усього, чого ви не знайшли вище.