兑换系统开放接口


三方授权回调

<h2>三方授权回调</h2> <ul> <li>三方平台用户授权成功后,平台会回调通知商家,通知路径使用[获取授权链接](<a href="https://www.showdoc.com.cn/1550488137087711/10972833568794780">https://www.showdoc.com.cn/1550488137087711/10972833568794780</a> &quot;获取授权链接&quot;)接口中的传参<code>callbackUrl</code>;</li> <li>回调时以<strong>POST</strong>的方式请求,请求参数为<strong>JSON格式的字符串</strong>,方便商家验签,验签相关参数以Http头的方式传递;</li> <li>商家接收到回调请求后应对请求验签,验签方法及示例代码可参考[签名验证](<a href="https://www.showdoc.com.cn/1550488137087711/7428723198459088">https://www.showdoc.com.cn/1550488137087711/7428723198459088</a> &quot;签名验证&quot;);</li> <li>商家的回调接口处理完成后,应返回字符串<strong>SUCCESS</strong>表示成功(不区分大小写),返回其它信息或者异常表示回调失败;</li> </ul> <p><strong>Type:</strong> POST</p> <p><strong>Content-Type:</strong> application/json; charset=utf-8</p> <p><strong>Description:</strong> 三方授权回调</p> <p><strong>Request-headers:</strong></p> <table> <thead> <tr> <th>Header</th> <th>Type</th> <th>Description</th> <th>Required</th> <th>Since</th> </tr> </thead> <tbody> <tr> <td>businessId</td> <td>string</td> <td>业务ID,由平台提供</td> <td>true</td> <td>-</td> </tr> <tr> <td>nonce</td> <td>string</td> <td>随机字符串,需保证每次请求不同</td> <td>true</td> <td>-</td> </tr> <tr> <td>timestamp</td> <td>string</td> <td>时间戳,毫秒值</td> <td>true</td> <td>-</td> </tr> <tr> <td>sign</td> <td>string</td> <td>签名值</td> <td>true</td> <td>-</td> </tr> </tbody> </table> <p><strong>Body-parameters:</strong></p> <table> <thead> <tr> <th>Parameter</th> <th>Type</th> <th>Description</th> <th>Required</th> <th>Since</th> </tr> </thead> <tbody> <tr> <td>serialNo</td> <td>string</td> <td>流水号(获取授权链接时参数中的流水号)</td> <td>true</td> <td>-</td> </tr> <tr> <td>userId</td> <td>string</td> <td>商家客户唯一标识</td> <td>true</td> <td>-</td> </tr> <tr> <td>openId</td> <td>string</td> <td>三方用户标识(如支付宝openId)</td> <td>true</td> <td>-</td> </tr> <tr> <td>avatar</td> <td>string</td> <td>三方用户头像</td> <td>true</td> <td>-</td> </tr> <tr> <td>nickName</td> <td>string</td> <td>三方用户昵称</td> <td>true</td> <td>-</td> </tr> </tbody> </table> <p><strong>Request-example:</strong></p> <pre><code>curl -X POST -H 'Content-Type: application/json; charset=utf-8' -H 'businessId:55' -H 'nonce:55' -H 'timestamp:1628757969177' -H 'sign:55' -i /v1/openapi/auth/callback? --data '{ &amp;quot;serialNo&amp;quot;: &amp;quot;abcd&amp;quot;, &amp;quot;userId&amp;quot;: &amp;quot;user1&amp;quot;, &amp;quot;openId&amp;quot;: &amp;quot;openid123&amp;quot;, &amp;quot;avatar&amp;quot;: &amp;quot;https://tfs.alipayobjects.com/images/partner/ATpJCqQbMtTNsAAAAAAAAAAAAADtl2AA&amp;quot;, &amp;quot;nickName&amp;quot;: &amp;quot;ABC&amp;quot; }'</code></pre> <p><strong>Response-example:</strong></p> <pre><code>SUCCESS</code></pre>

页面列表

ITEM_HTML