itecdn 5.x用户文档
itecdn 5.x / 用户 API

查询套餐列表

GET/v1/packages

分页查询套餐,按排序值升序返回。普通用户仅能查询已启用的非专属套餐;传 mine 时仅查询 owner 包含当前用户 ID 的专属套餐。管理员可查看全部,并可按启用状态筛选。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

参数位置类型必填说明与约束
pagequeryinteger可选

页码,必须为数字;默认 1。

完整参数定义
{
  "name": "page",
  "in": "query",
  "required": false,
  "description": "页码,必须为数字;默认 1。",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "default": 1,
    "example": 1
  }
}
limitqueryinteger可选

每页条数,必须为数字;默认 10。传 0 时不分页。

完整参数定义
{
  "name": "limit",
  "in": "query",
  "required": false,
  "description": "每页条数,必须为数字;默认 10。传 0 时不分页。",
  "schema": {
    "type": "integer",
    "minimum": 0,
    "default": 10,
    "example": 10
  }
}
enablequeryinteger可选

仅管理员有效:按是否启用筛选。普通用户固定只查询启用套餐。

完整参数定义
{
  "name": "enable",
  "in": "query",
  "required": false,
  "description": "仅管理员有效:按是否启用筛选。普通用户固定只查询启用套餐。",
  "schema": {
    "type": "integer",
    "enum": [
      0,
      1
    ],
    "example": 1
  }
}
groupqueryinteger可选

套餐组 ID;筛选归属该套餐组的套餐。

完整参数定义
{
  "name": "group",
  "in": "query",
  "required": false,
  "description": "套餐组 ID;筛选归属该套餐组的套餐。",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "example": 3
  }
}
region_idqueryinteger可选

区域 ID;精确筛选套餐所属区域。

完整参数定义
{
  "name": "region_id",
  "in": "query",
  "required": false,
  "description": "区域 ID;精确筛选套餐所属区域。",
  "schema": {
    "type": "integer",
    "minimum": 1,
    "example": 1
  }
}
minequerystring可选

传任意非空值时,仅查询 owner 逗号列表包含当前登录用户 ID 的专属套餐;未传时普通用户只查询 owner 为空的套餐。

完整参数定义
{
  "name": "mine",
  "in": "query",
  "required": false,
  "description": "传任意非空值时,仅查询 `owner` 逗号列表包含当前登录用户 ID 的专属套餐;未传时普通用户只查询 `owner` 为空的套餐。",
  "schema": {
    "type": "string",
    "example": "1"
  }
}

响应

HTTP 200

查询成功时不含 msg 字段;参数或认证错误仍返回 HTTP 200。

application/json

oneOf

oneOf · 1 · object
字段类型必填说明与约束
codeinteger必填

业务状态码;0 表示成功。

约束 / 默认值 / 示例
{
  "enum": [
    0
  ]
}
countinteger必填

筛选后的套餐总数,未受分页影响。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "example": 1
}
dataarray <object>必填

当前页套餐记录。

展开字段结构

当前页套餐记录。

数组元素 · object
字段类型必填说明与约束
idinteger可选

套餐 ID。

namestring可选

套餐名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
desstring可选

套餐备注。

约束 / 默认值 / 示例
{
  "nullable": true
}
region_idinteger可选

所属区域 ID。

约束 / 默认值 / 示例
{
  "nullable": true
}
region_namestring可选

所属区域名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
node_group_idinteger可选

主线路组 ID。

约束 / 默认值 / 示例
{
  "nullable": true
}
node_group_namestring可选

主线路组名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
backup_node_groupinteger可选

备用线路组 ID。

约束 / 默认值 / 示例
{
  "nullable": true
}
backup_node_group_namestring可选

备用线路组名称。

约束 / 默认值 / 示例
{
  "nullable": true
}
cname_domaininteger可选

CNAME 域名配置 ID。

约束 / 默认值 / 示例
{
  "nullable": true
}
cname_hostname2string可选

备用 CNAME 主机名。

约束 / 默认值 / 示例
{
  "nullable": true
}
cname_modestring可选

CNAME 模式。

约束 / 默认值 / 示例
{
  "nullable": true
}
trafficinteger可选

