We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.
This document describes how to send approved product card carousel templates to WhatsApp users.
Use the POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages endpoint to send an approved product card carousel template to a WhatsApp user.
POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages
{ "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_PHONE_NUMBER>", "type": "template", "template": { "name": "<TEMPLATE_NAME>", "language": { "code": "<TEMPLATE_LANGUAGE>" }, "components": [ { "type": "body", "parameters": [ <MESSAGE_BODY_TEXT_VARIABLE>, <MESSAGE_BODY_TEXT_VARIABLE> ] }, { "type": "carousel", "cards": [ { "card_index": <CARD_INDEX>, "components": [ { "type": "header", "parameters": [ { "type": "product", "product": { "product_retailer_id": "<PRODUCT_ID>", "catalog_id": "<CATALOG_ID>" } } ] } ] } /* Addt'l cards would follow. */ ] } ] } }
Placeholder | Description | Example Value |
---|---|---|
Integer | Required. Zero-indexed order in which card should appear within the card carousel. |
|
String | Required. ID of connected ecommerce catalog containing the product. |
|
Object | Required if template message body text uses variables, otherwise omit. Object describing a message variable. If the template uses multiple variables, you must define an object for each variable. Supports There is no maximum character limit on this value, but it does count against the message body text limit of 1024 characters. |
|
String | Required. Product ID. |
|
String | Required. Template language and locale code. |
|
String | Required. Template name. Maximum 512 characters. |
|
String | Required. WhatsApp user phone number. |
|
This example request sends an approved template named "carousel_template_product_cards_v1". It supplies a single body text variable value (which the template requires) and three product cards. Each card identifies where it should appear in the carousel (card_index), as well as the product ID and catalog ID where the card's product details (title, description, price, etc.) can be found.
curl 'https://graph.facebook.com/v21.0
/179776755229976/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "+16505551234",
"type": "template",
"template": {
"name": "carousel_template_product_cards_v1",
"language": {
"code": "en_US"
},
"components": [
{
"type": "body",
"parameters": [
{
"type": "text",
"text": "Pablo"
}
]
},
{
"type": "carousel",
"cards": [
{
"card_index": 0,
"components": [
{
"type": "header",
"parameters": [
{
"type": "product",
"product": {
"product_retailer_id": "vrpj01fvwp",
"catalog_id": "194836987003835"
}
}
]
}
]
},
{
"card_index": 1,
"components": [
{
"type": "header",
"parameters": [
{
"type": "product",
"product": {
"product_retailer_id": "va2l5ioeat",
"catalog_id": "194836987003835"
}
}
]
}
]
},
{
"card_index": 2,
"components": [
{
"type": "header",
"parameters": [
{
"type": "product",
"product": {
"product_retailer_id": "sqpjv0mgde",
"catalog_id": "194836987003835"
}
}
]
}
]
}
]
}
]
}
}'