# 用户下单使用会员权益

# 接口说明

  • 用户提交订单时(未支付成功),如使用了会员权益,将通知商家,商家实时回调,确认没问题才能以此金额下单。该接口需要商家小程序侧上线

  • 微信开放平台CallBack回调机制说明:消息推送

相关 API 接口:

# 请求参数说明

参数 类型 是否必填 说明
ToUserName string 小程序UserName
FromUserName string 小程序用户OpenID
CreateTime number 事件时间,Unix时间戳
MsgType string 消息类型,固定为event
Event string 事件类型,固定为channels_ec_order_use_vip_discount
order_info.shop_appid string 店铺appid
order_info.order_session_id string 下单页面的会话id
order_info.scene number 场景:1-自购,2-群送礼,3-单聊送礼
order_info.unique_id string 用户某次下单行为的唯一id
order_info.price_info.product_price_before_vip_discount number 会员优惠前商品价格(单位:分)
order_info.price_info.vip_discounted_price number 会员优惠总金额(单位:分)
order_info.price_info.product_price_after_vip_discount number 会员优惠后商品价格(单位:分)

# 请求参数示例

具体取决于你配置的数据格式(JSON或XML)

{
	"ToUserName": "gh_*",
	"FromUserName": "OPENID",
	"CreateTime": 1662480000,
	"MsgType": "event",
	"Event": "channels_ec_order_use_vip_discount",
	"order_info": {
       "shop_appid": "shop_appid",
		"order_session_id": "order_session_id",
		"scene": 1,
		"unique_id": "37xxxxxxxxxxx",
		"price_info": {
			"product_price_before_vip_discount": 10000,
			"vip_discounted_price": 1000,
			"product_price_after_vip_discount": 9000
		}
	}
}

# 返回参数说明

参数 类型 是否必填 描述
errcode number 错误码
errmsg string 错误信息
result number 下单确认结果, 1: 允许下单,2:不允许下单,本字段为空或者填写其他值时拦截下单

# 返回参数示例

具体取决于你配置的数据格式(JSON或XML)

{
    "errcode": 0,
    "errmsg": "ok",
    "result": 1
}