POST
应用试用(buy_type=trial)
https://dcshop.xzsc.cc/store_api.php?action=buy
接口说明
申请应用试用。真实接口复用购买接口 store_api.php?action=buy,并传入 buy_type=trial。试用期间可以下载和使用应用。
注意:此功能需要应用 trial_days 大于 0,且用户未购买过该应用。当前逻辑按用户+应用限制,每个应用只能试用一次。
请求参数
| 参数 | 类型 | 必填 | 说明 |
| app_id | int | 是 | 应用ID |
| license_key | string | 否* | 授权码(推荐使用) |
| domain | string | 否* | 当前域名 |
| buy_type | string | 是 | 固定传 trial |
返回示例 - 试用成功
{
"code": 200,
"msg": "试用开通成功,有效期 7 天",
"data": {
"price": 0,
"expire_time": "2026-01-10 23:59:59",
"trial_days": 7
}
}
返回示例 - 已试用过
{
"code": 400,
"msg": "您已试用过此应用,每个应用仅可试用一次"
}
返回示例 - 不支持试用
{
"code": 400,
"msg": "该应用不支持试用"
}
返回字段说明
| 字段 | 类型 | 说明 |
| price | int | 试用价格,固定 0 |
| trial_days | int | 试用时长(天) |
| expire_time | string | 试用到期时间 |
POST
检查应用更新
https://dcshop.xzsc.cc/store_api.php?action=check_update
请求参数
| 参数 | 类型 | 必填 | 说明 |
| apps | string | 是 | 已安装应用JSON数组 |
| domain | string | 否 | 当前域名 |
apps 参数格式
[
{"name": "example_plugin", "version": "1.0.0"},
{"name": "default", "version": "1.0.0", "type": "template"},
{"name": "default", "version": "1.0.0", "type": "user_template"}
]
返回示例
{
"code": 200,
"msg": "success",
"data": {
"updates": [
{
"id": 1,
"name": "example_plugin",
"type": "plugin",
"current_version": "1.0.0",
"new_version": "1.2.0",
"changelog": "1. 新增功能A\n2. 修复BUG B",
"buy_type": "permanent",
"expire_time": ""
}
],
"purchase_info": {
"plugin:example_plugin": {"buy_type": "permanent", "expire_time": null}
},
"category_map": {
"plugin:example_plugin": 1
}
}
}
说明
data.updates 只包含有更新的应用
- 如果所有应用都是最新版本,
data.updates 为空数组
- 模板类应用建议传入
type,避免多个 default 模板互相串更新