开放平台

消费收银
当消费明细为空时,等同于快速消费
支持B扫C

请求地址(POST)

https://openapi.1card1.cn/OpenApi/Consume?openId=[OpenId]&signature=[Signature]&timestamp=[TimeStamp]

字段 说明
OpenId 登陆开放平台生成的OpenId
Signature 签名=md5(OpenId+Secret+Timestamp+data),格式:32位md5大写加密
TimeStamp 发起请求的时间戳,查看标准timestamp

请求说明

data={"cardId": "1card1Test","password": "123456","userAccount": "10003", "totalMoney": 40,"totalPaid": 40,"paidMoney": 6, "paidPoint": 7,"paidValue": 8,"paidCard": 5,"paidOther": 0,"otherPayType": "美团券","paidCoupon": 10, "thirdPayInfo":{"thirdPayType":"1","thirdPayValue":"4","authCode":"1346913505024158XX"}, "meno":"熟人小李推荐,打折","consumeList": [{"barcode": "0001","name": "123","number": 1, "disCount": 0.8,"paidMoney": 22,"meno": ""},{"barcode": "0002","name": "456","number": 2,"disCount": 1,"paidMoney": 18,"meno": ""}],"couponList": [{"sendNoteGuid": "AE3166F5-DEEF-4FCD-B984-0683329BAB63","count": 1}, {"sendNoteGuid": "BE3166F5-DEEF-4FCD-B984-0683329BAB63","count": 2}],"thirdOpenId":"","deviceType":2,"uniqueCode":"1516612635"}

字段 是否必须 说明
cardId 卡号(为空时表示散客,此时paidValue、paidPoint不生效)
password 会员密码(会员系统中设置储值消费或者积分消费需要密码时,此项必须)
userAccount 工号
totalMoney 应付金额
totalPaid 实付金额
paidMoney 现金支付
paidPoint 积分抵现(金额,cardId为空时不生效)
paidValue 储值支付(cardId为空时不生效)
paidCard 银联支付
paidCoupon 优惠券支付(新增参数。此参数为0或者为空时,couponList参数无效)
thirdPayInfo B扫C参数
thirdPayType:支付类型,1:微信,2:支付宝
thirdPayValue:支付金额
authCode:付款码
paidOther 其他支付(金额)
otherPayType 其他支付类型(其他支付的别名,在“系统设置-参数设置-其他参数-支付方式名称”中设置)
meno 单据备注
consumeList Json字符串(barcode:商品编码 (通过接口“获取商品列表”获得“Barcode”字段) ;name:商品名称;disCount:商品折扣;number:商品数量; paidMoney:该明细总应付金额;meno:此明细的备注)
"consumeList":[] 或者不传consumeList,等同于快速消费
couponList Json字符串(sendNoteGuid:优惠券发送记录唯一标识 (通过接口“获取已发送优惠券”获得“Guid”字段) ;count:核销数量)
此参数为空时,paidCoupon无效
thirdOpenId 微信openid 或支付宝的user_id(供支付即会员使用,与deviceType共同生效)
deviceType 设备登录类型:1,表示微信登录;2表示支付宝(供支付即会员使用,与thirdOpenId共同生效)
uniqueCode 唯一码(实现幂等,如果该唯一码已经执行成功,则不会再执行,并返回相关联的单据号)

返回说明

成功时返回:

{"status":0,"message":"消费成功!","billNumber":"XF20140524000015","orderNumber":"","availablePoint":999,"availableValue":888,"consumeNotePoint":999}

失败时返回:

{"status":-1,"message":"消费失败及原因"}

字段 是否必须 说明
status 状态(-1:失败,0:支付成功、消费成功,1:待支付)
message 消费是否成功及提示
billNumber 消费成功之后的单据号
orderNumber 移动支付订单号(用于查询移动支付状态)
availablePoint 剩余积分
availableValue 剩余储值
consumeNotePoint 产生积分

会员消费 调试