文档
测试

3.2取消订单【可选】

POST
cancelOrder

接口描述

下单后, 取消未支付的消费订单

请求参数

参数名
类型
描述
必填
token
String
登录TOKEN
必填
appid
String
商户appid
必填
order_id
Long
订单ID,下单成功返回的
必填

响应参数

参数名
类型
描述
必填
code
int
错误码,成功返回 200,失败返回其它
必填
message
String
错误描述
必填
data
Object
对象,业务数据,此接口成功业务数据返回空对象
必填
saleorder
Object
对象,订单对象,以下是部分重要字段(不是全部字段)
可选
order_id
Long
订单 ID
必填
totam_amout
Double
订单金额
必填
sale_date
String
下单时间,格式为:yyyy-MM-dd HH:mm:ss
必填
customer_sn
String
会员卡号
必填
pay_stauts
int
支付状态:0为未支付,1为支付
必填
trade_status
int
订单交易状态,-1表示取消成功,0表示都未支付,1表示已支付交易完成。
必填
update_date
String
订单状态更新时间,格式为:yyyy-MM-dd HH:mm:ss
必填

说明 / 示例

### 请求示例 ``` https://api2.XXX.cn/cm/cancelOrder?token=TOKEN&appid=jb25112e65f20e7dfe&order_id=123 ``` ### 返回示例 #### 成功返回 JSON ``` { "code": 200, "message": "success", "data": { "saleorder": { "order_id": 123, "totam_amout": 50.00, "customer_sn": 1234, "sale_date": "2021-05-15 10:25:05", "trade_status":-1, "pay_status": 0.0, "update_date": "2021-05-15 10:27:05" } } } ``` #### 失败返回 ``` "code": 1502, "message": "business.error.netShopId.isnotExist", "data": "" } ``` ==business.error.netShopId.isnotExist== 商户appid不存在 ``` "code": 8302, "message": "business.error.osaleOrder.notFound", "data": "" } ``` ==business.error.saleOrder.notFound== 订单不存在,一般是订单 ID 错误