diff --git a/order/truck/zsh/2022121401/订单接口.md b/order/truck/zsh/2022121401/订单接口.md index c54a0b8..e20b6d4 100644 --- a/order/truck/zsh/2022121401/订单接口.md +++ b/order/truck/zsh/2022121401/订单接口.md @@ -176,7 +176,7 @@ public class Sample { public static void main(String[] args_) { String appKey = "appkey"; String appSecret = "appSecret"; - String jsonData = "订单下单Body参数JSON数据"; + String jsonData = "委托单Body参数JSON数据"; ZYClient zyClient = new ZYClient(appKey, appSecret); HttpResponseData httpResponseData = zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/add", "accessToken", jsonData); @@ -192,6 +192,69 @@ zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/add", "accessTo } ``` +## 拒单集成接口 + +### 简要描述 + +拒单集成接口 + +### 请求URL + +· 测试环境:https://test.shjiuze.cn/oms-service-api/zshOrder/cancelOrder + +· 生产环境:https://gw.shjiuze.cn/oms-service-api/zshOrder/cancelOrder + +### 请求方式 + +POST + +### Headers参数 + +| 名称 | 类型 | 必填 | 示例值 | 描述 | +| ------------- | ------ | -------------------------- | -------------------------------- | ------------------------------------------------------------ | +| Authorization | String | 是     | Bearer a2c5680001 | 调用服务端API的应用凭证accessToken,通过调用获取访问凭证接口获取。 | +| appKey | String | 是 | 0867ef5f23ef446483749e19e1692b40 | 则一提供 | +| timestamp | String | 是 | 1643251533306 | 当前时间戳毫秒值 | +| nonce | String | 是 | gdst9t | 6位小写字母数字组合随机串 | +| sign | String | 是 | fa3ed338d6dfe18e7273c8692234ee70 | 签名:appKey(则一提供) + appSecret(则一提供) + timestamp + nonce(6位随机码) + data(body参数)通过md5(32位小写)算法生成 | + +### Body参数 + +参数Json. + +### 返回结果正常示例 + + { "success": true, "businessException": false} + +### 返回结果异常示例 + + { "success": false, "businessException": true, "errorCode": "500", "message": "XXX异常!"} + +### 请求示例 + +##### Java-sdk方式 [下载SDK](https://zeyi-tms-product.oss-cn-hangzhou.aliyuncs.com/file/jar/java-sdk/zy-java-sdk-1.0.0.jar) + +```java +public class Sample { + public static void main(String[] args_) { + String appKey = "appkey"; + String appSecret = "appSecret"; + String jsonData = "拒单Body参数JSON数据"; + ZYClient zyClient = new ZYClient(appKey, appSecret); + HttpResponseData httpResponseData = +zyClient.doPost(Constants.TEST_HOST + "/oms-service-api/zshOrder/cancelOrder", "accessToken", jsonData); + if(httpResponseData == null) { + throw new BusinessException("则一请求失败,返回结果为空!"); + } + if(httpResponseData.getStatus() == HttpURLConnection.HTTP_UNAUTHORIZED) { + //重新获取token再次请求 + httpResponseData = zyClient.doPost(Constants.TEST_HOST + + "/oms-service-api/zshOrder/cancelOrder", "accessToken", jsonData); + } + } +} +``` + ------------------------------------------------------------------------------------------ -- libgit2 0.21.0