畅捷通 T+ / T+Cloud
授权绑定(获取 openToken)
chanjet.authorize
HTTPS GET + POST
v1.0.0
▾
接口地址
https://openapi.chanjet.com/account/auth/getAuthUrl / token / refresh
鉴权方式
OAuth2 式授权码流程
获取 openToken 后才能调业务接口(库存/报表/仓库)
请求头
appKey必填 — 开放平台应用IDappSecret必填 — 开放平台应用密钥
请求体说明
- 第1步:拼接授权页 URL,用户登录后厂商回跳 redirect_uri?code=xxx
- 第2步:用 code 换 openToken(含 refresh_token 与 user_auth_permanent_code)
- user_auth_permanent_code 务必持久化:openToken 约 2h 过期,过期后用它换发,无需用户重登
请求示例
1) 拼接授权 URL → 浏览器打开 → 用户登录
2) 回跳 https://your-app/callback?code=AUTH_CODE
3) POST /token { grant_type:'authorization_code', code:'AUTH_CODE', appKey:'h8fP2Fq0' }
→ { openToken, refresh_token, user_auth_permanent_code }响应示例
{
"openToken": "user_auth_token_xxx",
"refresh_token": "refresh_xxx",
"user_auth_permanent_code": "permanent_xxx"
}字段说明
openTokenstring — 用户授权令牌(业务接口用)refresh_tokenstring — 刷新令牌user_auth_permanent_codestring — 永久码,过期换发用,必须持久化
错误码
404 on refreshrefresh_token 失效/未持久化 permanentCode → 引导用户重新授权绑定invalid_clientappKey/appSecret 不匹配 → 检查开放平台应用凭证
实战 tips
- 最关键坑:user_auth_permanent_code 必须落盘,否则 2h 后只能让用户重绑
- redirect_uri 必须在畅捷通开放平台白名单内