套餐流量额度。

约束 / 默认值 / 示例
{
  "nullable": true
}
bandwidthstring可选

带宽限制值。

约束 / 默认值 / 示例
{
  "nullable": true
}
connectioninteger可选

连接数限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
domaininteger可选

可添加域名数量限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
main_domaininteger可选

主域名数量限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
http_portinteger可选

HTTP 端口数量限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
stream_portinteger可选

四层转发端口数量限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
custom_cc_ruleinteger可选

是否允许自定义 CC 规则:1 为允许,0 为不允许。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
websocketinteger可选

是否支持 WebSocket:1 为支持,0 为不支持。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
http3integer可选

是否支持 HTTP/3:1 为支持,0 为不支持。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
l2_stateinteger可选

是否启用二层调度能力:1 为启用,0 为停用。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
cc_protectstring可选

CC 防护能力说明。

约束 / 默认值 / 示例
{
  "nullable": true
}
ddos_protectstring可选

DDoS 防护能力说明。

约束 / 默认值 / 示例
{
  "nullable": true
}
expirestring可选

套餐停售或有效期截止时间,由数据库日期时间字段序列化返回。

约束 / 默认值 / 示例
{
  "nullable": true
}
expire2string可选

格式化截止时间,格式为 YYYY-MM-DD HH:mm:ss。

约束 / 默认值 / 示例
{
  "nullable": true
}
buy_num_limitinteger可选

可购买数量限制。

约束 / 默认值 / 示例
{
  "nullable": true
}
backend_ip_limitstring可选

源站 IP 限制配置文本。

约束 / 默认值 / 示例
{
  "nullable": true
}
id_verifyinteger可选

是否要求实名认证:1 为要求,0 为不要求。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
before_exp_days_renewinteger可选

到期前允许续费的提前天数。

约束 / 默认值 / 示例
{
  "nullable": true
}
month_priceinteger可选

月付价格,单位为系统最小货币单位。

约束 / 默认值 / 示例
{
  "nullable": true
}
quarter_priceinteger可选

季付价格,单位为系统最小货币单位。

约束 / 默认值 / 示例
{
  "nullable": true
}
year_priceinteger可选

年付价格,单位为系统最小货币单位。

约束 / 默认值 / 示例
{
  "nullable": true
}
create_atstring可选

创建时间,由数据库日期时间字段序列化返回。

约束 / 默认值 / 示例
{
  "nullable": true
}
create_at2string可选

格式化创建时间,格式为 YYYY-MM-DD HH:mm:ss。

约束 / 默认值 / 示例
{
  "nullable": true
}
update_atstring可选

最后更新时间,由数据库日期时间字段序列化返回。

约束 / 默认值 / 示例
{
  "nullable": true
}
sortinteger可选

展示排序值,数值越小越靠前。

约束 / 默认值 / 示例
{
  "nullable": true
}
ownerstring可选

专属用户 ID 列表,使用英文逗号分隔;空值表示非专属套餐。

约束 / 默认值 / 示例
{
  "nullable": true
}
enableinteger可选

是否启用:1 为启用,0 为停用。

约束 / 默认值 / 示例
{
  "nullable": true,
  "enum": [
    0,
    1
  ]
}
groupsstring可选

套餐所属套餐组 ID 的聚合字符串,使用英文逗号分隔;未分组时为 null。

约束 / 默认值 / 示例
{
  "nullable": true
}
oneOf · 2 · object
字段类型必填说明与约束
codestring必填

页码/分页条数格式错误或未登录时的业务错误码。

约束 / 默认值 / 示例
{
  "enum": [
    "package-38",
    "package-39",
    "login_required"
  ]
}
msgstring必填

错误原因。

约束 / 默认值 / 示例
{
  "example": "page参数格式不正确"
}
datastring必填

错误响应中的固定空字符串。

