Product & Service Reseller API
Resell our hosting, servers and licences under your own brand: order at your reseller price, get the account details back at once, and renew, upgrade, suspend or end the services - from your website, your billing system or WHMCS.
Getting started
- Sign in and open রিসেলার API in your client area. Ask for reseller access (it may need our approval).
- Create your API key - it is shown once, keep it secret. Optionally allow only your server's IP addresses.
- Add funds to your wallet: every order is paid from it at once.
- Connect: install a ready-made module, use the PHP SDK, or call the API directly as shown below.
Authentication
Send your key with every call in the Authorization header (or as X-Api-Key). Use HTTPS only; never put the key in a browser page. GET /account answers with your balance and your discounts - a good first call.
GET /api/reseller/v1/account HTTP/1.1 Host: mail.relech.com Authorization: Bearer rk_xxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Accept: application/json
A new key replaces the old one at once. Too many wrong keys from one address are blocked for a while.
Answers and errors
Every answer is JSON with success. On success the result is in data; on failure error.code tells what happened (stable, for your code) and error.message says it in words. The HTTP status matches.
{
"success": true,
"data": {
"balance": {
"amount": 200,
"currency": "USD"
}
}
}{
"success": false,
"error": {
"code": "insufficient_balance",
"message": "Your balance does not cover this order. Add funds and try again.",
"required": {
"amount": 11.6899999999999995026200849679298698902130126953125,
"currency": "USD"
},
"balance": {
"amount": 4.20000000000000017763568394002504646778106689453125,
"currency": "USD"
}
}
}Prices and payment
- Your price = our retail price minus the discount of your reseller group.
- GET /products gives the retail price and your price of every billing period - import it and add your margin.
- Services ordered through the API never renew on their own: renew them with POST /services/{id}/renew before they are due, or they are suspended a few days after.
- An upgrade costs the price difference for the rest of the period, at your price.
- An order is an invoice in your account, paid from your wallet at once. When the balance is short nothing is ordered.
Ready-made connectors
WHMCS
A provisioning (server) module: create, suspend, unsuspend, terminate, renew, change package and password, account details and one-click login for your customers.
ডাউনলোডPHP SDK
One class for every call, with clear exceptions. PHP 7.4+, no dependencies. Examples included.
ডাউনলোডDHLMS
Running DHLMS? Buy the "DHLMS Product Reseller" server module in your Module Manager - it installs itself after the payment. Add our API as a server, import the products with your profit, and sell them like your own.
প্রোডাক্টসমূহ
What you can order, with your prices.
Products and prices
Every product open to resellers: billing periods with the retail price, your price, your setup fee and your first payment; the configurable options and their prices; the order fields of its module ("inputs", with rules) and its custom fields ("fields").
| Parameter | ধরন | বিবরণ |
|---|---|---|
category | string | Only one category (its name) |
curl -X GET "https://mail.relech.com/api/reseller/v1/products" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->products();
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/products', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/products',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"currency": "USD",
"products": [
{
"id": 14,
"name": "Starter Hosting",
"category": "Shared Hosting",
"type": "Shared Hosting",
"description": "10 GB SSD, free SSL",
"domain_required": true,
"price_type": "recurring",
"cycles": {
"one_month": {
"retail": 5,
"price": 4.5,
"setup_fee": 0,
"first_payment": 4.5
},
"one_year": {
"retail": 48,
"price": 43.2000000000000028421709430404007434844970703125,
"setup_fee": 0,
"first_payment": 43.2000000000000028421709430404007434844970703125
}
},
"options": [
{
"id": 6,
"name": "Disk",
"choices": [
{
"id": 11,
"name": "20 GB",
"prices": {
"one_month": {
"retail": 2,
"price": 1.8000000000000000444089209850062616169452667236328125
}
}
}
]
}
],
"inputs": {},
"fields": {},
"upgrades": [
15,
16
]
}
]
}
}One product
The same for one product.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | Product id (in the path) |
curl -X GET "https://mail.relech.com/api/reseller/v1/products/14" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->product(14);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/products/14', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/products/14',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"product": {
"id": 14,
"name": "Starter Hosting"
}
}
}Order and renew
Each call is an order paid from your balance at once - when the balance is too low nothing is ordered and you get "insufficient_balance".
Order a service
The service is set up at once by its module (or as soon as possible: "setup_waiting": true - follow it with GET /services/{id}). Then read the account details with /credentials.
| Parameter | ধরন | বিবরণ |
|---|---|---|
product_idrequired | integer | From /products |
cyclerequired | string | A billing period of the product: one_month, one_year ... |
domain | string | Needed when "domain_required" |
options | object | {option id: choice id} |
inputs | object | The module's order fields (e.g. hostname, os) |
fields | object | The product's custom fields {key: value} |
reference | string | Your own id for it (search with ?reference=) |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/order" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"product_id": 14,
"cycle": "one_year",
"domain": "client-shop.com",
"options": {
"6": 11
},
"reference": "CRM-4411"
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->order(14, 'one_year', 'client-shop.com', [6 => 11], [], [], 'CRM-4411');
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/order', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"product_id": 14,
"cycle": "one_year",
"domain": "client-shop.com",
"options": {
"6": 11
},
"reference": "CRM-4411"
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/order',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"product_id": 14,
"cycle": "one_year",
"domain": "client-shop.com",
"options": {
"6": 11
},
"reference": "CRM-4411"
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"order": {
"id": 5531,
"invoice_id": 8812,
"status": "active",
"amount": {
"amount": 43.2000000000000028421709430404007434844970703125,
"currency": "USD"
},
"paid": true,
"balance": {
"amount": 156.80000000000001136868377216160297393798828125,
"currency": "USD"
}
}
}
}Renew a service
One more billing period at your price. A suspended service comes back.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/renew" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->renew(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/renew', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/renew',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2028-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"order": {
"id": 5531,
"invoice_id": 8812,
"status": "active",
"amount": {
"amount": 43.2000000000000028421709430404007434844970703125,
"currency": "USD"
},
"paid": true,
"balance": {
"amount": 156.80000000000001136868377216160297393798828125,
"currency": "USD"
}
}
}
}Upgrade / downgrade
Move to one of the product's "upgrades". An upgrade pays the difference for the rest of the period; a downgrade is free.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
product_idrequired | integer | The new product |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/plan" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"product_id": 15
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->changePlan(2210, 15);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/plan', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"product_id": 15
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/plan',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"product_id": 15
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 15,
"product": "Business Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"order": {
"id": 5531,
"invoice_id": 8812,
"status": "active",
"amount": {
"amount": 43.2000000000000028421709430404007434844970703125,
"currency": "USD"
},
"paid": true,
"balance": {
"amount": 156.80000000000001136868377216160297393798828125,
"currency": "USD"
}
}
}
}Manage services
Commands go to the server at once. The account details stay with you: we never contact your customers.
Your services
All your services, newest first, 50 per page.
| Parameter | ধরন | বিবরণ |
|---|---|---|
status | string | pending, active, suspended, terminated |
reference | string | Your own id |
api_only | boolean | Only services ordered by API |
page | integer | Page |
curl -X GET "https://mail.relech.com/api/reseller/v1/services?status=active" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->services(['status' => 'active']);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services?status=active', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/services',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
params={
"status": "active"
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"services": [
{
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
}
],
"page": 1,
"per_page": 50,
"total": 1,
"last_page": 1
}
}Service details
Status, dates and options of one service.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X GET "https://mail.relech.com/api/reseller/v1/services/1042" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->service(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/services/1042',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
}
}
}Account details
Username, password, IP address and server of the account - for your customer's welcome e-mail.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X GET "https://mail.relech.com/api/reseller/v1/services/1042/credentials" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->credentials(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/credentials', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/services/1042/credentials',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"credentials": {
"username": "clientsh42",
"password": "Xy7#kQ2pLm9r",
"domain": "client-shop.com",
"ip": "203.0.113.20",
"server": "srv1.example.net"
}
}
}Suspend
For example when your customer did not pay you.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
reason | string | Shown in the logs |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/suspend" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"reason": "Unpaid invoice"
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->suspend(2210, 'Unpaid invoice');
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/suspend', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"reason": "Unpaid invoice"
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/suspend',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"reason": "Unpaid invoice"
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "suspended",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"data": {}
}
}Unsuspend
Not for an overdue service: renew that one.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/unsuspend" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->unsuspend(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/unsuspend', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/unsuspend',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"data": {}
}
}Terminate
Ends the service and deletes the account at once. It cannot be undone.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
confirmrequired | boolean | true |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/terminate" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"confirm": true
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->terminate(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/terminate', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"confirm": true
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/terminate',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"confirm": True
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "terminated",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"data": {}
}
}Change the password
At least 10 characters with upper- and lower-case letters and a digit.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
passwordrequired | string | The new password |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/password" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"password": "N3w-Secret-Pass"
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->changePassword(2210, 'N3w-Secret-Pass');
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/password', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"password": "N3w-Secret-Pass"
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/password',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"password": "N3w-Secret-Pass"
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"data": {}
}
}ব্যবহার
Disk and bandwidth (MB) or the server state, as the module reports it.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X GET "https://mail.relech.com/api/reseller/v1/services/1042/usage" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->usage(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/usage', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/services/1042/usage',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"usage": {
"disk_used": 250,
"disk_limit": 10240,
"bandwidth_used": 50,
"bandwidth_limit": 102400
}
}
}One-click sign-in
A short-lived link that signs your customer in to the control panel.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
target | string | One of "login_targets" of /actions |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/1042/login" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"target": "user"
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->login(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/login', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"target": "user"
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/1042/login',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"target": "user"
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"url": "https://srv1.example.net:2083/cpsess123/login"
}
}Module actions
Extra commands of the service's module (reboot, reinstall ...) and its sign-in targets.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
curl -X GET "https://mail.relech.com/api/reseller/v1/services/1042/actions" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json"
<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->actions(2210);
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/1042/actions', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json'
}
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.get(
'https://mail.relech.com/api/reseller/v1/services/1042/actions',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"actions": [
{
"action": "reboot",
"label": "Reboot",
"fields": [],
"danger": false
}
],
"login_targets": [
"user"
]
}
}Run a module action
Runs one of /actions; "input" carries its fields.
| Parameter | ধরন | বিবরণ |
|---|---|---|
idrequired | integer | The service id (in the path). |
actionrequired | string | From /actions (in the path) |
input | object | The action's fields |
curl -X POST "https://mail.relech.com/api/reseller/v1/services/2210/actions/reboot" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"input": {}
}'<?php
require 'reseller-products-sdk/autoload.php';
$api = new \ResellerApi\ProductClient('YOUR_API_KEY');
try {
$data = $api->perform(2210, 'reboot');
print_r($data);
} catch (\ResellerApi\ApiException $e) {
echo $e->getErrorCode(), ': ', $e->getMessage();
}const res = await fetch('https://mail.relech.com/api/reseller/v1/services/2210/actions/reboot', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"input": {}
})
});
const answer = await res.json();
if (!answer.success) throw new Error(answer.error.code + ': ' + answer.error.message);
console.log(answer.data);import requests
res = requests.post(
'https://mail.relech.com/api/reseller/v1/services/2210/actions/reboot',
headers={'Authorization': 'Bearer YOUR_API_KEY', 'Accept': 'application/json'},
json={
"input": {}
},
timeout=60,
)
answer = res.json()
if not answer['success']:
raise Exception(answer['error']['code'] + ': ' + answer['error']['message'])
print(answer['data']) {
"success": true,
"data": {
"service": {
"id": 2210,
"product_id": 14,
"product": "Starter Hosting",
"status": "active",
"domain": "client-shop.com",
"cycle": "one_year",
"registered_at": "2026-10-16T09:12:00+00:00",
"expires_at": "2027-10-16T09:12:00+00:00",
"next_due_at": "2027-10-16T09:12:00+00:00",
"provisioned": true,
"setup_waiting": false,
"options": [
{
"option": "Disk",
"value": "20 GB"
}
],
"reference": "CRM-4411",
"by_api": true
},
"data": {}
}
}Error codes
| Code | HTTP | Meaning |
|---|---|---|
unauthorized | 401 | No key, or the key is wrong / revoked. |
account_inactive | 403 | Your reseller account is waiting for approval or suspended. |
ip_not_allowed | 403 | The call came from an address that is not in your list. |
rate_limited | 429 | More than 120 calls in a minute. Wait a moment. |
invalid_input | 422 | A parameter is missing or wrong; "fields" tells which. |
not_found | 404 | Not in your account (or a wrong path). |
insufficient_balance | 402 | Your balance does not cover the order ("required" and "balance" are given). Nothing was ordered. |
api_disabled | 503 | The reseller API is switched off at the moment. |
product_not_available | 404 | The product is not open to resellers. |
cycle_not_offered | 422 | The product is not sold for that billing period (the offered ones are named). |
invalid_option | 422 | An option or its choice does not belong to the product. |
not_renewable | 409 | The service cannot be renewed in its state. |
renewal_open | 409 | A renewal invoice is already open for the service. |
plan_not_allowed | 409 | That product is not an upgrade / downgrade of this one. |
overdue | 409 | The service is overdue: renew it (that unsuspends it too). |
not_ready | 409 | The service is still being set up. |
not_supported | 409 | The service's module cannot do that. |
try_again | 409 | The server did not answer; the command can be sent again later. |