文档
测试

4.4结算与退卡

POST
refundCustomer

接口描述

离店退卡结算,可以只退还卡内剩余余额,不回收卡片,下次还可再使用,直接充值;也可以退还卡内余额同时回收卡片

请求参数

参数名
类型
描述
必填
token
String
登录TOKEN
必填
appid
String
商户appid
必填
card_no
String
会员卡序列号或动态会员码
必填
action_type
int
结算类型:0为退款不退卡,1为退款并退卡
必填

响应参数

参数名
类型
描述
必填
code
int
错误码,成功返回 200,失败返回其它
必填
message
String
错误描述
必填
data
Object
对象,业务数据
必填
customer
Object
对象,会员对象,以下是部分重要的会员对象字段
必填
customer_id
Long
会员卡 ID
必填
customer_name
String
会员名
必填
cuttomer_code
String
会员卡编号
必填
customer_sn
String
会员卡序列号,同请交参数 card_no 值
必填
phone_number
String
手机号
必填
enabled
int
会员卡状态:1使用中,0挂失状,-1已注销
必填
balance
Double
会员卡余额,余额=本金余额+补贴/赠送余额
必填
cash
Double
本金余额
必填
subsidy
Double
补贴/赠送余额
必填

说明 / 示例

### 请求示例 ``` https://api2.XXX.cn/cm/refundCustomer?token=TOKEN&appid=jb25112e65f20e7dfe&card_no=0849800579&action_type=0 ``` ### 返回示例 #### 成功返回 JSON ``` { "code": 200, "message": "success", "data": { "result_msg": "退款成功", "result_code": "SUCCESS", "customer": { "shared": 1, "balance": 0.0, "subsidy": 0.0, "phone_number": "13899996666", "customer_name": "", "customer_id": 1581, "customer_sn": "0849800579", "create_date": "2021-05-24 11:26:04", "customer_code": "", "cash": 0.0, "update_date": "2021-05-25 19:06:50", "enabled": 1 } } } ``` #### 失败返回 ``` "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== 会员不存在或已注销,一般是会员序列号错误