Skip to content

Resellers ​

Base URL: https://your-domain.com/api/v1

Manage the three reseller tiers — franchise, dealer, subdealer. Requires HTTP Basic Auth. Passwords are never returned.

List ​

GET /api/v1/reseller/list — Filters: type (franchise|dealer|subdealer), parent_id, status, search, limit, offset.

Get ​

GET /api/v1/reseller/get/{id} — Single reseller. 404 if not found.

Create ​

POST /api/v1/reseller/create

  • Required: type (required) (franchise|dealer|subdealer), name, username, password, nic, email, phone, address
  • Parent (by tier):
    • franchise → optional admin_id (owning admin; defaults to the primary admin)
    • dealer → franchise_id (required)
    • subdealer → dealer_id (required)
  • Optional: city, area, nas
  • Uniqueness enforced on username/nic/email/phone. Inherits ispid from the parent.
  • 200: { "success": "Franchise Successfully Created.", "id": 42 }

Update ​

POST /api/v1/reseller/update — Params: id (required), name, nic, email, phone, address (+ optional area, city, nas, status, password).

Updates the target reseller only — it does not cascade NAS/status to sub-resellers

(the admin panel does). :::

Activate / deactivate ​

Use update with status = 1 (active) or 0 (inactive).

Delete ​

DELETE /api/v1/reseller/delete/{id} — Guarded: refused (400) if the reseller has any sub-reseller or assigned subscriber.

www.onezeroart.com