Polyv Help Center

Help Center

Add Channel Products

Updated: 2026-01-12 14:16:50

Interface Description

1、添加频道商品库商品
2、(channelId, timestamp, appId)参与sign签名,并和sign一起通过url传递,请求体参数不参与签名,通过post请求体传递【请设置请求头contentType:application/json】
3、接口支持https协议

API URL

http://api.polyv.net/live/v3/channel/product/add

<a href="/req.html?api=http://api.polyv.net/live/v3/channel/product/add"" target="_blank">Online API Call

Request Method

POST

Interface Constraints

  1. The interface supports both HTTP and HTTPS. HTTPS is recommended to ensure interface security. Interface calls are subject to frequency limits. For details, please refer to.

  2. When the product type is regular product, the following fields are required: product name, product cover image link, actual product price, product listing status, and product link type. The corresponding link must be provided based on the product link type.
    When the product type is financial product, the following fields are required: product name, product listing status, and product link type. The corresponding link must be provided based on the product link type.

Request Parameter Description

Parameter Required Type Description
appId true String Account appId [See details in Get Secret Key]
timestamp true Long Current 13-digit millisecond-level timestamp, valid within 3 minutes
sign true String Signature, a 32-character uppercase MD5 value. The appSecret key used to generate the signature is critical for communication data security. It must never be stored on the client side for direct use. All APIs must be called through the customer's own server to relay requests to the POLYV server and retrieve response data. [See details in Signature Generation Rules]
channelId true String Channel ID

Request Body Parameter Description

Parameter Name Required Type Description
productType false String Product type. Optional values:
normal: Normal product
finance: Financial product
position: Job product
Defaults to normal if not provided.
cover false String For normal products (productType is normal): product cover URL, required, length range: 1-500
For financial products (productType is finance): product cover, optional
For job products (productType is position): job cover, optional
Either cover or ext should be provided; if both are provided, ext takes precedence.
name true String For normal products (productType is normal): product name, required
For financial products (productType is finance): product name, required
For job products (productType is position): job name, required
Note: The API supports 1-100 characters, but the live streaming backend only supports 1-50 characters.
status true Integer Product listing status
1: Listed
2: Unlisted
linkType true Integer Product link type
10: Universal link
11: Multi-platform link
link false String Universal link, product link, length range: 1-500
Required when linkType=10
Optional when linkType=11
pcLink false String Multi-platform link, PC redirect URL, length range: 1-500
mobileLink false String Multi-platform link, mobile web URL
wxMiniprogramLink false String Multi-platform link, mini-program page path and parameters (for the path attribute, the declared page path must include the .html suffix, e.g., pages/home/index.html)
wxMiniprogramOriginalId false String Multi-platform link, mini-program original ID
wxMiniprogramAppId false String Multi-platform link, mini-program appId
mobileAppLink false String Multi-platform link, mobile app URL
androidLink false String Multi-platform link, mobile app - Android native page URL
iosLink false String Multi-platform link, mobile app - iOS native page URL
params false String Custom parameters, received as a JSON object string. Must be escaped in the request. See the request body parameter example below.
For normal products (productType is normal): example {"id":21,"color":"blue","level":1}, optional
For financial products (productType is finance): example {"id":21,"color":"blue","level":1}, optional
For job products (productType is position): required and must include the treatment (salary/benefits) parameter, e.g., {"treatment":"7~8k"}
productDesc false String For normal products (productType is normal): product description, optional
For financial products (productType is finance): product description, optional
For job products (productType is position): job description, required
features false String Received as a JSON object string. Must be escaped in the request. See the request body parameter example below.
For normal products (productType is normal): product tags, JSON array, e.g., ["tab1", "tab2"]
For financial products (productType is finance): product tags, JSON array, e.g., ["tab1", "tab2"]
For job products (productType is position): job tags, JSON array, e.g., ["tab1", "tab2", "tab3"]. If there are fewer than three tags, use empty strings.
btnShow false String For job products (productType is position): button display text, required
For others: optional, default value: "Go to Buy"
yield false String For financial products (productType is finance): product yield/price
originId false String Platform product ID (if provided, copies the platform product to create a new channel product; in this case, only the status field is required)
strategy false String Strategy for copying platform products when originId is not empty. Optional values: copy - copy, ref - reference (recommended). Default value: copy. (Referencing platform product library: changes to platform product fields are automatically synced to the channel product library.
Copying platform product library: changes to platform product fields are not automatically synced to the channel product library.)
productDetail false String Product details
ext false String Extension information: JSON object string: {"coverList":["Cover image URLs, max 15"], "videoList":[{"videoSource":"Video source", "videoId":"Video ID"}]} [See details at EXT] Either cover or ext should be provided; if both are provided, ext takes precedence.
tagIds false String Product tag ID list: JSON array string, format: [100,102,103]
- - - Parameters specific to normal products (productType=normal)
priceType false String Actual product price type. Optional values:
AMOUNT: Amount
CUSTOM: Custom
Defaults to AMOUNT if not provided.
realPrice false Float Actual product price - amount. Required when priceType=AMOUNT. Maximum precision of two decimal places, e.g., 12.34
customPrice false String Actual product price - custom. Required when priceType=CUSTOM. Maximum 20 characters.
originalPriceType false String Original product price (strikethrough price) type. Optional values:
AMOUNT: Amount
CUSTOM: Custom
Defaults to AMOUNT.
price false Float Original product price (strikethrough price) - amount. Effective when originalPriceType=AMOUNT. Maximum precision of two decimal places, e.g., 12.34
customOrignalPrice false String Original product price (strikethrough price) - custom. Effective when originalPriceType=CUSTOM. Maximum 20 characters.
Note: If both price and customOriginalPrice are empty, the original price (strikethrough price) is not enabled.
- - - End of parameters specific to normal products (productType=normal)

