Polyv Help Center

Help Center

Usage

Updated: 2025-09-05 09:41:51

1. Get Product Tag List

Api Method: getProductTagList(params?: PageOptions): Promise<PageContent<ProductTag>>

Parameter Description:

  • params: Acquisition parameters, type PageOptions, optional, default {}

Return Value Description: Type Promise<PageContent<ProductTag>>

Example:

const data = await productTarget.getProductTagList({ pageNumber: 1 });
console.log('标签列表', data.contents);

2. Get Product List

This method can retrieve the product list via Product Sequence Number or Tag ID + Keyword.

Api Method: getProductList(params?: GetProductListParams): Promise<ProductListResult>

Parameter Description:

  • params: Acquisition parameters, type GetProductListParams, optional, default {}. Detailed type description is as follows:
Parameter Name Description Type Required Default Value
count Quantity to retrieve number No 10
displayNumber Product sequence number number No -
tagId Tag ID number No -
keyword Keyword string No -
page Page number, only passed when number No -

Return Value Description: Type Promise<ProductListResult>. Detailed type description is as follows:

Property Name Description Type
contents Product list ProductData[]
total Total count number
toppingProduct Pinned products ProductData

Example:

// 通过商品序号获取:获取 12 号商品之后的商品列表
const data = await productTarget.getProductList({ displayNumber: 12 });

// 通过标签 id 或关键词获取:获取标签 id 为 8 的商品列表,并根据关键词 '水果' 进行搜索,页数为第 2 页
const data = await productTarget.getProductList({ tagId: 8, keyword: '水果', page: 2 });

3. Get Product List (Initiator)

Api Method: getLaunchProductList(params: GetLaunchProductListParams): Promise<LaunchProductListResult>

Parameter Description:

  • params: Acquisition parameters, type GetLaunchProductListParams, required. Detailed type description is as follows:
Parameter Name Description Type Required Default Value
pageNumber - number No -
pageSize - number No -
keyword - string No -
status Listing status ProductStatus No -

Return Value Description: Type Promise<LaunchProductListResult>. Detailed type description is as follows:

Property Name Description Type
pageNumber Current page number number
pageSize Items per page number
totalItems Total records number
totalPages Total pages number
contents Content list ProductData[]
upCount Number of listed items number
downCount Number of delisted items number

4. Get Product Data

Api Method: getProductData(productId: number): Promise<ProductData>

Parameter Description:

  • productId: Product ID, type number, required

Return Value Description: Type Promise<ProductData>

5. Send Product Click Event

Call this method to send a product click event when a viewer clicks on a product.

Api Method: sendProductClickEvent(params: SendProductClickParams): Promise<void>

Parameter Description:

  • params: Send parameters, type SendProductClickParams, required. Detailed type description is as follows:
Parameter Name Description Type Required Default Value
productId Product ID number Yes -
name Product name string Yes -
productType Product type ProductType Yes -

Example:

await productTarget.sendProductClickEvent({
  productId: 123,
  name: '商品名称',
  productType: 'normal',
});

6. Close Currently Pushing Product

Call this method to close the currently pushing product when you need to close the push node in the UI layer.

Api Method: closeProductPush(): void

Example:

await productTarget.closeProductPush();

7. Get Product Explanation Toggle

Get whether product explanation is enabled for the current channel.

Api Method: getProductExplainEnabled(): Promise<boolean>

Return Value Description: Type Promise<boolean>

Example:

const enabled = await productTarget.getProductExplainEnabled();
console.log('商品讲解开关', enabled);

8. Generate Product Explanation Page URL

Api Method: generateProductExplainPageUrl(params?: T): Promise<null | string>

Parameter Description:

  • params: URL parameters, type T, optional

Return Value Description: Type Promise<null | string>

Example:

const url = await productTarget.generateProductExplainPageUrl({ productId: 123 });
console.log('商品讲解页面地址', url);

Api Method: getOutLinkProductRedirectEnabled(): Promise<boolean>

Return Value Description: Type Promise<boolean>

Example:

const enabled = await productTarget.getOutLinkProductRedirectEnabled();
console.log('商品点击直接跳转外链开关', enabled);

