Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program service-side interface and commodity management interface


May 18, 2021 WeChat Mini Program Development Document


Table of contents


Live program live: Live product management interface

Name Description of the function
Items added and adrogated Call this interface to upload and admiss the commodity information that needs to be broadcast live, after the approval of the commodity entry into the "small program live" commodity library
Recall the product review Call this interface, you can withdraw the live goods of the request for atrial, the number of times consumed is not returned
Resubmit the product review Calling this interface can re-initiate a request for atrial hearing for a commodity that has been withdrawn for questioning
Delete the item Call this interface, you can delete the "small program live" commodity library of goods, after deletion of the live broadcast between the shelves of the goods will also be deleted synchronously, not recoverable
Update the product Call this interface to update the commodity information, the approved goods only allow to update the price type and price, the approved items are not allowed to update, the unoly approved items are allowed to update all fields, only the fields that need to be updated
Get the status of the product Call this interface to get the product's information and audit status
Get a list of items Call this interface to get a list of items

First, the introduction

Live commodity management interface is the interface capability that small program live programs provide to developers to perform bulk operations on live products.

Developers can add, adage, delete, and update items in bulk.

The interface only supports the operation of goods added through the interface, the developer manages the goods added in the background in the small program, and does not support the operation through the interface.

Developers must save [Product ID] and [Audit Document ID], if lost, other related interfaces cannot be invoked.

Second, the interface document

1. Add and tried

Interface Description

Call this interface upload and review product information that require live broadcast, review the goods after passing the goods [small program live] Product library

Note: Developers must save [product ID] and [audit order ID], if lost, other related interfaces cannot be invoked

Call frequency

Call quota: 500 times / day

Request method

POST

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/add?access_token=

Example of request parameters: json

{    
    "goodsInfo": {              
         "coverImgUrl": "ZuYVNKk9sMP1X4m7FXdcDCKra251KDZTjS502UTV7gwalgLZXcrOhG6oNYX6c7AR",        
         "name":"TIT茶杯",      
         "priceType":1,   
         "price":99.5,
         // "price2": 150.5, priceType为23时必填
         "url":"pages/index/index"  
    }
}

The meaning of the request parameter

Parameters Type Required Description
coverImgUrl String Is Fill in media https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html ID (mediaID, valid for three days);
name String Is Product name, up to 14 Chinese characters, 1 Chinese character is equivalent to 2 characters
priceType Number Is Price type, 1: price (only pass in price, price2 does not pass) 2: price range (price field is left boundary, price2 field is right boundary, price and price2 must pass) 3: show discount price (price field is the original price, price2 field is present price, price and price2 must pass)
price Number Is Numbers, up to two digits of the number, units
price2 Number Whether Numbers, up to two digits of the number, units
Url String Is The small program path on the commodity details page, the path parameter exists url, the value of which needs to be processed encode and then filled in

Return the example correctly

{  
    "goodsId": 51,
    "auditId": 525022786,
    "errcode": 0 
}

Returns the meaning of the argument

Parameters Description
goodsId Merchandise ID
auditId The approval document ID

2. Withdrawal of the audit

The interface description

Call this interface, you can withdraw the live goods of the request for atrial, the number of times consumed is not returned

The frequency of the call

Call limit: 500 times/day

The request method

POST

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/resetaudit?access_token=

Example of request parameters: json

{    
    "auditId": 525022184,
    "goodsId": 9
}

The meaning of the request parameter

Parameters Type Required Description
goodsId Number Is Merchandise ID
auditId Number Is The approval document ID

Return the example correctly

{  
    "errcode": 0 
}

3. Resubmit the review

The interface description

Calling this interface can re-initiate a request for atrial hearing for a commodity that has been withdrawn for questioning

The frequency of the call

Call limit: 500 times/day (500 times limit shared with interface 1)

The request method

POST

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/audit?access_token=

Example of request parameters: json

{    
    "goodsId": 9
}

The meaning of the request parameter

Parameters Type Required Description
goodsId Number Is Merchandise ID

Return the example correctly

{  
    "errcode": 0,
    "auditId": 525022184
}

Returns the meaning of the argument

Parameters Description
auditId The approval document ID

4. Delete the item

The interface description

Call this interface, you can delete the "small program live" commodity library of goods, after deletion of the live broadcast between the shelves of the goods will also be deleted synchronously, not recoverable;

The frequency of the call

Call quota: 1000 times / day

The request method

POST

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/delete?access_token=

Example of request parameters: json

{    
    "goodsId": 9
}

The meaning of the request parameter

Parameters Type Required Description
goodsId Number Is Merchandise ID

Return parameters

{   
    "errcode": 0,   
}

5. Update the product

The interface description

Call this interface to update the commodity information, the approved goods only allow to update the price type and price, the approved items are not allowed to update, the unoly approved items are allowed to update all fields, only the fields that need to be updated.

The frequency of the call

Call quota: 1000 times / day

The request method

POST

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/update?access_token=

Example of request parameters: json

