Member Card Area (2)


8 Managing membership cards

8.1 Pulling member information (points query) interface

Interface description

Support developers to query member information based on card_id and Code, including activation information, points information, balance and other information.

Interface call request description

HTTP请求方式: POSTURL:https://api.weixin.qq.com/card/membercard/userinfo/get?access_token=TOKEN

Parameter description

##Parameter                                                                                                                                JSON data                                   #

Return data

{   "card_id": "pbLatjtZ7v1BG_ZnTjbW85GYc_E8",   "code": "916679873278"}
##POST data               is              
Call interface credentials                                                                                                                                                                                                                                               Required           Description                                                                                                                ## Code is the code value received by the user from
Error Message                                             ’ ’s ’s ’s digit to to 0 Unique identification code within the code User Nickname ##bonus Points information BALANCE balance information Sex # User_info # Custom_field_list The membership card membership information category set by developers, such as level. name                                                                                                                            For example, level value, etc. user_card_status Current user membership card status, NORMAL Normal EXPIRE Expired GIFTING Transfer in progress GIFT_SUCC Transfer successful GIFT_TIMEOUT Transfer timeout DELETE Deleted, UNAVAILABLE invalid Interface description
{
    "errcode": 0,
    "errmsg": "ok",
    "openid": "obLatjjwDolFjRRd3doGIdwNqRXw",
    "nickname": "Fourier",
    "membership_number": "316510891298",
    "bonus": 460,
    "sex": "MALE",
    "user_info": {
        "common_field_list": [
            {
                "name": "USER_FORM_INFO_FLAG_MOBILE",
                "value": "15521328888"
            },
            {
                "name": "USER_FORM_INFO_FLAG_NAME",
                "value": "微信"
            }
        ],
        "custom_field_list": []
    },
    "user_card_status": "NORMAL"
}
Parameter description##POST data             is             Json data              
Parameter name                                                                                                                                        code, 0 is normal                                                   errmsg              
nickname
## user gender
8.2 Change membership card information interface
Supports changing membership card surface information and card information Voucher attribute information. Interface call request description
##Parameter                                                                                                                                       
##access_token            

is        

Call interface credentials

POST data

HTTP请求方式: POSTURL:https://api.weixin.qq.com/card/update?access_token=TOKEN

Support modification fields:

base_info field:

Usage reminder, the maximum number of characters is 16 Chinese characters. ##service_phone                                                                                                                                                                                                                                                                               ’ ’   ’ 1 1 to to 1 t t ​ ​ ​ ​ ​ ​ ​ ​ in boolThe name of the jump button in the middle of the membership card is , which is recommended for use.##center_sub_title No Explanation wording                                              The button in the middle of the card corresponds to the url that jumps to custom_url_name ##Customize the name of the jump entrance. custom_url                                                                                             The redirected URL. custom_url_sub_title                                                                                                                                                prompt.            Custom entry name of marketing scenario. ##get_limit                                                                                                                                                                                                                                                                                          Begin_timestamp No unsigned into The date range is special and indicates the start time. (The unit is seconds) ## End_timestamp No unsigned into , indicating the end time. The end time can only be extended later.         

Modification of exclusive fields for membership cards:

Special note that the following fields that support updating are not in the structure of basic information base_info.

Parameter name Type                                                                                                                                                                   ​128)                                                                                                                                                                                                                                                              ​ notice                                                                                            Verify cards and coupons.​ ​ ​ ​ ​
##description               is             string (3072)            

cannot be used in conjunction with                    

other offers Enjoy

Instructions for use.        
##location_id_list No . use_all_locationsNo
#trueSupports all stores, fill in the coupon store Updated following merchant store updatescenter_title                                                                                                                                 
##promotion_url_name         No                   string(16)                -                   Product introduction.​ ​ ​
promotion_url                                                                                                                                           The address link to the external link.                                                                                                              # String (18) .​ ​ ​ ​ The prompt displayed on the right side of the marketing entrance.                                                                                                        
Code code display type, “CODE_TYPE_TEXT” text “CODE_TYPE_BARCODE” one-dimensional code ”CODE_TYPE_QRCODE two-dimensional code "CODE_TYPE_ONLY_QRCODE" Only the QR code is displayed

