开发指南 官网
API 3.0 > 7.4 优惠券相关操作 > 7.4.9 优惠券核销

7.4.9 优惠券核销

开启令牌和权限后可调用。签名方式请查看开发指南
场景描述: 经过业务处理的-优惠券核销

请求地址

请求方式 版本信息 请求地址
POST V3 http://openapi.zvcms.com/v3/crm/coupon/writeOffCoupon

公共参数

参数 参数类型 是否必填 默认值 描述
openId string 密钥Id
grantCode string 授权code
token string 签名,参考《数字签名sign》
timestamp string 当前时间戳
nonce string 随机正整数
params array 业务参数

请求参数

参数 参数类型 是否必填 默认值 描述
bizId string 业务标识 对应响应参数的 bizId【冲正时以返回参数中的bizId为准 】
channel string 账户名
customerId int 用户id,当couponsCardList是扫码核销码时非必传,其他情况下必传
groupId int 集团ID
couponsCardList array 用户优惠券id,多个 [390962138708451328](次券核销时,只允许一个)
type int 当 type=1时, couponsCardList 传 扫码核销码
ext array
 ├channelType int 核销渠道:1-支付宝 ,2-微信, 3-pos, 4-美团, 5-饿了么, 6-有赞商城, 7-三方
 ├multiStoreId int 核销门店id
 ├multiStoreMark string 核销门店编码, 纸质券核销必传, 鉴于pos端无法区分是否是纸质券, 所以每次请求时都带上门店编码
 ├orderNo string 订单号
 ├reason string 原因
useCount int 使用次数(次券类型必填,且couponsCardList只允许一个)会根据此字段判断是不是次券核销
tradeMarks array 商品编码数组, 纸质券核销时可能需要商品信息
amount int 该优惠券的核销金额/分
orderAmount int 此次核销的关联订单的订单金额/分
thirdOrderNo string 三方订单号

响应参数

参数 参数类型 描述
bizId int 业务标识
cardIdList array 优惠券核销码 对应会员详情中的cardId
userInfo array
 ├customer_id int 会员id
 ├birthday string 会员生日
 ├username string 会员名称
 ├nickname string 会员昵称
 ├phone string 会员手机号
 ├gender string 会员性别
 ├province int 省:公司统一管理的代号
 ├city int 市:公司统一管理的代号
 ├district int 区:公司统一管理的代号

请求示例

{
    "openId": "6dc05b4ac175cf316d226252b05cf685",
    "grantCode": "782c281f62",
    "timestamp": "1547186244",
    "nonce": "658965",
    "token": "0%2B%2B3c6hthjwAml4ABAXOYF4Q6UY%3D",
    "params": {
        "bizId": "paywewre121",
        "channel": "",
        "customerId": "",
        "groupId": "",
        "couponsCardList": "[390962138708451328]",
        "type": "",
        "ext": {
            "channelType": "",
            "multiStoreId": "",
            "multiStoreMark": "",
            "orderNo": "",
            "reason": ""
        },
        "useCount": "",
        "tradeMarks": "",
        "amount": "",
        "orderAmount": "",
        "thirdOrderNo": ""
    }
} 

响应示例

{
    "status": "true",
    "code": "0",
    "message": "说明",
    "data": {
        "bizId": "paywewre121",
        "cardIdList": "[390962138708451328]",
        "userInfo": {
            "customer_id": "",
            "birthday": "",
            "username": "",
            "nickname": "",
            "phone": "",
            "gender": "",
            "province": "",
            "city": "",
            "district": ""
        }
    }
}

异常示例

{
    "status": true,
    "code": "异常编码,根据不同的业务返回编码",
    "message": "异常说明:查询的信息不存在"
}

错误码

{
    "status": false,
    "code": "系统错误编码:详见全局返回编码",
    "message": "系统错误说明"
}

免费升级

营销功能、插件持续每月更新开发升级

免费专业培训

每月建站、微信营销、电商等互联网增值培训

7×24小时服务支持

400电话、QQ、微信、在线等多渠道售后支持

 

安徽智迈科技股份有限公司 版权所有 Copyright 2009-2018 皖公网安备 34019202000074号 增值电信业务经营许可证:皖B2-20170075