16.5.1 创建会员卡
支持开发者调用该接口创建会员卡,并获取card_id,用于投放。
创建会员卡的接口如下。
https:// api.weixin.qq.com/card/create?access_token=ACCESS_TOKEN
创建会员卡时,POST数据示例如下。
{ "card":{ "card_type":"MEMBER_CARD", "member_card":{ "background_pic_url":"https:// mmbiz.qlogo.cn/mmbiz/", "base_info":{ "logo_url":"http:// mmbiz.qpic.cn/mmbiz/iaL1LJM1mF9aRKPZ/0", "brand_name":"方倍", "code_type":"CODE_TYPE_TEXT", "title":"方倍会员卡", "color":"Color010", "notice":"使用时向服务员出示此券", "service_phone":"020-88888888", "description":"不可与其他优惠同享", "date_info":{ "type":"DATE_TYPE_PERMANENT" }, "sku":{ "quantity":50000000 }, "get_limit":3, "use_custom_code":false, "can_give_friend":true, "location_id_list":[ 123, 12321 ], "custom_url_name":"立即使用", "custom_url":"http:// weixin.qq.com", "custom_url_sub_title":"6个汉字tips", "promotion_url_name":"营销入口1", "promotion_url":"http:// www.qq.com", "need_push_on_view":true }, "supply_bonus":true, "supply_balance":false, "prerogative":"test_prerogative", "auto_activate":true, "custom_field1":{ "name_type":"FIELD_NAME_TYPE_LEVEL", "url":"http:// www.qq.com" }, "activate_url":"http:// www.qq.com", "custom_cell1":{ "name":"使用入口2", "tips":"激活后显示", "url":"http:// www.xxx.com" }, "bonus_rule":{ "cost_money_unit":100, "increase_bonus":1, "max_increase_bonus":200, "init_increase_bonus":10, "cost_bonus_unit":5, "reduce_money":100, "least_money_to_use_bonus":1000, "max_reduce_bonus":50 }, "discount":10 } }}
上述数据的参数说明如表16-21所示。
表16-21 创建会员卡接口的参数说明
正确创建时,返回的数据示例如下。
{ "errcode":0, "errmsg":"ok", "card_id":"p1Pj9jr90_SQRaVqYI239Ka1erkI"}
上述数据的参数说明如表16-22所示。
表16-22 创建会员卡接口返回参数说明