约束 / 默认值 / 示例
{
  "example": ""
}
完整 Schema
{
  "oneOf": [
    {
      "type": "object",
      "required": [
        "code",
        "count",
        "data"
      ],
      "properties": {
        "code": {
          "type": "integer",
          "enum": [
            0
          ],
          "description": "业务状态码;0 表示成功。"
        },
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "筛选后的套餐总数,未受分页影响。",
          "example": 1
        },
        "data": {
          "type": "array",
          "description": "当前页套餐记录。",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "description": "套餐 ID。"
              },
              "name": {
                "type": "string",
                "nullable": true,
                "description": "套餐名称。"
              },
              "des": {
                "type": "string",
                "nullable": true,
                "description": "套餐备注。"
              },
              "region_id": {
                "type": "integer",
                "nullable": true,
                "description": "所属区域 ID。"
              },
              "region_name": {
                "type": "string",
                "nullable": true,
                "description": "所属区域名称。"
              },
              "node_group_id": {
                "type": "integer",
                "nullable": true,
                "description": "主线路组 ID。"
              },
              "node_group_name": {
                "type": "string",
                "nullable": true,
                "description": "主线路组名称。"
              },
              "backup_node_group": {
                "type": "integer",
                "nullable": true,
                "description": "备用线路组 ID。"
              },
              "backup_node_group_name": {
                "type": "string",
                "nullable": true,
                "description": "备用线路组名称。"
              },
              "cname_domain": {
                "type": "integer",
                "nullable": true,
                "description": "CNAME 域名配置 ID。"
              },
              "cname_hostname2": {
                "type": "string",
                "nullable": true,
                "description": "备用 CNAME 主机名。"
              },
              "cname_mode": {
                "type": "string",
                "nullable": true,
                "description": "CNAME 模式。"
              },
              "traffic": {
                "type": "integer",
                "nullable": true,
                "description": "套餐流量额度。"
              },
              "bandwidth": {
                "type": "string",
                "nullable": true,
                "description": "带宽限制值。"
              },
              "connection": {
                "type": "integer",
                "nullable": true,
                "description": "连接数限制。"
              },
              "domain": {
                "type": "integer",
                "nullable": true,
                "description": "可添加域名数量限制。"
              },
              "main_domain": {
                "type": "integer",
                "nullable": true,
                "description": "主域名数量限制。"
              },
              "http_port": {
                "type": "integer",
                "nullable": true,
                "description": "HTTP 端口数量限制。"
              },
              "stream_port": {
                "type": "integer",
                "nullable": true,
                "description": "四层转发端口数量限制。"
              },
              "custom_cc_rule": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否允许自定义 CC 规则:1 为允许,0 为不允许。"
              },
              "websocket": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否支持 WebSocket:1 为支持,0 为不支持。"
              },
              "http3": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否支持 HTTP/3:1 为支持,0 为不支持。"
              },
              "l2_state": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用二层调度能力:1 为启用,0 为停用。"
              },
              "cc_protect": {
                "type": "string",
                "nullable": true,
                "description": "CC 防护能力说明。"
              },
              "ddos_protect": {
                "type": "string",
                "nullable": true,
                "description": "DDoS 防护能力说明。"
              },
              "expire": {
                "type": "string",
                "nullable": true,
                "description": "套餐停售或有效期截止时间,由数据库日期时间字段序列化返回。"
              },
              "expire2": {
                "type": "string",
                "nullable": true,
                "description": "格式化截止时间,格式为 `YYYY-MM-DD HH:mm:ss`。"
              },
              "buy_num_limit": {
                "type": "integer",
                "nullable": true,
                "description": "可购买数量限制。"
              },
              "backend_ip_limit": {
                "type": "string",
                "nullable": true,
                "description": "源站 IP 限制配置文本。"
              },
              "id_verify": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否要求实名认证:1 为要求,0 为不要求。"
              },
              "before_exp_days_renew": {
                "type": "integer",
                "nullable": true,
                "description": "到期前允许续费的提前天数。"
              },
              "month_price": {
                "type": "integer",
                "nullable": true,
                "description": "月付价格,单位为系统最小货币单位。"
              },
              "quarter_price": {
                "type": "integer",
                "nullable": true,
                "description": "季付价格,单位为系统最小货币单位。"
              },
              "year_price": {
                "type": "integer",
                "nullable": true,
                "description": "年付价格,单位为系统最小货币单位。"
              },
              "create_at": {
                "type": "string",
                "nullable": true,
                "description": "创建时间,由数据库日期时间字段序列化返回。"
              },
              "create_at2": {
                "type": "string",
                "nullable": true,
                "description": "格式化创建时间,格式为 `YYYY-MM-DD HH:mm:ss`。"
              },
              "update_at": {
                "type": "string",
                "nullable": true,
                "description": "最后更新时间,由数据库日期时间字段序列化返回。"
              },
              "sort": {
                "type": "integer",
                "nullable": true,
                "description": "展示排序值,数值越小越靠前。"
              },
              "owner": {
                "type": "string",
                "nullable": true,
                "description": "专属用户 ID 列表,使用英文逗号分隔;空值表示非专属套餐。"
              },
              "enable": {
                "type": "integer",
                "nullable": true,
                "enum": [
                  0,
                  1
                ],
                "description": "是否启用:1 为启用,0 为停用。"
              },
              "groups": {
                "type": "string",
                "nullable": true,
                "description": "套餐所属套餐组 ID 的聚合字符串,使用英文逗号分隔;未分组时为 null。"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    {
      "type": "object",
      "required": [
        "code",
        "msg",
        "data"
      ],
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "package-38",
            "package-39",
            "login_required"
          ],
          "description": "页码/分页条数格式错误或未登录时的业务错误码。"
        },
        "msg": {
          "type": "string",
          "description": "错误原因。",
          "example": "page参数格式不正确"
        },
        "data": {
          "type": "string",
          "description": "错误响应中的固定空字符串。",
          "example": ""
        }
      },
      "additionalProperties": false
    }
  ]
}