EXT

Parameter Required Type Description
coverList true Array Array of cover image URLs, up to 15
videoList false Array Array of videos, up to 1 See ChannelProductExtVideo Requires the material library to be enabled
jumpWay false String Jump method for external link purchase - universal link: POP_UP - open in popup, NEW_WINDOW - open in new window, CURRENT_WINDOW - open in current window

ChannelProductExtVideo

Parameter Required Type Description
videoId true String Video ID
videoSource true String Video source: MATERIAL_LIBRARY - Material Library

Example

http://api.polyv.net/live/v3/channel/product/add?appId=frlr1zazn3&sign=8C89A574637594B0CB524039FC6D66C9&channelId=2288633&timestamp=1622177434141

Request Body Parameters

{
    "name": "测试添加金融产品1",
    "status": "1",
    "linkType": 10,
    "link": "http://live.polyv.net",
    "btnShow": "测试按钮显示",
    "strategy":"copy",
    "productDesc": "测试产品描述",
    "yield": "10.01%",
    "features": "[\"tab1\", \"tab2\"]",
    "params": "{\"id\":21,\"color\":\"blue\",\"level\":1}",
    "productType": "finance",
    "productDetail" : "<p>这是商品详情!</p>"
}

Response Parameter Description

Parameter Type Description
code Integer Response status code, 200 for success, non-200 for failure [see Global Error Description]
status String Response status text
message String Response description, when code is 400 or 500, provides additional error details
data Object Product information on success [see Data Parameter Description], empty on failure
Data parameter description
Parameter Name Type Description
productId Integer Product ID
userId String POLYV user ID, consistent with the one on the Polyv official website. Retrieval path: Official website -> Login -> Live (Development Settings)
channelId String Channel number
name String Product name
productType String Product type. Possible values:
normal: General product
finance: Financial product
position: Job position product
cover String Product cover image URL
link String Product link for general type products
status Integer Product listing status:
1: Listed
2: Unlisted
createdTime Long Product creation time, 13-digit millisecond timestamp
lastModified Long Product update time, 13-digit millisecond timestamp
rank Integer Product sort order number
type String Platform identifier, default is "live", others are invalid
linkType Integer Product link type:
10: General link
11: Multi-platform link
pcLink String Multi-platform link, PC redirect URL
mobileLink String Multi-platform link, mobile web redirect URL
wxMiniprogramLink String Multi-platform link, WeChat Mini Program redirect URL
wxMiniprogramOriginalId String Multi-platform link, WeChat Mini Program ID
wxMiniprogramAppId String Multi-platform link, WeChat Mini Program App ID
mobileAppLink String Multi-platform link, mobile app redirect URL
androidLink String Multi-platform link, mobile app Android native page URL
iosLink String Multi-platform link, mobile app iOS native page URL
params String Custom parameters, JSON object
btnShow String Button display text
features String For general products (productType is normal): product tags, JSON array, e.g., ["tab1", "tab2"]
For financial products (productType is finance): product tags, JSON array, e.g., ["tab1", "tab2"]
For job position products (productType is position): job tags, JSON array, e.g., ["tab1", "tab2"]
productDesc String Product description, supports special characters
yield String Product yield/price
productDetail String Product details, returns a content storage address, e.g., https://liveimages.videocc.net/product-info/product-detail/4d57ea01de/704007d1fdfd4cb2a5b3d3a842418831.json The URL stores the product detail content
ext String Extended information: JSON object string: {"coverList":["Cover image URLs, up to 15"], "videoList":[{"videoSource":"Video source", "videoId":"Video ID"}]} See details in EXT
- - Parameters specific to general products (productType=normal)
priceType String Actual product price type. Possible values:
AMOUNT: Amount
CUSTOM: Custom
realPrice Float Actual product price - amount, with a maximum precision of two decimal places, e.g., 12.34
customPrice String Actual product price - custom
originalPriceType String Original product price (strikethrough price) type. Possible values:
AMOUNT: Amount
CUSTOM: Custom
price Float Original product price (strikethrough price) - amount, with a maximum precision of two decimal places, e.g., 12.34
customOrignalPrice String Original product price (strikethrough price) - custom note: If both price and customOriginalPrice are empty, the original price (strikethrough price) is not enabled
- - End of parameters specific to general products (productType=normal)

