Skip to content

Packages & Policies ​

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

Requires HTTP Basic Auth.

Packages ​

List packages ​

GET /api/v1/package/list — Base packages with base price/speed/duration.

  • Filters: usertype, apply_users, apply_resellers, search, limit, offset
  • 200:
json
[ { "id": 5, "name": "10 Mbps", "policy": "10mbps_grp", "bandwidth": 10, "duration": "30",
    "duration_type": "2", "pool": "pppoe-pool", "auto_renew": false, "data_quota_gb": 0,
    "price": 1200, "vat": 0, "extra_fee": 0 } ]

Get package ​

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

Package pricing ​

GET /api/v1/package/pricing/{id} — Base + per-reseller pricing tiers.

  • 200: { "package_id": 5, "base": { "price": 1200, "vat": 0, … }, "resellers": [ … ] }

Update package ​

POST /api/v1/package/update — Updates descriptive/pricing fields only.

  • Params: package_id (required) + any of name, description, invoice_description, price, vat, extra_fee
  • 200: { "success": "Package Successfully Updated." }

Structural fields not editable here

Structural fields (pool, bandwidth, policy, duration, quotas) are not editable via the API — changing them on an in-use package requires re-provisioning; use the admin panel.

Delete package ​

DELETE /api/v1/package/delete/{id} — Blocked if any subscriber is assigned (400).

  • 200: { "success": "Package Successfully Deleted." }

Policies ​

A policy is a RADIUS group (groupname) whose attributes define bandwidth.

List policies ​

GET /api/v1/policy/list — All policies with attribute counts.

  • 200: [ { "groupname": "10mbps_grp", "reply_attributes": 2, "check_attributes": 1 } ]

Get policy ​

GET /api/v1/policy/get?groupname={name} — Full reply + check attribute set.

  • 200:
json
{ "groupname": "10mbps_grp",
  "reply": [ { "id": 12, "attribute": "Mikrotik-Rate-Limit", "op": ":=", "value": "10M/10M" } ],
  "check": [ { "id": 5, "attribute": "Simultaneous-Use", "op": ":=", "value": "1" } ] }
  • 404: policy not found

www.onezeroart.com