查询套餐列表
/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 同时发送。"
}
}请求参数
| 参数 | 位置 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|---|
page | query | integer | 可选 | 页码,必须为数字;默认 1。 完整参数定义 |
limit | query | integer | 可选 | 每页条数,必须为数字;默认 10。传 0 时不分页。 完整参数定义 |
enable | query | integer | 可选 | 仅管理员有效:按是否启用筛选。普通用户固定只查询启用套餐。 完整参数定义 |
group | query | integer | 可选 | 套餐组 ID;筛选归属该套餐组的套餐。 完整参数定义 |
region_id | query | integer | 可选 | 区域 ID;精确筛选套餐所属区域。 完整参数定义 |
mine | query | string | 可选 | 传任意非空值时,仅查询 完整参数定义 |
响应
HTTP 200
查询成功时不含 msg 字段;参数或认证错误仍返回 HTTP 200。
application/json
oneOf
oneOf · 1 · object
| 字段 | 类型 | 必填 | 说明与约束 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | integer | 必填 | 业务状态码;0 表示成功。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
count | integer | 必填 | 筛选后的套餐总数,未受分页影响。 约束 / 默认值 / 示例 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
data | array <object> | 必填 | 当前页套餐记录。 展开字段结构当前页套餐记录。 数组元素 · object
|
oneOf · 2 · object
| 字段 | 类型 | 必填 | 说明与约束 |
|---|---|---|---|
code | string | 必填 | 页码/分页条数格式错误或未登录时的业务错误码。 约束 / 默认值 / 示例 |
msg | string | 必填 | 错误原因。 约束 / 默认值 / 示例 |
data | string | 必填 | 错误响应中的固定空字符串。 约束 / 默认值 / 示例 |
完整 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"