Partner API · v1

代理商接入Partner integration
简单、稳定、清晰Simple. Stable. Clear.

使用标准 JSON 接口,将 CDK 验证、套餐充值和批量查卡接入你自己的商城或机器人。Use standard JSON APIs to add CDK verification, plan recharge and batch lookup to your store or bot.

API Base URLhttps://plus.getaiai.com/api/v1请求与响应均使用 application/jsonRequests and responses use application/json● API Health GET /health ↗
01 · 接口约定

统一响应格式Unified response format

请同时检查 HTTP 状态码与响应 JSON 中的 code。业务成功时 code 为 0。Check both the HTTP status and JSON code. A code of 0 means success.

{
  "code": 0,
  "message": "success",
  "data": {}
}
敏感信息Sensitive data accountSession 不会被本站记录或保存,只会转发至指定充值服务器。accountSession is never logged or stored and is only forwarded to the designated recharge server.
GET健康检查与便捷验证Health check and quick verification
CORS支持代理商前端跨域调用Cross-origin partner integrations
TRACE每次响应包含 X-Request-IDX-Request-ID on every response
03 · 验证 CDK

验证 CDKVerify CDK

在充值前检查兑换码是否存在、是否可用。Check whether a CDK exists and can be used before recharge.

GET / POST/api/v1/verify-cardkey

请求体Request body

{
  "cardKey": "PLUS-VM3DNSJ3"
}

cURL

curl "https://plus.getaiai.com/api/v1/verify-cardkey?cardKey=PLUS-VM3DNSJ3"

成功响应Success response

{
  "code": 0,
  "message": "success",
  "data": {
    "valid": true,
    "status": 0,
    "statusDesc": "未使用",
    "message": "卡密有效"
  }
}
04 · 提交充值

提交充值Submit recharge

提交兑换码和用户 Session。收到 60804 后,经用户确认再将 confirmOverride 设为 true。Submit a CDK and user Session. After a 60804 response, get user confirmation and retry with confirmOverride set to true.

POST/api/v1/redeem

请求体Request body

{
  "cardKey": "PLUS-VM3DNSJ3",
  "accountSession": "{\"user\":{\"email\":\"user@example.com\"},\"account\":{\"id\":\"account-id\"}}",
  "confirmOverride": false
}

cURL

curl -X POST "https://plus.getaiai.com/api/v1/redeem" \
  -H "Content-Type: application/json" \
  -d '{  "cardKey": "PLUS-VM3DNSJ3",  "accountSession": "{\"user\":{\"email\":\"user@example.com\"},\"account\":{\"id\":\"account-id\"}}",  "confirmOverride": false}'

成功响应Success response

{
  "code": 0,
  "message": "success",
  "data": {
    "success": true,
    "message": "充值成功",
    "recordId": 123,
    "expiresDate": "2026-08-17T00:00:00Z"
  }
}
05 · 批量查询状态

批量查询状态Batch status lookup

一次查询 1 至 100 个 CDK 的状态、使用时间及绑定账号。Query status, usage time and linked account for 1–100 CDKs.

POST/api/v1/cardkey/batch-status

请求体Request body

{
  "cardKeys": [
    "PLUS-VM3DNSJ3",
    "GO-ABCDEFGH"
  ]
}

cURL

curl -X POST "https://plus.getaiai.com/api/v1/cardkey/batch-status" \
  -H "Content-Type: application/json" \
  -d '{  "cardKeys": [    "PLUS-VM3DNSJ3",    "GO-ABCDEFGH"  ]}'

成功响应Success response

{
  "code": 0,
  "message": "success",
  "data": [
    {
      "cardKey": "PLUS-VM3DNSJ3",
      "valid": true,
      "status": 0,
      "statusDesc": "未使用"
    }
  ]
}
06 · 错误处理

常见业务错误码Common business errors

40001参数校验失败
42900请求过于频繁
60601CDK 不存在
60602CDK 已使用或锁定
60802产品库存不足
60803Session 无效
60804已有套餐,需确认覆盖
60805上游充值失败