"CODE_TYPE_ONLY_BARCODE"

Only the 1D code is displayed
"CODE_TYPE_NONE"

No Show any pattern

ain_share # Bool False
#can_give_friend                                                                                                                                                                                                                     bool No No Time stamp, does not support filling in 2
Points clearing rules.          ##bonus_rules         is             string(3072)                 Points rules.         ##prerogative           is             string(3072)                 - Privilege description. No When true, the card will support one-click card opening. For details, see . This option is mutually exclusive with activate_url. No When set to true, the user's membership card will be automatically set to activation. For details, see .          ##custom_field3               No                                                                                                                                                                                                                                                                                              FIELD_NAME_TYPE_LEVEL LevelFIELD_NAME_TYPE_COUPON CouponFIELD_NAME_TYPE_STAMP StampFIELD_NAME_TYPE_DISCOUNT Discount FIELD_NAME_TY PE_ACHIEVEMEN ACHIEVEMENTFIELD_NAME_TYPE_MILEAGE                         No #The upper limit of points obtained in a single time                                                                                                                                                                                  Cost_bonus_unit No stet ##reduce_money #No                                                                                            ##Parameter name                 Description             Error message.           

Developer Notes

1. After changing some fields of the card and coupon, it will be resubmitted for review. For details, see the field description. After the update is successful, you can check the update result by calling the interface to view card and coupon details. ;

2. Only fill in the fields that need to be updated. Many developers will fill in fields such as brandname that do not support modification when calling this interface, causing the update to be unsuccessful.

3. After calling this interface to change the card and coupon information, be sure to call the View card and coupon details interface to verify whether the change has been successful.

8.3 Set follow recommendations

Function introduction

Support developers to configure cards or set up jumps at the bottom of the points change message Chain URL, the specific form is as shown below, it can be a URL or a coupon.

领券页面

Developer Notes

1. Support two types of following recommended configurations

1. Advertising slogan URL supports merchants to configure copywriting with a length of 16 Chinese characters and click-to-jump links.

2. Recommend cards and coupons, allowing merchants to configure a card and coupon under this official account.

2. Recommendation position validity period control

1. Advertising slogan URL type supports merchants to customize the display time according to the activity period.

2. Recommended card and coupon types. The validity of the cards and coupons will be determined by the WeChat backend. When the cards and coupons have expired, been collected, or have been set as invalid, they will be automatically removed from the shelves for display. .

8.3.1 Set up the following recommendation interface

Interface description

Calling the update card and coupon information interface will add The recommendation field is updated to the cards and coupons that have successfully passed the review. It also supports filling in the corresponding fields when creating cards and coupons.


Interface details

Interface call request description

{   "errcode":0,   "errmsg":"ok",  "send_check":true}

Parameter description

