# wx.openCard(Object object)
Start from base library version 2.5.0. Please remaining backward compatible.
Views cards and offers in WeChat Cards & Offers. It can be used only in Mini Programs or cultural interaction Mini Games that complete verification. For more documents, see API Documentation for WeChat Cards & Offers.
# Parameters
# Object object
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| cardList | Array.<Object> | Yes | The list of cards and offers to be opened | |
| success | function | No | The callback function for a successful API call | |
| fail | function | No | Callback function for failed API call | |
| complete | function | No | Callback function used when API call completed (always executed whether call succeeds or fails) |
object.cardList is composed as follows
| Attribute | Type | Default | Required | Description |
|---|---|---|---|---|
| cardId | string | Yes | The ID of the card or offer | |
| code | string | Yes | It is obtained after the encrypted code in the objects returned by wx.addCard is decrypted. For details, see Code Decryption API |
# Sample Code
wx.openCard({
cardList: [{
cardId: '',
code: ''
}, {
cardId: '',
code: ''
}],
success (res) { }
})