Edit Product
Updated: 2026-07-13 11:28:48
API Description
1、编辑标签
2、接口支持https协议
API URL
https://api.polyv.net/live/v4/user/product/update
Request Method
POST
API Constraints
- The API supports both HTTP and HTTPS. HTTPS is recommended for security. API calls have frequency limits. See details
Request Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| appId | true | String | Account appId See details: Get Secret Key |
| timestamp | true | Long | Current 13-digit millisecond timestamp, valid for 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 not be saved or used directly on the client side. All APIs must be called through the customer's own server to relay requests to the POLYV server for response data. See details: Signature Generation Rules |
Request Body Parameter Description
| Parameter | Required | Type | Description |
|---|---|---|---|
| productId | true | String | Product ID |
| name | true | String | Product name |
| cover | false | String | Cover image. Required for normal product type. |
| linkType | true | Integer | Product link type: 10: General link, 11: Multi-platform link, 12: Call native method |
| link | true | String | Product link cannot be empty |
| productType | false | String | Product type. Optional values: normal: General product finance: Financial product position: Job product Defaults to normal if not provided |
| pcLink | false | String | PC link |
| mobileLink | false | String | Mobile link |
| wxMiniprogramOriginalId | false | String | WeChat Mini Program original ID |
| wxMiniprogramLink | false | String | WeChat Mini Program link |
| mobileAppLink | false | String | Mobile app link |
| iosLink | false | String | iOS link |
| androidLink | false | String | Android link |
| otherLink | false | String | Other platform link |
| features | false | String | Product features, selling point tags. Can be multiple, JSON array |
| tagIds | false | Array |
Product tag ID list |
| btnShow | false | String | Button display text |
| productDesc | false | String | Product description |
| 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: EXT Pass either cover or ext. If both are passed, ext takes precedence. |
| - | - | - | Parameters specific to general products (productType=normal) |
| priceType | false | String | Actual price type. Optional values: AMOUNT: Amount CUSTOM: Custom Defaults to AMOUNT if not provided |
| realPrice | false | Float | Actual price - amount. Required when priceType=AMOUNT. Maximum precision of two decimal places, e.g., 12.34 |
| customPrice | false | String | Actual price - custom. Required when priceType=CUSTOM. Maximum 20 characters |
| originalPriceType | false | String | Original price (strikethrough price) type. Optional values: AMOUNT: Amount CUSTOM: Custom Defaults to AMOUNT |
| price | false | Float | Original price (strikethrough price) - amount. Effective when originalPriceType=AMOUNT. Maximum precision of two decimal places, e.g., 12.34 |
| customOrignalPrice | false | String | Original 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 general products (productType=normal) |
EXT
| Parameter | Required | Type | Description |
|---|---|---|---|
| coverList | true | Array | Cover image URL array, max 15 |
| videoList | false | Array | Video array, max 1 See details: ChannelProductExtVideo. Requires material library to be enabled. |
| jumpWay | false | String | Jump method for external link purchase - general link: POP_UP - Popup window, NEW_WINDOW - New window, CURRENT_WINDOW - Current window |
ChannelProductExtVideo
| Parameter | Required | Type | Description |
|---|---|---|---|
| videoId | true | String | Video ID |
| videoSource | true | String | Video source: MATERIAL_LIBRARY - Material library |
Example
https://api.polyv.net/live/v4/user/product/update?appId=frlr1zazn3&sign=012332FBD8DBCFC068AFCB484A2ADECB×tamp=1670550787318
Request body JSON parameters:
{
"productId": "1729060628513820672",
"productType": "normal",
"linkType": 10,
"link": "http://123.456.com",
"pcLink": "",
"mobileLink": "",
"wxMiniprogramOriginalId": "",
"wxMiniprogramLink": "",
"mobileAppLink": "",
"iosLink": "",
"androidLink": "",
"otherLink": "",
"cover": "//liveimages.videocc.net/uploaded/images/2023/11/gqzb4tybhf.jpg",
"name": "123",
"price": 0,
"realPrice": 0,
"status": 1,
"features": "[\"123\",\"\"]",
"tagIds": [1001, 1002],
"productDesc": "",
"productDetail": ""
}
Response Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response status code. 200 indicates success, non-200 indicates failure. |
| status | String | Response result. Determined by business logic. Returns success on success, error on failure. |
| success | Boolean | Response result. Determined by business logic. Returns true on success, false on failure. |
| error | Object | Error information when status code is non-200 See details: Error Field Description |
| requestId | String | Request ID. A unique UUID generated for each request. Only for troubleshooting and debugging. Should not be tied to business logic. |
Error Parameter Description
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Error code, used to identify the specific error cause |
| desc | String | Error description, corresponding to error.code |
Java Request Example
For quick integration of 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. HttpUtil.java and LiveSignUtil.java in the test cases are included in the downloaded file.
It is strongly recommended to use the Live Java SDK for API integration. The Live Java SDK provides unified packaging and optimization for API call logic, exception handling, data signing, and HTTP request thread pools.
private final Logger log = LoggerFactory.getLogger(getClass());
/**
* 修改商品
* @throws IOException
* @throws NoSuchAlgorithmException
*/
@Test
public void updateProductTest() throws IOException, NoSuchAlgorithmException {
//公共参数,填写自己的实际参数
String appId = super.appId;
String appSecret = super.appSecret;
String timestamp = String.valueOf(System.currentTimeMillis());
String url = "https://api.polyv.net/live/v4/user/product/update";
//业务参数
String productId = "1729060628513820672";
String name = "平台商品";
String productType = "normal";
Integer linkType = 10;
String link = "http://123.456.com";
String cover = "//liveimages.videocc.net/uploaded/images/2023/11/gqzaoq7pk3.png";
//http 调用逻辑
Map<String, String> requestMap = new HashMap<>();
requestMap.put("appId", appId);
requestMap.put("timestamp", timestamp);
Map<String, Object> jsonMap = new HashMap<>();
jsonMap.put("productId", productId);
jsonMap.put("name", name);
jsonMap.put("linkType", linkType);
jsonMap.put("link", link);
jsonMap.put("productType", productType);
jsonMap.put("cover", cover);
requestMap.put("sign", LiveSignUtil.getSign(requestMap, appSecret));
url = HttpUtil.appendUrl(url, requestMap);
String response = HttpUtil.postJsonBody(url, JSON.toJSONString(jsonMap), null);
log.info("测试修改商品结果:{}", response);
//do somethings
}
Response Example
For global system error descriptions, see Global Error Description
Success Example
{
"code": 200,
"status": "success",
"requestId": "78de516b69364aeabe7d080e7228cc5c.77.16705507903976231",
"data": null,
"success": true
}
Error Example
{
"code": 400,
"status": "error",
"requestId": "d310b70bc329403f87f77f9203d50f89.128.16360831552223589",
"error": {
"code": 20001,
"desc": "application not found."
},
"success": false
}