# Parameter name whether to pilit #background_pic_url           No                                                          - ##is           string(3072)            
##balance_rules          is            string(3072)                                                                                                                                                 
One-click card opening
Automatic activation
activate_urlNo string(128)
Activate link
custom_field1                                                                                                                                                                                    .                                                                                                                                                                                                        ​        
url                                                                                                                          custom_cell1                                                                                                            ## Bonus_rule JSON Structure
int
## every 5 points. #least_money_to_use_bonus           No #int               Discount, the discount benefit enjoyed by this membership card                                                                                                   
{
    "card_id": "ph_gmt7cUVrlRk8swPwx7aDyF-pg",
    "member_card": {
        "background_pic_url": "https://mmbiz.qlogo.cn/mmbiz/0?wx_fmt=jpeg",
        "base_info": {
            "logo_url": "http:\/\/www.supadmin.cn\/uploads\/allimg\/120216\/1_120216214725_1.jpg",
            "color": "Color010",
            "notice": "使用时向服务员出示此券",
            "service_phone": "020-88888888",
            "description": "不可与其他优惠同享\n如需团购券发票,请在消费时向商户提出\n店内均可使用,仅限堂食\n餐前不可打包,餐后未吃完,可打包\n本团购券不限人数,建议2人使用,超过建议人数须另收酱料费5元/位\n本单谢绝自带酒水饮料",
            "location_id_list": [
                123,
                12321,
                345345
            ]
        },
        "bonus_cleared": "aaaaaaaaaaaaaa",
        "bonus_rules": "aaaaaaaaaaaaaa",
        "prerogative": "",
        "auto_activate": true,
        //也可以填写wx_activate"activate_url":""
    }
}
##errcode                                                                                                                   to be taken.            errmsg          
send_check                   Whether this update needs to be reviewed, true means it is required, false means it is not needed.         
Parameters                                                                ##Is it necessary                                                                                                                                      ##POST data                                                                                                                                                                      ​

Use messages to configure coupons

http请求方式: POSThttps://api.weixin.qq.com/card/update?access_token=TOKEN


Use messages to configure URL

{
    "card_id": "ph_gmt7cUVrlRk8swPwx7aDyF-pg",
    "member_card": {
        "modify_msg_operation": {
            "card_cell": {
                "end_time": 1452724561,
                "card_id": "p1Pj9jr90_SQRaVqYI239Ka1erkI"
            }
        }
    }
}

Field description

##Field name​​​​ Note Card_id URL_CELL ## Links Recommended Bit. Json structure reference example. card_id                                                                                                                                                                                                  deadline.            text           Text content.            url             Jump link. Return data
{
    "card_id": "ph_gmt7cUVrlRk8swPwx7aDyF-pg",
    "member_card": {
        "modify_msg_operation": {
            "url_cell": {
                "end_time": 1452724561,
                "text": "更多优惠",
                "url": "www.qq.com"
            }
        }
    }
}
Field descriptionField name             # error code # #errmsg                                                                                                                                                                           
## i i ID.                                                                                                                                                                                                                                                                         ​Json structure reference example.
, 0 is normal; 43008 is the merchant without opening WeChat payment permissions;

8.4 Set up payment as a member

8.4.1 Add payment as a member rule interface

Merchants who have opened WeChat payment can set it. After WeChat payment, a card collection message is automatically sent to the user, and the user can receive the membership card by clicking on the message.​

201610130915202689.jpg

Interface Description

Supports merchants to set payment-as-membership rules, and can issue membership cards based on time periods and amount ranges.

Interface call request description

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

Parameter description

##Parameter                                                                                                                                       Json data               ##access_token             is         Call interface credentials
HTTP请求方式: POST
URL:https://api.weixin.qq.com/card/paygiftmembercard/add?access_token=TOKEN
##POST data             is            
POST dataField description

Field Name        

Description                                                                                                                                                                         

card_id jump_url                                                                                                                                                                          ​## List of merchant accounts that support coupon rules                                                                                                                                                              end_time       Max_cost This rule Effective Payment amount is limited, and it is divided into unit ##Q The set merchant number, the default is true

Return data description

Data example:

{
    "card_id": "xxxxxxxxa",
    "jump_url": "mp.weixin.qq.com/wiki",
    "mchid_list": [
        "123",
        "1234",
        "12345"
    ],
    "begin_time": 146324567,
    "end_time": 147234567,
    "min_cost": 1000,
    "max_cost": 10000000,
    "is_locked": true
}
Rule end time                                                                                                                             to                 ’ ’       ’ ’ s   ’ ward ’ ‐ ‐ ‐ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​​
zhe_locked
#mchid                                                                                                                                                                   The currently occupied appid must be used by the merchant to unbind and then reset.         

Developer Notes

1. The membership card collection message is only sent once to a single new user. If the user has already received or received the membership card, it will not be sent repeatedly;

2. The coupon appid of card_id set by this rule must be consistent with the subject appid of the current mch_id, otherwise error 72001 will be reported;

3. Only membership card type coupons are supported, otherwise an error will be reported: 72003;

4. When setting up payment as a membership, you must confirm that the appid of the calling interface is consistent with the current card_id body, and that the appid is consistent with mchid There is a binding relationship, otherwise an error will be reported: 72002;

5. It must be ensured that mchid has not been set by other appid before, otherwise an error 72004 will be reported;

6. Only 100 mchids can be set at a time. If the number exceeds 100, please call this interface multiple times.

8.4.2 Delete payment as membership rule interface

Delete the payment as membership rule that has been set before.

Interface Description

Supports merchants to set payment-as-membership rules, and can issue membership cards based on time periods and amount ranges.

Interface call request description

{
    "errcode": 0,
    "errmsg": "ok",
    "succ_list":[
    "134xxxxxx"
    ],
    "fail_list":[
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        },
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        }
    ]
}

Parameter description

Parameter name               Description              
errcode           Error code, 0 means normal.           
errmsg           Error message.
succ_list                                                                                                                                                                                ​
##Parameter                                                                                                                                       Json data               ##access_token             is         Call interface credentials
HTTP请求方式: POST
URL:https://api.weixin.qq.com/card/paygiftmembercard/delete?access_token=TOKEN
##POST data             is            
POST dataField description

Field Name

Note

## Card_id ## counter ID ID.                                                                                                                                             

Return data description

Data example:

{
    "card_id": "xxxxxxxxa",
    "mchid_list": [
        123,
        1234,
        12345
    ]
}
#mchid                                                                                                                                                The currently occupied appid must be used by the merchant to unbind and then reset.             ##8.4.3 Query Merchant Number Payment or Membership Rules InterfaceInterface Description You can query whether a merchant account supports the payment-as-membership function Interface call request descriptionParameter description##Parameters ##Is it necessary                                                                                                                        ##access_token            
Parameter name               Description              
errcode           Error code, 0 means normal.           
errmsg           Error message.
succ_list                                                                                                                                                                                   ​
{
    "errcode": 0,
    "errmsg": "ok",
    "succ_list":[
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        },
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        }
    ],
    "fail_list":[
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        },
        {
            "mchid": "xxxxx",
            "errcode": 0,
            "errmsg": "ok",
            "occupy_appid": "wxxxxxxxxxxx"
        }
    ]
}


is                                                                                                           ’ ’ ’ s ’ s ’ s with ’s ’ s ’ s ‐ ‐ ‐ ‐ ‐ POST data

HTTP请求方式: POST
URL:https://api.weixin.qq.com/card/paygiftmembercard/get?access_token=TOKEN

Field description

##Field name                                                                                                                                                                                                               .         

Return data description

Data example:

{"mchid":"xxxxxxxx"}

8.5 Set the member card to exit the WeChat payment card swiping interface

Passed The interface creates a membership card that supports the card swiping type. After the user clicks on the quick payment, the card swiping interface can be pulled out for payment. The following is a schematic diagram:

201610130915204982.png


#8.5.1 Create a membership card to support WeChat payment card payment

Merchants can create a membership card to support WeChat payment swiping, and must add the following fields to the JSON of the membership card creation interface:

{
    "errcode": 0,
    "errmsg": ok,
    "card_id": "xxxxxxxxxxxxxxxxxx",
    "occupy_appid": "wxxxxxxxxxxx",
    "is_locked": true
}

8.5.2 Update membership card to support WeChat payment swiping

Merchant can update existing membership cards to support WeChat payment card swiping, and must add the following fields to the JSON of the membership card update interface:

{
     "card": {
         "card_type": "MEMBER_CARD",
         "member_card": {
             "base_info": {
                 "pay_info":
                 {
                         "swipe_card":
                         {
                 
                            "is_swipe_card":true
                         }
                        }
                      }
         }
     }
 }