文档
测试

3.5末笔查询

POST
getLastOrder

接口描述

查询指定消费卡的最后一笔已支付的消费订单

请求参数

参数名
类型
描述
必填
token
String
登录TOKEN
必填
appid
String
商户appid
必填
card_no
String
会员卡号或动态会员码
必填

响应参数

参数名
类型
描述
必填
code
int
错误码,成功返回 200,失败返回其它
必填
message
String
错误描述
必填
data
Object
对象,业务数据
必填
saleorder
Object
对象,订单对象,以下是部分重要字段
必填
order_id
Long
订单 ID
必填
total_amount
Double
订单金额
必填
sale_date
String
下单时间, 时间格式为 yyyy-MM-dd HH:mm:ss
必填
customer_sn
String
会员卡号
必填
customer_name
String
会员名
可选
customer_code
String
会员卡编号
可选
pay_status
int
支付状态:0未支付,1已支付,-2已退款
必填
trade_status
int
交易状态:0未付款,1已完成,-1已取消,-2已退款
必填
update_date
String
订单最后更新时间,时间格式为 yyyy-MM-dd HH:mm:ss
必填
payment
String
支付方式:BALANCE会员卡余额支付,CASH 现金支付,WEIXIN微信支付,ALIPAY 支付宝支付
必填

说明 / 示例

### 请求示例 ``` https://api2.XXX.cn/cm/getLastOrder?token=TOKEN&appid=jb25112e65f20e7dfe&card_no=1234 ``` ### 返回示例 #### 成功返回 JSON ``` { "code": 200, "message": "success", "data": { "saleorder": { "open_id": "", "description": "青椒炒牛肉 1份", "outlet_name": null, "update_date": "2021-05-24 12:46:07", "pay_status": 1, "outlet_id": 34000, "sale_date": "2021-05-24 12:46:07", "total_amount": 30.0, "trade_status": 1, "payment": "BALANCE", "customer_id": 1581, "customer_sn": "0849800579", "create_date": "2021-05-24 12:46:07", "order_id": 11017, "sale_order_no": "162183156747372183", "customer_code": "" } } } ``` #### 失败返回 ``` "code": 1502, "message": "business.error.netShopId.isnotExist", "data": "" } ``` ==business.error.netShopId.isnotExist== 商户appid不存在 ``` "code": 4005, "message": "business.error.customer.notFound", "data": "" } ``` ==business.error.customer.notFound== 会员不存在或已注销,一般是会员序列号错误