{    

    "goodsInfo": {        
        // 需要更新哪个字段就传入哪个字段,goodsId 必传        
        "coverImgUrl": "ZuYVNKk9sMP1X4m7FXdcDCKra251KDZTjS502UTV7gwalgLZXcrOhG6oNYX6c7AR",        
        "name":"TIT茶杯",        
        "priceType":1,
        "price":99.5,
        // "price2": 150.5, priceType为23时必填
        "url": "pages/index/index",       
        "goodsId": 9     
    }
}

The meaning of the request parameter

Parameters Type Required Description
coverImgUrl String Is Fill in media https://developers.weixin.qq.com/doc/offiaccount/Asset_Management/New_temporary_materials.html ID (mediaID, valid for three days);
name String Is Product name, up to 14 Chinese characters, 1 Chinese character is equivalent to 2 characters
priceType Number Is Price type, 1: price (only pass in price, price2 does not pass) 2: price range (price field is left boundary, price2 field is right boundary, price and price2 must pass) 3: show discount price (price field is the original price, price2 field is present price, price and price2 must pass)
price Number Is Numbers, up to two digits of the number, units
price2 Number Whether Numbers, up to two digits of the number, units
Url String Is The small program path on the commodity details page, the path parameter exists url, the value of which needs to be processed encode and then filled in
goodsId Number Is Merchandise ID

Return parameters

{   
    "errcode": 0,   
}

6. Get the status of the product

The interface description

Call this interface to get the product's information and audit status

The frequency of the call

Call quota: 1000 times / day

The request method

POST

Request a URL

https://api.weixin.qq.com/wxa/business/getgoodswarehouse?access_token=

Example of request parameters: json

{
​    "goods_ids": [1]
}

The meaning of the request parameter

Parameters Type Required Description
goods_ids Array<Number> Is Merchandise ID

Return parameters

{
​    "errcode":0,
​    "errmsg":"ok",
​    "goods":
​        [
​            {
​                "goods_id":9,
​                "cover_img_url":"xxxx",
​                "name":"xxxxx""price":12300,
​                "url":"xxxxxxx",
​                "price_type":1,
​                "price2":0,
​                "audit_status":1,
​                "third_party_tag":0
​            }
​        ],
​    "total":0
}

Returns the meaning of the argument

Parameters Description
goods_id Merchandise ID
name Product name
cover_img_url Product picture url
Url The small program path on the product details page
priceType 1: a price, at this time read the price field; 2 : Price range, at this time the price field is the left boundary, the price2 field is the right boundary; 3: Discount price, at this time price field is the original price, price2 field is the current price;
price Price left range, unit "yuan"
price2 Price right range, unit "yuan"
audit_status 0: Unodred, 1: Audited, 2: Approved, 3 Audit failed
third_party_tag 1, 2: Indicates that the item is added for the API, otherwise it is the item added to the live console
total The number of goods

7. Get a list of products

The interface description

Call this interface to get a list of items

The frequency of the call

Call quota: 10,000 times / day

The request method

GET

Request a URL

https://api.weixin.qq.com/wxaapi/broadcast/goods/getapproved?access_token=[access_token]

URL query parameter

Parameters Type Required Description
offset Number Is The starting point for the number of paged bars
limit Number Whether Peddle size, default 30, no more than 100
status Number Is Product status, 0: Unodred. 1: In the audit, 2: the audit passed, 3: the audit was rejected

Return parameters

{
​    "errcode":0,
​    "total":68,
​    "goods":
​        [
​            {
​                "goodsId":9,
​                "coverImgUrl":"xxxx",
​                "name":"xxxxx""price":12300,
​                "url":"xxxxxxx",
​                "priceType":1,
​                "price2":0,
​                "thirdPartyTag":0
​            }
​        ]
}

Returns the meaning of the argument

Parameters Description
total The quantity of goods
goodsId Merchandise ID
coverImgUrl A link to a picture of the product
name Product name
price Price left range, unit "yuan"
price2 Price right range, unit "yuan"
Url The commodity program path
priceType 1: a price, at this time read the price field; 2 : Price range, at this time the price field is the left boundary, the price2 field is the right boundary; 3: Discount price, at this time price field is the original price, price2 field is the current price;
thirdPartyTag 1, 2: Indicates that the item is added for the API, otherwise it is the item added to the live console

Appendix: Error code

-1: System error

1003: The product id does not exist

47001: The entry format does not conform to the specification

200002: Entry error

300001: Do not create/update items (e.g. product creation is blocked)

300002: The name length does not conform to the rules

300003: Price input is not compliant (e.g. the current price is large than the original price, the incoming price is not a number, etc.)

300004: There is illegal content in the product name

300005: There is illegal content in the picture of the product

300006: Image upload failed (e.g. mediaID expired)

300007: The link does not exist in the online iterer version

300008: Failed to add items

300009: Product review recall failed

300010: The status of the product review is not correct (e.g. in the commodity review)

300011: Illegal operation (API does not allow operation of non-API-created items)

300012: No amount of ad litigate (500 a day)

300013: The trial failed

300014: Cannot be deleted during audit (non-zero for failure)

300017: Merchandise not tried

300021: The item was added successfully and the audit failed