10. Get Whether Product Payment Orders Are Enabled

Api Method: getProductPayOrderEnabled(): Promise<boolean>

Return Value Description: Type Promise<boolean>

Example:

const enabled = await productTarget.getProductPayOrderEnabled();
console.log('商品支付订单是否开启', enabled);

11. Get Product Hot Sale Configuration

Api Method: getProductHotSaleConfig(): Promise<undefined | ProductHotSaleConfig>

Return Value Description: Type Promise<undefined | ProductHotSaleConfig>

Example:

const config = await productTarget.getProductHotSaleConfig();
console.log('商品热卖配置', config);

12. Get Currently Pushing Product Data

Api Method: getCurrentPushingProduct(productId?: number): Promise<undefined | ProductData>

Parameter Description:

  • productId: Optional, specify a product ID. If not provided, the currently configured pushing product is retrieved. Type number, optional.

Return Value Description: Type Promise<undefined | ProductData>

Example:

const productData = await productTarget.getCurrentPushingProduct();
console.log('当前推送中的商品数据', productData);

13. Start Product Explanation

Api Method: startExplain(productId: number): undefined | Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Return Value Description: Type undefined | Promise<void>

Example:

await productTarget.startExplain(123);

14. Restart Product Explanation

Api Method: restartExplain(productId: number): undefined | Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Return Value Description: Type undefined | Promise<void>

Example:

await productTarget.restartExplain(123);

15. End Product Explanation

Api Method: endExplain(productId: number): undefined | Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Return Value Description: Type undefined | Promise<void>

Example:

await productTarget.endExplain(123);

16. Delete Product Explanation

Api Method: deleteExplain(productId: number): Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Example:

await productTarget.deleteExplain(123);

17. Get Currently Explaining Product ID

Api Method: getCurrentProductExplain(): Promise<null | number>

Return Value Description: Type Promise<null | number>

Example:

const productId = await productTarget.getCurrentProductExplain();
console.log('当前正在讲解的商品 id', productId);

18. Open Product Price

Api Method: openProductPrice(productId: number): Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Example:

await productTarget.openProductPrice(123);

19. Hide Product Price

Api Method: hideProductPrice(productId: number): Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Example:

await productTarget.hideProductPrice(123);

20. Get Product Settings

Api Method: getProductSetting(): Promise<ProductSetting>

Return Value Description: Product settings, type Promise<ProductSetting>. Detailed type description is as follows:

Property Name Description Type
productExplainEnabled Product explanation toggle boolean
productExplainingAutoPushAndSticky Auto-pin product explanation boolean
productPushRule Product push method ProductPushRule | 'chooseCard'
pushingProduct Currently pushing product Object

21. Push Product

Api Method: pushProduct(productId: number, rule?: ProductPushRule): Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

  • rule: Push rule, type ProductPushRule, optional

Example:

await productTarget.pushProduct(123, ProductPushRule.SmallCard);

22. Cancel Push Product

Api Method: cancelPushProduct(productId: number): Promise<void>

Parameter Description:

  • productId: Product ID, type number, required

Example:

await productTarget.cancelPushProduct(123);

23. Batch Delete Products

Api Method: batchDeleteProduct(productIds: number[]): Promise<void>

Parameter Description:

  • productIds: List of product IDs, type number[], required

Example:

await productTarget.batchDeleteProduct([123, 456]);

24. Batch List Products

Api Method: batchOnShelfProduct(productIds: number[]): Promise<void>

Parameter Description:

  • productIds: List of product IDs, type number[], required

Example:

await productTarget.batchOnShelfProduct([123, 456]);

25. Batch Delist Products

Api Method: batchOffShelfProduct(productIds: number[]): Promise<void>

Parameter Description:

  • productIds: List of product IDs, type number[], required

Example:

await productTarget.batchOffShelfProduct([123, 456]);

26. Determine if the Current User Supports Direct Product Purchase

Api Method: getSupportToDirectBuy(): Promise<boolean>

Return Value Description: Type Promise<boolean>

Example:

const supported = await productTarget.getSupportToDirectBuy();
console.log('是否支持直接购买', supported);
联系客服,在线咨询
在线咨询