# Get the DOM structure of the merchandise card

Debugging Tools

Interface should be called on the server side, not in the front end (Weixin Mini Program, web pages, APP, etc.) directly called, specific reference interface call guide

Interface name: ecsgetproductcardinfo

This interface is used to get the DOM structure needed to insert the merchandise card in the article

Note: Different article types support a different range of card types

  • Image Messages: Support small cards, text links, cards
  • Graphic Messages: Support for large cards, small cards, text links

# 1. How to call

# HTTPS calls

POST https://api.weixin.qq.com/channels/ec/service/product/getcardinfo?access_token=ACCESS_TOKEN

# Cloud Calls

  • This interface does not support cloud calls

# Third party invocation

  • Third Party Platform calls are not supported by this interface.

# 2. Request parameters

# Query parametersQuery String parameters

Parameter NametypeRequired to fill inIntroductions
access_tokenstringyesInterface invoke credentials, using access_token

# Request BodyRequest Payload

Parameter NametypeRequired to fill inExampleIntroductions
product_idstringyes1000000000Product ID
article_typestringyesnewspicArticle type, currently supported: picture message (newspic), graphic message (news)
card_typenumberyes2Card type, currently supported: large card (0), small card (1), text link (2), bar card (3)

# 3. Return Parameters

# Response Payload

Parameter NametypeIntroductions
errcodenumberError code
errmsgstringError message
product_keystringProduct key, some article types need this key to insert product card
DOMstringProduct card DOM structure, most article types need to insert product card DOM structure

# 4. Note

The errcode will be 0 when the call is successful under normal circumstances.Error when WeChat will return the error code and other information, please query the error message according to the error code.

The product_key and DOM are returned only in requests for article types and card types that require this field.

# 5. Code examples

Example Requests

{
  "product_id": "1000000000",
  "article_type": "newspic",
  "card_type": 2
}

Return an example

{
  "errcode": 0,
  "errmsg": "ok",
  "product_key": "PRODUCT_KEY",
  "DOM": "DOM"
}

# 6. Error code

The following is a list of error codes for this interface, other error codes can refer to General error codes

Error codeError DescriptionSolutions
0oksuccess
10170001Illegal Product ID
10170002Types of articles not supported
10170003Card types not supported

# 7. Scope of application

How this interface can be invoked under different account types:
Official Account Service Account
  • ✔: The account can call this interface
  • Other account types that are not expressly stated may not be called on this interface without special instructions;