加载中…
防伪查询 sn

模块说明

sn 提供产品防伪查询能力:输入防伪码(序列号)返回对应的产品信息。

鉴权级别:全部可选。

接口一览

方法 URL 鉴权 说明
GET /api/sn 可选 查询入口(rec=default)/ 兼容查询(rec=result)
GET /api/sn/search 可选 防伪查询(小程序约定形态)

查询入口 GET /api/sn

参数 必填 说明
rec 否 default(默认,返回入口标题)/ result(兼容查询,需附 code)
code rec=result 时必填 防伪码

rec=default 返回 title;rec=result 命中返回 item(产品信息),未命中 404 NOT_FOUND(sn_wrong)。

防伪查询 GET /api/sn/search

参数 必填 说明
code 是 防伪码
{
  "code": "OK",
  "message": "",
  "data": {
    "result": { "...": "产品信息" },
    "code": "ABC123456789"
  },
  "errors": {},
  "request_id": "9f2a5c8e1b3d7f40"
}
场景 响应
code 为空 422 INVALID_PARAMS,errors.code 提示为空
code 含非法字符 422 INVALID_PARAMS,errors.code 提示非法字符
防伪码不存在 404 NOT_FOUND(sn_wrong)

注意事项

  • search 为推荐形态(小程序 pages/sn 约定按 data.result / data.code 读取);rec=result 为兼容旧入口;
  • 本接口限流 20 次/60 秒(超限 429),适合扫码场景的高频提交。
添加日期:2026-10-06