Example of content stored in the productDetail URL:

{
"productDetail": "<p>这是商品详情</p>"
}

Java Request Example

Quick Start Basic Code Please download the relevant dependency source code, click here to download the source code. After downloading, add it to your own source project. The test cases HttpUtil.java and LiveSignUtil.java are included in the downloaded file.

It is strongly recommended that you use the Live Java SDK to complete API integration. The Live Java SDK provides unified encapsulation and optimization for API call logic, exception handling, data signing, and HTTP request thread pooling.

private static final Logger log = LoggerFactory.getLogger(ChannelOperateTest.class);
/**
 * 添加商品
 * @throws IOException
 */
@Test
public void testAddChannelProduct() throws IOException, NoSuchAlgorithmException {
        //公共参数,填写自己的实际参数
        String appId = super.appId;
        String appSecret = super.appSecret;
        String userId = super.userId;
        String timestamp = String.valueOf(System.currentTimeMillis());

        //业务参数
        String channelId = "2288633";
        String url = "http://api.polyv.net/live/v3/channel/product/add";

        //http 调用逻辑
        Map<String, String> requestMap = new HashMap<>();
        requestMap.put("appId", appId);
        requestMap.put("timestamp", timestamp);
        requestMap.put("channelId", channelId);
        requestMap.put("sign",LiveSignUtil.getSign(requestMap, appSecret));
        url=HttpUtil.appendUrl(url,requestMap);
        String json = "{\"name\":\"测试添加金融产品1\",\"status\":\"1\",\"linkType\":10,\"link\":\"http://live.polyv.net\",\"btnShow\":\"测试按钮显示\",\"productDesc\":\"测试产品描述\",\"yield\":\"10.01%\",\"features\":\"[\\\"tab1\\\", \\\"tab2\\\"]\",\"productType\":\"finance\", \"strategy\":\"copy\"}";
        String response = HttpUtil.postJsonBody(url, json,null);
        log.info("测试添加商品:{}",response);
        //do somethings

}

Response Example

For system-wide error descriptions, see Global Error Descriptions.

Successful Example

{
    "code": 200,
    "status": "success",
    "message": "",
    "data": {
        "productId": 134827,
        "userId": "1b448be323",
        "channelId": 2272655,
        "name": "测试添加金融产品1",
        "price": null,
        "cover": "",
        "link": "http://live.polyv.net",
        "status": 1,
        "createdTime": 1661390909000,
        "lastModified": 1661390909000,
        "rank": 55,
        "realPrice": 0,
        "type": "live",
        "linkType": 10,
        "pcLink": "",
        "mobileLink": "",
        "androidLink": null,
        "iosLink": null,
        "otherLink": null,
        "wxMiniprogramLink": "",
        "wxMiniprogramOriginalId": "",
        "wxMiniprogramAppId": "",
        "mobileAppLink": "",
        "params": "{\"id\": 21, \"color\": \"blue\", \"level\": 1}",
        "productType": "finance",
        "btnShow": "测试按钮显示",
        "features": "[\"tab1\", \"tab2\"]",
        "productDesc": "测试产品描述",
        "yield": "10.01%",
        "productDetail": "https://liveimages.videocc.net/product-info/product-detail/4d57ea01de/704007d1fdfd4cb2a5b3d3a842418831.json"
    }
}

Error Example

{
    "code": 400,
    "status": "error",
    "message": "invalid signature.",
    "data": ""
}
联系客服,在线咨询
在线咨询