示例

{
  "code": 0,
  "count": 1,
  "data": [
    {
      "id": 11,
      "name": "标准套餐",
      "des": "适用于普通网站",
      "region_id": 1,
      "region_name": "华东",
      "node_group_id": 2,
      "node_group_name": "华东线路组",
      "backup_node_group": null,
      "backup_node_group_name": null,
      "cname_domain": 1,
      "cname_hostname2": null,
      "cname_mode": "single",
      "traffic": 100,
      "bandwidth": "10M",
      "connection": 1000,
      "domain": 10,
      "main_domain": 1,
      "http_port": 2,
      "stream_port": 0,
      "custom_cc_rule": 1,
      "websocket": 1,
      "http3": 1,
      "l2_state": 0,
      "cc_protect": "基础防护",
      "ddos_protect": "基础防护",
      "expire": null,
      "expire2": null,
      "buy_num_limit": 1,
      "backend_ip_limit": "",
      "id_verify": 0,
      "before_exp_days_renew": 7,
      "month_price": 1000,
      "quarter_price": 2700,
      "year_price": 10000,
      "create_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "create_at2": "2026-07-28 10:30:00",
      "update_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "sort": 100,
      "owner": "",
      "enable": 1,
      "groups": "3"
    }
  ]
}

查询成功

{
  "code": 0,
  "count": 1,
  "data": [
    {
      "id": 11,
      "name": "标准套餐",
      "des": "适用于普通网站",
      "region_id": 1,
      "region_name": "华东",
      "node_group_id": 2,
      "node_group_name": "华东线路组",
      "backup_node_group": null,
      "backup_node_group_name": null,
      "cname_domain": 1,
      "cname_hostname2": null,
      "cname_mode": "single",
      "traffic": 100,
      "bandwidth": "10M",
      "connection": 1000,
      "domain": 10,
      "main_domain": 1,
      "http_port": 2,
      "stream_port": 0,
      "custom_cc_rule": 1,
      "websocket": 1,
      "http3": 1,
      "l2_state": 0,
      "cc_protect": "基础防护",
      "ddos_protect": "基础防护",
      "expire": null,
      "expire2": null,
      "buy_num_limit": 1,
      "backend_ip_limit": "",
      "id_verify": 0,
      "before_exp_days_renew": 7,
      "month_price": 1000,
      "quarter_price": 2700,
      "year_price": 10000,
      "create_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "create_at2": "2026-07-28 10:30:00",
      "update_at": "Mon, 28 Jul 2026 10:30:00 GMT",
      "sort": 100,
      "owner": "",
      "enable": 1,
      "groups": "3"
    }
  ]
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/packages" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON