catalog
2 Get the user who has received a card interface
5 Change the card information interface
6 Modify the Inventory Interface
9 Set up a coupon failure interface
10.1 Drag voucher profile data interface
10.2 Get a free coupon data interface
10.3 Drag a member card profile data interface
10.4 Drag a single member card data interface
# Query Code interface
The query code interface can query whether the current code can be written off and check the status of the code. The current status that can be located is normal, write-off, transfer, deleted, invalid and invalid code.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/code/get?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | JSON data |
access_token | yes | Call Interface Credentials |
POST data
{
"card_id" : "card_id_123+",
"code" : "123456789",
"check_consume" : true
}
Parameter explaination
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
code | yes | string(20) | 110201201245 | The only criterion for a single card. |
card_id | no | string(32) | pFS7Fjg8kV1I dDz01r4SQwMkuCKc | The voucher ID represents a class of vouchers. Custom code card voucher required. |
check_consume | no | bool | true | Whether to verify the code write-off status, the return data of the code exception state when filling in true and false is different. |
Returns data when check_consume is true
The voucher is in normal condition:
{
"errcode": 0,
"errmsg": "ok",
"card": {
"card_id": "pbLatjk4T4Hx-QFQGL4zGQy27_Qg",
"begin_time": 1457452800,
"end_time": 1463155199
},
"openid": "obLatjm43RA5C6QfMO5szKYnT3dM",
"can_consume": true,
"outer_str": "12b",
"user_card_status": "NORMAL"
}
The card status is unusual:
{
"errcode": 40127,
"errmsg": "invalid user-card status! Hint: the card was given to user, but may be deleted or set unavailable ! hint: [iHBD40040ent3]"
}
Returns data when check_consume is false
The voucher is in normal condition:
{
"errcode": 0,
"errmsg": "ok",
"card": {
"card_id": "pbLatjk4T4Hx-QFQGL4zGQy27_Qg",
"begin_time": 1457452800,
"end_time": 1463155199
},
"openid": "obLatjm43RA5C6QfMO5szKYnT3dM",
"can_consume": true,
"outer_str": "12b",
"user_card_status": "NORMAL"
}
The card status is unusual:
{
"errcode": 0,
"errmsg": "ok",
"card": {
"card_id": "pbLatjnK8NLbWgwMgfMtnj3gaglw",
"begin_time": 1457625600,
"end_time": 1460217599
},
"openid": "obLatjm43RA5C6QfMO5szKYnT3dM",
"can_consume": false,
"outer_str": "12b",
"user_card_status": "GIFTING"
}
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
openid | User openid |
card_id | Voucher ID |
begin_time | Initial usage time |
end_time | End Time |
user_card_status | The current code corresponds to the status of the voucher NORMAL Normal CONSUMED Deleted EXPIRE Expired GIFTING In Redeemer GIFT_TIMEOUT Redeemer Overtime DELETE Deleted UNAVAILABLE Invalid code When the code is not added or redeemed for collection, the error is consistent: invalid serial code |
outer_str | The channel value of the merchant's incoming coupons when they are collected |
can_consume | Whether it can be written off, true is written off, false is not written off |
NOTE:
1. The fixed-time validity period is converted according to the actual time of receipt of the user. If the user collects on October 1, 2013, the fixed-term validity period will be 90 days, i.e. the validity period runs from October 1 to December 29, 2013.
2. Whether check_consume is filled in true or false, when the code is not added or the code is transferred to receive a unified error: invalid serial code
# Get the user who has received a card interface
Used to obtain the user's card package, belonging to the AppID all available card vouchers, including normal and abnormal state .
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/user/getcardlist?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | JSON data |
access_token | yes | Call Interface Credentials |
POST data
{
"openid": "12312313",
"card_id": "xxxxxxxxxx"
}
Parameter explaination
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
openid | yes | string(64) | 1231231 | User openid that needs to be queried |
card_id | no | string(32) | pFS7Fjg8kV1IdDz01xxxxx | Voucher ID.Do not fill in the default query current AppID under the card voucher. |
Return data
{"errcode":0,"errmsg":"ok","card_list": [
{"code": "xxx1434079154", "card_id": "xxxxxxxxxx"},
{"code": "xxx1434079155", "card_id": "xxxxxxxxxx"}
],
"has_share_card": true
}
Parameter explaination
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
card_list | List of coupons |
has_share_card | Is there a friend's ticket available? |
# View voucher details
Developers can call this interface to query the creation information, audit status, and inventory of a card_id.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/get?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | JSON data |
access_token | yes | Call Interface Credentials |
POST data
{
"card_id":"pFS7Fjg8kV1IdDz01r4SQwMkuCKc"
}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
card_id | yes | string(32) | pFS7Fjg8kV1IdDz01r4SQwMkuCKc | Voucher ID. |
Return data
{
"errcode": 0,
"errmsg": "ok",
"card": {
"card_type": "DISCOUNT",
"discount": {
"base_info": {
"id": "pbLatjnP97_F9PudzBARQhn7xR7A",
"logo_url": "http://mmbiz.qpic.cn/mmbiz/p98FjXy8LafmY25YclQ7vw5noBxeVH3DG5AKFR1ZsRgMgsvjll7EkUsZib00J964AEpTjkNXF2HorJHt5mtt45Q/0?wx_fmt=png",
"code_type": "CODE_TYPE_NONE",
"brand_name": "微信餐厅",
"title": "9折优惠券",
"date_info": {
"type": "DATE_TYPE_FIX_TERM",
"fixed_term": 30,
"fixed_begin_term": 0
},
"color": "#10AD61",
"notice": "到店使用",
"description": "",
"location_id_list": [
218384742,
402521653,
402521608
],
"get_limit": 3,
"can_share": true,
"can_give_friend": true,
"status": "CARD_STATUS_VERIFY_OK",
"sku": {
"quantity": 100096,
"total_quantity": 100100
},
"create_time": 1457525546,
"update_time": 1457526240,
"area_code_list": []
},
"discount": 10,
"advanced_info": {
"time_limit": [
{
"type": "MONDAY"
},
{
"type": "TUESDAY"
}
],
"text_image_list": [],
"business_service": [],
"consume_share_card_list": [],
"abstract": {
"abstract": "点击了解更多",
"icon_url_list": [
"http://mmbiz.qpic.cn/mmbiz/p98FjXy8LafiawSeJeqBzk8qC40iaKIwUPm4TSCelulzEbAywKr7tWjkd5vRjbmFloUFeThfwhwMUZIXmsCtJpyQ/0?wx_fmt=jpeg"
]
},
"share_friends": false
}
}
}
}
Parameter Name | describe |
---|---|
card_type | The type of voucher. Groupon: GROUPON; Discount coupon: DISCOUNT; Gift certificate: GIFT; Voucher: CASH; GENERAL COUPON: GENERAL_COUPON; Membership card: MEMBER_CARD; Scenic Spot Ticket: SCENIC_TICKET; Movie ticket: MOVIE_TICKET; Flight ticket: BOARDING_PASS; Meeting Ticket: MEETING_TICKET; Bus ticket: BUS_TICKET; |
base_info | For basic voucher data, see the table below. All vouchers are generic. |
deal_detail | Special fields for group buying vouchers, group buying details. |
gift | Special for gift certificates, indicating the name of the gift. |
least_cost | The least_cost field is dedicated to vouchers and represents the starting amount (in points). |
reduce_cost | Specialized for vouchers, indicating the amount of relief (in units of cents) |
discount | A special field for discount vouchers that indicates the amount of discount (percentage). For example, fill in 30 as a discount group group details. |
supply_balance | Membership card exclusive field, indicating whether to support points, fill in true or false, such as fill in true, points related fields are required, membership card dedicated. |
supply_bonus | Membership card dedicated fields, indicating whether to support stored value, fill in true or false, such as fill in true, stored value related fields are required, membership card dedicated. |
bonus_cleared | Points zero rule, specific to membership cards. |
bonus_rules | Points rules, exclusive to membership cards. |
balance_rules | Savings rules, specific to membership cards. |
prerogative | A membership card exclusive field, indicating a explaination of privileges, exclusive to the membership card. |
bind_old_card_url | The URL of the old card is tied to the card. |
activate_url | Activating a membership card is exclusive to membership cards. |
need_push_on_view | Enter the membership card when push event, fill in true or false, membership card only. |
from | The starting point and upper limit of an air ticket is 18 Chinese characters, and the air ticket is exclusive. |
to | The end point of the plane ticket is limited to 18 Chinese characters, and the ticket is exclusive. |
flight | Flights, tickets are reserved for flights. |
departure_time | Flight time is reserved for tickets. (Unix Time Stamp Format) |
landing_time | Arrival time is reserved for tickets. (Unix Time Stamp Format) |
check_in_url | Online check-in links, exclusive to airfares. |
gate | The gate. If a gate change occurs, the merchant is advised to call the interface change in real time, which is exclusive to the ticket. |
boarding_time | Arrival time, showing only the "time" and not the date, is reserved for the ticket. (Unix Time Stamp Format) |
meeting_detail | Conference details, conference tickets are dedicated. |
map_url | Tour map of the venue, conference tickets exclusive. |
Base_info field:
Parameter Name | describe |
---|---|
logo_url | The merchant logo of the card coupon is recommended to be 300\ * 300 pixels. |
code_type | "CODE_TYPE_TEXT," text text; "CODE_TYPE_BARCODE," one dimensional code; "CODE_TYPE_QRCODE," two dimensional code; "CODE_TYPE_ONLY_QRCODE," two-dimensional code without code display; "CODE_TYPE_ONLY_BARCODE," one-dimensional code without code display; |
brand_name | Merchant Name (fill in the name of the merchant directly providing the service, and the name of the third party merchant in the source field). |
title | The name of the card. |
color | The background color of the card. |
notice | Using reminders, the number of characters is limited to 16 Chinese characters. |
description | Use instructions. Long text description. |
date_info | Date of use, expiration information. |
type | Type of time used DATE_TYPE_FIX_TIME_RANGE indicates a fixed date range, DATE_Type_FIX_TERM indicates fixed time (days counting since receipt), and DATE_type_PERMANENT indicates permanent validity (exclusive to member card types). |
begin_timestamp | Used when type is DATE_TYPE_FIX_TIME_RANGE, indicating the start time. The number of seconds from 00: 00: 00 on January 1, 1970 to the start of operation shall eventually be converted into the form of a character string. (in seconds) |
end_timestamp | Used when the type is DATE_TYPE_FIX_TIME_RANGE, indicating the end time. (in seconds) |
fixed_term | When type is DATE_TYPE_FIX_TERM, it means that it is valid for several days after receiving, and it is valid for 0 on the day after receiving. (In units of heavens) |
fixed_begin_term | Used when type is DATE_TYPE_FIX_TERM, indicating how many days after collection. (In units of heavens) |
sku | Product Information |
quantity | Number of existing coupons in stock |
total_quantity | The total number of coupons in stock, subject to a ceiling of 100000000 |
location_id_list | Store Location ID. |
use_all_locations | Support all stores, fill in true or false, and exclude location_id_list |
use_custom_code | Whether to customize the Code code. Fill in true or false, which defaults to false. |
bind_openid | Whether to specify the user to receive, fill in true or false. The default answer was no. |
can_share | Whether the card voucher can be transferred, fill in true or false, true on behalf of the transfer default is true. |
service_phone | Call customer service. |
source | Third party source name, such as Tongcheng Travel, Volkswagen Comment. |
custom_url_name | The merchant customizes the entry name. |
custom_url | The merchant customizes the entry to redirect the address link of the external link, and the content of the redirect page must match the name of the custom cell. |
custom_url_sub_title | The tips displayed on the right side of the entrance are limited to 6 characters in length. |
promotion_url_name | Custom entry points for marketing scenarios. |
promotion_url | Enter Jump to the address link of the external link. |
promotion_url_sub_title | The prompt appears on the right side of the marketing entrance. |
custom_url_name | The merchant customizes the entry name. |
status | "CARD_STATUS_NOT_VERIFY," pending review; "CARD_STATUS_VERIFY_FAIL," audit failed; "CARD_STATUS_VERIFY_OK," passed the audit; "CARD_STATUS_DELETE," the card voucher is deleted by the merchant; "CARD_STATUS_DISPATCH," the card vouchers that have been placed on the public platform; |
Developers' Note
1. For some merchants with special permissions, querying for voucher details may return fields with special interfaces.
2. Because voucher fields are constantly updated, the actual return fields include, but are not limited to, fields in the document, and developers are advised not to handle ununderstood fields when developing to avoid errors.
# Bulk query list of coupons
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/batchget?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"offset": 0,
"count": 10,
"status_list": ["CARD_STATUS_VERIFY_OK", "CARD_STATUS_DISPATCH"]
}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
offset | yes | int | 0 | The starting offset of the query card list, starting from 0, that is, offset: 5 refers to reading from the sixth in the list. |
count | yes | int | 10 | Number of cards to be queried (maximum number 50). |
status_list | no | string(32) | CARD_STATU S_VERIFY_OK | Support developers to pull out the specified status of the card voucher list "CARD_STATUS_NOT_VERIFY," pending review; "CARD_STATUS_VERIFY_FAIL," audit failed; "CARD_STATUS_VERIFY_OK," passed the audit; "CARD_STATUS_DELETE," the card voucher is deleted by the merchant; "CARD_STATUS_DISPATCH," the card vouchers that have been placed on the public platform; |
Return data
{
"errcode":0,
"errmsg":"ok",
"card_id_list":["ph_gmt7cUVrlRk8swPwx7aDyF-pg"],
"total_num":1
}
Parameter Name | describe |
---|---|
errcode | Error code, 0 is normal. |
errmsg | Error message. |
card_id_list | List of Card Voucher IDs. |
total_num | The total number of voucher IDs under the name of the merchant. |
NOTE:
1. When a filter condition is not entered, the interface returns by default all stated coupons in the name of the merchant;
2. Developers can then request that the Check Coupon Details Interface be called to determine the status of the coupons;
# Change the card information interface
Interface Dxplaination
Supports updating information for some common fields and specific fields in special coupons (member cards, plane tickets, movie tickets, conference tickets) for all voucher types.
Dxplaination of Interface Call Request
HTTP请求方式: POSTURL:https://api.weixin.qq.com/card/update?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"card_id":"ph_gmt7cUVrlRk8swPwx7aDyF-pg",
"member_card": {
//填写该cardid相应的卡券类型(小写)。
"base_info": {
"logo_url": "http:\/\/mmbiz.qpic.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": ""
}
}
Common field modifications:
Parameter Name | Is there a hearing? | type | Example values | describe |
---|---|---|---|---|
base_info | - | JSON interface | See the above examples | The voucher base information field. |
logo_url | yes | string(128) | mmbiz.qpic.cn/ | The merchant logo of the card coupon is recommended to be 300\ * 300 pixels. |
notice | yes | string(48) | Please present a QR code to cancel the card. | Using reminders, the number of characters is limited to 16 Chinese characters. |
description | yes | string(3072) | Not shared with other offers | Use instructions. |
service_phone | no | string(24) | 40012234 | Call customer service. |
color | yes | string(3072) | Color010 | The color of the voucher. |
location_id_list | no | string(3072) | 1234,2314 | Support for updating the list of applicable stores. |
center_title | no | string(18) | Quick Use | A custom cell centered at the top. |
center_sub_title | no | string(24) | Click to Quickly Write Off a Card | Custom cell explaination centered at the top. |
center_url | no | string(128) | www.qq.com | The jump link to the custom cell centered at the top. |
location_id_list | no | string(3072) | 1234,2314 | Supports updating the list of applicable stores, and sends "0" when emptying store updates |
custom_url_name | no | string(16) | Use it now | Customize the name of the jump entrance. |
custom_url | no | string(128) | "qq.com"。 | Custom jump URL. |
custom_url_sub_title | no | string(18) | More surprises | The prompt appears on the right side of the entrance. |
promotion_url_name | no | string(16) | Product description. | Custom entry name for a marketing scene. |
promotion_url | no | string(128) | qq.com; | Enter Jump to the address link of the external link. |
promotion_url _sub_title | no | string(18) | There's a big deal on sale. | The prompt appears on the right side of the marketing entrance. |
code_type | no | string(16) | CODE_TYPE _TEXT | Code code display type, "CODE_TYPE_TEXT" text; "CODE_TYPE_BARCODE," one dimensional code; "CODE_TYPE_QRCODE," binary code; "CODE_TYPE_ONLY_QRCODE," binary code without code display; "CODE_TYPE_ONLY_BARCODE," one-dimensional code without code display; |
get_limit | no | int | 1 | There is a limit on the number of tickets per person. |
can_share | no | bool | false | Whether the voucher native receipt page is shareable. |
can_give_friend | no | bool | false | Are the coupons redeemable? |
date_info | no | JSON structure | See the above examples | Use dates, expiration information, and expiration time modifications only support the expansion of the validity range. |
type | no | string | DATE_TYPE_FI X_TIME_RANGE | Valid type, only supports changing the timestamp of type DATE_TYPE_FIX_TIME_RANGE, does not support filling in DATE_TYPE_FIXED_TERM. |
begin_timestamp | no | unsigned int | 14300000 | A fixed date interval is dedicated to the start time. (in seconds) |
end_timestamp | no | unsigned int | 15300000 | A fixed-date interval is dedicated to the end time. The end time only supports a later extension. |
Unique field modifications for different types of coupons:
Note in particular that the following update-enabled fields are not in the structure of the base information base_info .
Parameter Name | Is there a hearing? | type | Example values | describe |
---|---|---|---|---|
bonus_cleared | yes | string(3072) | Points are cleared on December 30 of each year. | Points zero rule, specific to membership cards. |
bonus_rules | yes | string(3072) | Each yuan spent adds 1 credit. | Points rules, exclusive to membership cards. |
balance_rules | yes | string(3072) | Support for depositing balances online. | Savings note, special for membership cards. |
prerogative | yes | string(3072) | XX members can enjoy 20% discount on all products. | Note of privileges. exclusive to membership cards. |
custom_field1 | no | JSON structure | See Example of creating a membership card. | Customize membership information categories that display when the membership card is active, exclusive to the membership cards. |
custom_field2 | no | JSON structure | See Example of creating a membership card. | Customize membership information categories that display when the membership card is active, exclusive to the membership cards. |
custom_field3 | no | JSON structure | See Example of creating a membership card. | Customize membership information categories that display when the membership card is active, exclusive to the membership cards. |
name_type | no | string(24) | FIELD_NAME _TYPE_LEVEL | Category name of member information. FIELD_NAME_TYPE_LEVEL Grade; FIELD_NAME_TYPE_COUPON; FIELD_NAME_TYPE_STAMP PRINTING; FIELD_NAME_TYPE_DISCOUNT Discount discount; FIELD_NAME_TYPE_ACHIEVEMEN achievement; FIELD_NAME_TYPE_MILEAGE Mileage. |
url | no | string(128) | qq.com | Click on the category to jump outside the link url |
custom_cell1 | no | JSON structure | See the above example. | Customize the member information category, which displays when the member card is activated. |
detail | yes | string(3072) | Movie title: Avengers 2. / n Running time: May 12, 2015 23: 00. / n Ticket Type: 3 D. | Movie ticket details. |
departure_time | no | unsigned int | 1431271351 | The time of the departure. |
landing_time | no | unsigned int | 1441271351 | The time of the landing. |
gate | no | string(12) | Number 3 | The gate. If a gate change occurs, merchants are advised to call the interface change in real time. |
boarding_time | no | unsigned int | 1431271351 | Boarding time, showing only "Time Division" but not date, in Unix timestamp format. If a change in boarding time occurs, the merchant is advised to call the interface change in real time. |
guide_url | no | string(128) | www.qq.com | URL. |
map_url | no | string(128) | qq.com。 | A tour map of the venue. |
Returning data instructions
{
"errcode":0,
"errmsg":"ok",
"send_check":false
}
Parameter Name | describe |
---|---|
errcode | Error code, 0 is normal. |
errmsg | Error message. |
send_check | Whether to submit for review, false is not re-arraignment after modification, true is re-arraignment after modification field, the status of the card voucher becomes audit. |
Note for developers
1. Please note the fields that need to be re-reviewed. When a developer calls the update interface, if a review field is entered, the voucher needs to be revisited.
2. The interface is updated in a blanket manner: the developer simply enters the fields that need to be changed, other fields need not be filled in, otherwise the card may be re-reviewed.
3. If a developer nullifies certain fields, you can simply pass a "" (null) at the time of the update.
- Once you have changed your card information after calling this interface, be sure to call it Home Verify that the change was successful, *
5. Unlisted fields do not support modification updates.
# Modify the inventory interface
Call the Modification Inventory Interface to increase or decrease the inventory of a voucher.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/modifystock?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"card_id": "pFS7Fjg8kV1IdDz01r4SQwMkuCKc",
"increase_stock_value": 1231231,
"reduce_stock_value": 1231231
}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
card_id | yes | string(32) | pFS7Fjg8kV1IdDz01r4SQwMkuCKc | Voucher ID. |
increase_stock_value | no | int | 1231231 | How much inventory to add, support not filling or filling 0. |
reduce_stock_value | no | int | 1231231 | How much inventory is reduced can be either empty or zero. |
Return data
{
"errcode":0,
"errmsg":"ok"
}
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
# Change the Code interface
To ensure security after the transfer, WeChat allows merchants with custom codes to make changes to the code they have issued.Note: To avoid users' confusion, it is recommended that users' code be changed only after a re-gift occurs (after a regift occurs, WeChat will inform the merchant of the re-gifted card code by event push).
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/code/update?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"code": "12345678",
"card_id": "pFS7Fjg8kV1IdDz01r4SQwMkuCKc",
"new_code": "3495739475"
}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
card_id | no | string(32) | pFS7Fjg8kV1IdDz01r4SQwMkuCKc | Voucher ID. Custom Code Code card voucher is required. |
code | yes | string(16) | 110201201245 | Code that needs to be changed. |
new_code | yes | string(64) | 1231231 | The effective code after the change. |
Return data
{"errcode":0,"errmsg":"ok",}
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
# Remove the coupon interface
The Remove Coupon Interface allows merchants to remove any category of coupons. After deleting the card voucher, the card voucher corresponding to the generated two-dimensional code for collection, added to the card package JSAPI will be invalid. Note: If the user has received one or more coupons before the merchant deletes the coupons, the coupons will still be valid.That is, deleting the card voucher cannot delete the card voucher that has been received by the user and saved in the WeChat guest.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/delete?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"card_id": "pFS7Fjg8kV1IdDz01r4SQwMkuCKc"
}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
card_id | yes | string(32) | pFS7Fjg8kV1IdDz01r4SQwMkuCKc | Voucher ID. |
Return data
{
"errcode":0,
"errmsg":"ok"
}
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
# Set up a coupon failure interface
In order to meet unusual situations such as ticket changes and refunds, the voucher failure interface can be invoked to set the user's voucher to a failed state.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/card/code/unavailable?access_token=TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
A request for a non-custom voucher {"code": "12312313," "reason": "refund"} or a request for a custom code voucher.{ "code": "12312313," "card_id": "pFS7Fjg8kV1IdDz01r4SQwMkuCKc"}
Parameter Name | Required to fill in | type | Example values | describe |
---|---|---|---|---|
card_id | yes | string(32) | pFS7Fjg8kV1IdDz01r4SQwMkuCKc | Voucher ID. |
code | yes | string(20) | 1231231 | Set the invalid Code. |
reason | no | string(64) | Users have received a refund. | Reasons for invalidity |
Return data
{
"errcode":0,
"errmsg":"ok",
}
Parameter Name | describe |
---|---|
errcode | Error code |
errmsg | Error message |
NOTE:
1. The operation of setting a voucher to expire is irreversible, i.e. it is not possible to bring a failed voucher back to a valid state, and the merchant must use caution in calling the interface.
- Merchants must inform and obtain consent with customers before invoking the failed interface, otherwise the resulting customer complaint will be in accordance with the WeChat operating penalty rules.
# Statistical card data
In order to support developers to call the API to view voucher related data, the WeChat voucher team encapsulates the data interface and is open to developers with voucher function permissions.
Developers call this interface to obtain the total data related to all coupons under this merchant, as well as data related related to specified coupons.
# Drag voucher profile data interface
Interface Dxplaination
Supports invoking this interface to pull the aggregate data of the merchant, including the total number of indicators within a time period.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/datacube/getcardbizuininfo?access_token=ACCESS_TOKEN
Dxplaination of request parameters
parameter | Do I have to? | Introductions |
---|---|---|
access_token | yes | Call Interface Credentials |
POST data | yes | Json data |
POST data
{
"begin_date":"2015-06-15",
//请开发者按示例格式填写日期,否则会报错date format error "end_date":"2015-06-30",
"cond_source": 0
}
Parameter explaination:
field | Introductions | Is it compulsory? | type | Example values |
---|---|---|---|---|
begin_date | The starting time of the query data. | yes | string(16) | 2015-06-15 |
end_date | The expiry date of the query data. | yes | string(16) | 2015-06-30 |
cond_source | Card voucher source, 0 for the public platform to create the card voucher data, 1 is the API to create the card voucher data | yes | unsigned int | 0 |
Return data explaination:
{
"list": [
{
"ref_date": "2015-06-23",
"view_cnt": 1,
"view_user": 1,
"receive_cnt": 1,
"receive_user": 1,
"verify_cnt": 0,
"verify_user": 0,
"given_cnt": 0,
"given_user": 0,
"expire_cnt": 0,
"expire_user": 0
}
]
}
Field Dxplaination:
field | Introductions |
---|---|
ref_date | Date Information |
view_cnt | Number of views |
view_user | Number of visitors |
receive_cnt | Number of Receipts |
receive_user | Number of recipients |
verify_cnt | Number of times used |
verify_user | Number of users |
given_cnt | Number of re-grants |
given_user | Number of transfers |
expire_cnt | Number of expirations |
expire_user | Number of expired dates |
Particular note:
1. The query time interval is < = 62 days, otherwise the error {errcode: 61501, errmsg: "date range error"};
2. The incoming time format should be filled in "2015-06-15" in strict accordance with the example, otherwise the error {errcode ": 61500," errmsg ":" date format error "}
3. The interface can only draw data that is not the same day. It cannot draw card data that is the same day, otherwise an error is reported.
# Get a free coupon data interface
Interface Dxplaination
Developers can use this interface to pull data about free coupons (coupons, group coupons, discount coupons, gift coupons) over a fixed time period.
Dxplaination of Interface Call Request
Http request method: POST https://api.weixin.qq.com/datacube/getcardcardinfo?access_token=ACCESS_TOKEN
Dxplaination of request parameters
parameter | Do I have to? | Introductions |
---|---|---|
access_token | yes | Call Interface Credentials |
POST data | yes | Json data |
POST data
{
"begin_date":"2015-06-15",
"end_date":"2015-06-30",
"cond_source": 0,
"card_id": "po8pktyDLmakNY2fn2VyhkiEPqGE"
}
Parameter explaination:
field | Introductions | Is it compulsory? | type | Example values |
---|---|---|---|---|
begin_date | The starting time of the query data. | yes | string(16) | 2015-06-15 |
end_date | The expiry date of the query data. | yes | string(16) | 2015-06-30 |
cond_source | Card voucher source, 0 for the public platform to create the card voucher data, 1 is the API to create the card voucher data | yes | unsigned int | 0 |
card_id | Voucher ID. Once completed, specify the relevant data for the card. | no | string(32) | po8pktyDLmakNY2fn2VyhkiEPqGE |
Return data explaination :
{
"list": [
{
"ref_date": "2015-06-23",
"card_id": "po8pktyDLmakNY2fn2VyhkiEPqGE",
"card_type":3,
"view_cnt": 1,
"view_user": 1,
"receive_cnt": 1,
"receive_user": 1,
"verify_cnt": 0,
"verify_user": 0,
"given_cnt": 0,
"given_user": 0,
"expire_cnt": 0,
"expire_user": 0
}
]
}
Field Dxplaination:
field | Introductions |
---|---|
ref_date | Date Information |
card_id | Voucher ID |
card_type | Cardtype: 0: discount voucher, 1: voucher, 2: gift voucher, 3: coupon, 4: group buying voucher (it is not currently supported to pull data for special ticket types, movie tickets, plane tickets, conference tickets, scenic spots) |
view_cnt | Number of views |
view_user | Number of visitors |
receive_cnt | Number of Receipts |
receive_user | Number of recipients |
verify_cnt | Number of times used |
verify_user | Number of users |
given_cnt | Number of re-grants |
given_user | Number of transfers |
expire_cnt | Number of expirations |
expire_user | Number of expired dates |
Particular note:
1. At present, the interface supports only card-related data for collecting free coupons (coupons, group coupons, discount coupons, gift coupons), and does not support special ticket data (movie tickets, conference tickets, scenic attractions, plane tickets).
2. The query time interval needs to be < = 62 days, otherwise the error is reported {"errcode:" 61501,errmsg: "date range error"};
3. The incoming time format should be filled in strictly according to the example, such as "2015-06-15," otherwise the error {"errcode": "date format error"}
4. The interface can only draw data that is not the same day. It cannot draw card data that is the same day, otherwise an error is reported.
# Drag a member card profile data interface
Interface Dxplaination
Developers are able to call this interface to pull data related to membership cards created by the public platform.
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/datacube/getcardmembercardinfo?access_token=ACCESS_TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"begin_date":"2015-06-15",
"end_date":"2015-06-30",
"cond_source": 0
}
Parameter explaination:
field | Introductions | Is it compulsory? | type | Example values |
---|---|---|---|---|
begin_date | The starting time of the query data. | yes | string(16) | 2015-06-15 |
end_date | The expiry date of the query data. | yes | string(16) | 2015-06-30 |
cond_source | Card voucher source, 0 for the public platform to create the card voucher data, 1 is the API to create the card voucher data | yes | unsigned int | 0 |
Return data explaination :
{
"list": [
{
"ref_date": "2015-06-23",
"view_cnt": 0,
"view_user": 0,
"receive_cnt": 0,
"receive_user": 0,
"active_user": 0,
"verify_cnt": 0,
"verify_user": 0,
"total_user": 86,
"total_receive_user": 95
]
}
Field Dxplaination:
field | Introductions |
---|---|
ref_date | Date Information |
view_cnt | Number of views |
view_user | Number of visitors |
receive_cnt | Number of Receipts |
receive_user | Number of recipients |
verify_cnt | Number of times used |
verify_user | Number of users |
active_user | Number of people activated |
total_user | Total number of active members |
total_receive_user | History of total number of recipients of membership cards |
’
# Drag a single member card data interface
Interface Dxplaination
Support the developer to call the interface to pull the API created by the card data situation
Dxplaination of Interface Call Request
HTTP request mode: POST URL: https://api.weixin.qq.com/datacube/getcardmembercarddetail?access_token=ACCESS_TOKEN
Parameter explaination
parameter | Do I have to? | Introductions |
---|---|---|
POST data | yes | Json data |
access_token | yes | Call Interface Credentials |
POST data
{
"begin_date":"2015-06-15",
"end_date":"2015-06-30",
"card_id":"xxxxxxxxxxxxxxxx"
}
Parameter explaination:
field | Introductions | Is it compulsory? | type | Example values |
---|---|---|---|---|
begin_date | The starting time of the query data. | yes | string(16) | 2015-06-15 |
end_date | The expiry date of the query data. | yes | string(16) | 2015-06-30 |
card_id | Voucher id | yes | string(32) | p4WkzwieuDBzzn7Jed6SBO0-ZgaU |
Return data explaination :
{
"list": [
{
"ref_date": "2016-07-06",
"merchanttype": 2,
"cardid": "p4WkzwieuDBzzn7Jed6SBO0-ZgaU",
"submerchantid": 0,
"view_cnt": 2,
"view_user": 1,
"receive_cnt": 1,
"receive_user": 1,
"verify_cnt": 0,
"verify_user": 0,
"active_cnt": 1,
"active_user": 1,
"total_user": 249,
"new_user": 0,
"payOriginalFee": 0,
"fee": 0
}
]
}
Field Dxplaination:
field | Introductions |
---|---|
ref_date | Date Information |
merchanttype | Sub-merchant types |
submerchantid | Submerchant ID |
view_cnt | Number of views |
view_user | Number of visitors |
receive_cnt | Number of Receipts |
receive_user | Number of recipients |
verify_cnt | Number of times used |
verify_user | Number of users |
active_user | Number of people activated |
total_user | Total number of active members |
total_receive_user | History of total number of recipients of membership cards |
new_user | Number of new users |
payOriginalFee | Amounts receivable (only using Quick Pay membership cards) |
fee | Amounts received (only using Quick Pay membership cards) |