店铺授权
需要验证签名
接口描述
店铺授权。
提示
- 该接口为授权申请接口,最终授权结果将通过异步回调通知业务方,业务方也可以通过查询接口获取授权结果。
- 授权失败或授权过期时,调用该接口修改授权信息重新授权。
- KEY授权时,授权信息(token和api_key,api_secret二选一) ,请根据平台要求选择上传【点击见附录】
- 【点击了解】授权细节
- 相同的授权信息(auth_info)不允许授权给多个店铺
- 如果URL授权且redirect_url存在,在三方平台授权后重定向到机构提供的redirect_url,参数参考【点击见附录】 重定向GET请求地址,参考: redirect_url?client_id=IT8623103002373684730&store_id=sd2312190165424268&seller_id=myshop2023&auth_status=SUCCESS&auth_fail_reason=""
请求头
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | M | access_token |
| Content-Type | string | M | application/json |
请求参数
Request:
| Parameter | Type | Required | Description |
|---|---|---|---|
| client_id | string(64) | M | PP用户唯一ID |
| store_id | string(64) | M | 店铺ID(PP侧店铺标识) |
| seller_id | string(64) | C | 第三方平台店铺标识,部分平台必填,点击见附录 |
| auth_type | enum | M | 授权类型:URL:通过跳转链接的方式授权、KEY:通过绑定开发者账号的方式授权 |
| auth_info | Object | C | 授权信息,授权类型为KEY时必填 |
| redirect_url | string(255) | O | 授权类型为URL时选填,KEY授权不用填,授权后浏览器跳转到该授权结果展示页 |
auth_info:
| Parameter | Type | Required | Description |
|---|---|---|---|
| token | string(2048) | C | 授权的token |
| api_key | string(2048) | C | 授权的key |
| api_secret | string(2048) | C | 授权的密钥 |
返回响应
| Parameter | Type | Required | Description |
|---|---|---|---|
| auth_url | string | C | 授权地址(URL跳转授权存在,客户点击该URL进行授权) |
返回示例
- 成功
- 失败
{
"code": 200,
"message": "SUCCESS",
"data": {
"auth_url": "https://8288sellerId.myshopline.com/admin/oauth-web/#/oauth/authorize?appKey=60ef9ba14340a7c4d0a72cb4391fa09807b1ca18&responseType=code&scope=read_orders&redirectUri=https%3A%2F%2Fdev-store-center-auth.pingpongx.com%2Fapi%2Fv1%2Fauth%2Fshopline%2Fcb&customField=SD2310250004697640"
}
}
{
"code": 901010,
"message": "store not exist",
"data": null
}
错误码
| 返回码 | 描述 | 解决方案 |
|---|---|---|
| 900000 | system error | 系统错误,请联系PingPong技术人员核查 |
| 900002 | illegal param | 参数有误,请根据提示更正信息 |
| 940002 | store not exist | 检查store_id |
| 900003 | seller id already authorized | 更换seller_id |
| 900004 | repeat authorized | 授权成功后不允许重复授权 |