兑换码验证、兑换与质保换号接口文档
https://starwink.xyz所有请求必须在 Header 中携带 API Key:
X-API-Key: your-api-key-here
验证兑换码是否有效。返回兑换码对应的套餐和时长信息。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | string | 兑换码(必填) |
curl -X POST https://starwink.xyz/external/verify \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{"code": "YOUR_CODE"}'
{
"valid": true,
"plan": "pro",
"duration": "30天"
}
{
"valid": false,
"reason": "兑换码不存在"
}
使用兑换码为指定邮箱开通服务。兑换成功后返回分配的账号和到期时间。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | string | 兑换码(必填) |
| string | 用户邮箱(必填) |
curl -X POST https://starwink.xyz/external/redeem \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{"code": "YOUR_CODE", "email": "user@example.com"}'
{
"success": true,
"account": "user@example.com",
"expire_at": "2026-04-23T00:00:00Z"
}
{
"success": false,
"error": "兑换码不存在"
}
质保换号。当账号出现问题时,使用原兑换码申请更换新账号。
| 字段 | 类型 | 说明 |
|---|---|---|
| code | string | 原兑换码(必填) |
| string | 用户邮箱(必填) |
curl -X POST https://starwink.xyz/external/warranty \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{"code": "YOUR_CODE", "email": "user@example.com"}'
{
"success": true,
"new_account": "newuser@example.com"
}
{
"success": false,
"error": "兑换码不存在"
}
| 状态码 | 说明 | 处理建议 |
|---|---|---|
| 200 | 请求成功 | 正常处理响应数据 |
| 401 | 未授权 / API Key 无效 | 检查 X-API-Key header 是否正确 |
| 400 | 请求参数错误 | 检查请求体 JSON 格式和必填字段 |
| 404 | 接口不存在 | 检查请求路径是否正确 |
| 500 | 服务器内部错误 | 稍后重试,若持续出现请联系管理员 |
Content-Type: application/json