منطقة العميل

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.

REST + JSON API key (Bearer) Paid from your wallet 120 calls / minute v1

Getting started

  1. Sign in and open واجهة الموزّعين API in your client area. Ask for reseller access (it may need our approval).
  2. Create your API key - it is shown once, keep it secret. Optionally allow only your server's IP addresses.
  3. Add funds to your wallet: every order is paid from it at once.
  4. Connect: install a ready-made module, use the PHP SDK, or call the API directly as shown below.
API address
BASEhttps://relech.com/api/reseller/v1

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: 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
{
    "success": true,
    "data": {
        "balance": {
            "amount": 200,
            "currency": "USD"
        }
    }
}
Failure
{
    "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

GET/products

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النوعالوصف
categorystringOnly one category (its name)
Request
curl -X GET "https://relech.com/api/reseller/v1/products" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

GET/products/{id}

The same for one product.

Parameterالنوعالوصف
idrequiredintegerProduct id (in the path)
Request
curl -X GET "https://relech.com/api/reseller/v1/products/14" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

POST/services/order

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_idrequiredintegerFrom /products
cyclerequiredstringA billing period of the product: one_month, one_year ...
domainstringNeeded when "domain_required"
optionsobject{option id: choice id}
inputsobjectThe module's order fields (e.g. hostname, os)
fieldsobjectThe product's custom fields {key: value}
referencestringYour own id for it (search with ?reference=)
Request
curl -X POST "https://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"
}'
Answer (201)
{
    "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

POST/services/{id}/renew

One more billing period at your price. A suspended service comes back.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X POST "https://relech.com/api/reseller/v1/services/1042/renew" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

POST/services/{id}/plan

Move to one of the product's "upgrades". An upgrade pays the difference for the rest of the period; a downgrade is free.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
product_idrequiredintegerThe new product
Request
curl -X POST "https://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
}'
Answer (200)
{
    "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

GET/services

All your services, newest first, 50 per page.

Parameterالنوعالوصف
statusstringpending, active, suspended, terminated
referencestringYour own id
api_onlybooleanOnly services ordered by API
pageintegerPage
Request
curl -X GET "https://relech.com/api/reseller/v1/services?status=active" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

GET/services/{id}

Status, dates and options of one service.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X GET "https://relech.com/api/reseller/v1/services/1042" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

GET/services/{id}/credentials

Username, password, IP address and server of the account - for your customer's welcome e-mail.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X GET "https://relech.com/api/reseller/v1/services/1042/credentials" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "success": true,
    "data": {
        "credentials": {
            "username": "clientsh42",
            "password": "Xy7#kQ2pLm9r",
            "domain": "client-shop.com",
            "ip": "203.0.113.20",
            "server": "srv1.example.net"
        }
    }
}

Suspend

POST/services/{id}/suspend

For example when your customer did not pay you.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
reasonstringShown in the logs
Request
curl -X POST "https://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"
}'
Answer (200)
{
    "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

POST/services/{id}/unsuspend

Not for an overdue service: renew that one.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X POST "https://relech.com/api/reseller/v1/services/1042/unsuspend" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "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

POST/services/{id}/terminate

Ends the service and deletes the account at once. It cannot be undone.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
confirmrequiredbooleantrue
Request
curl -X POST "https://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
}'
Answer (200)
{
    "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

POST/services/{id}/password

At least 10 characters with upper- and lower-case letters and a digit.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
passwordrequiredstringThe new password
Request
curl -X POST "https://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"
}'
Answer (200)
{
    "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": {}
    }
}

الاستخدام

GET/services/{id}/usage

Disk and bandwidth (MB) or the server state, as the module reports it.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X GET "https://relech.com/api/reseller/v1/services/1042/usage" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "success": true,
    "data": {
        "usage": {
            "disk_used": 250,
            "disk_limit": 10240,
            "bandwidth_used": 50,
            "bandwidth_limit": 102400
        }
    }
}

One-click sign-in

POST/services/{id}/login

A short-lived link that signs your customer in to the control panel.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
targetstringOne of "login_targets" of /actions
Request
curl -X POST "https://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"
}'
Answer (200)
{
    "success": true,
    "data": {
        "url": "https://srv1.example.net:2083/cpsess123/login"
    }
}

Module actions

GET/services/{id}/actions

Extra commands of the service's module (reboot, reinstall ...) and its sign-in targets.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
Request
curl -X GET "https://relech.com/api/reseller/v1/services/1042/actions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
Answer (200)
{
    "success": true,
    "data": {
        "actions": [
            {
                "action": "reboot",
                "label": "Reboot",
                "fields": [],
                "danger": false
            }
        ],
        "login_targets": [
            "user"
        ]
    }
}

Run a module action

POST/services/{id}/actions/{action}

Runs one of /actions; "input" carries its fields.

Parameterالنوعالوصف
idrequiredintegerThe service id (in the path).
actionrequiredstringFrom /actions (in the path)
inputobjectThe action's fields
Request
curl -X POST "https://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": {}
}'
Answer (200)
{
    "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

CodeHTTPMeaning
unauthorized401No key, or the key is wrong / revoked.
account_inactive403Your reseller account is waiting for approval or suspended.
ip_not_allowed403The call came from an address that is not in your list.
rate_limited429More than 120 calls in a minute. Wait a moment.
invalid_input422A parameter is missing or wrong; "fields" tells which.
not_found404Not in your account (or a wrong path).
insufficient_balance402Your balance does not cover the order ("required" and "balance" are given). Nothing was ordered.
api_disabled503The reseller API is switched off at the moment.
product_not_available404The product is not open to resellers.
cycle_not_offered422The product is not sold for that billing period (the offered ones are named).
invalid_option422An option or its choice does not belong to the product.
not_renewable409The service cannot be renewed in its state.
renewal_open409A renewal invoice is already open for the service.
plan_not_allowed409That product is not an upgrade / downgrade of this one.
overdue409The service is overdue: renew it (that unsuspends it too).
not_ready409The service is still being set up.
not_supported409The service's module cannot do that.
try_again409The server did not answer; the command can be sent again later.