We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.
Media card carousel templates allow you to send a single text message accompanied by a set of up to 10 media cards in a horizontally scrollable view:
When a user taps a media card's URL button to buy a product, the URL mapped to the button is loaded in the device's default web browser, thus taking the user out of the WhatsApp client experience. If you prefer to keep the user in the WhatsApp client, see Product Card Carousel Templates.
Carousel templates are composed of message body text and up to 10 media cards. Each card in the template has an image or video header asset, card body text, and up to two buttons. Button combinations can be a mix of quick reply buttons, phone number buttons, and URL buttons.
All cards defined on a template must have the same components.
WhatsApp users who place an order do so outside of the WhatsApp client, so no webhooks are triggered describing their order.
Use the POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates endpoint to create a media card carousel template.
POST /<WHATSAPP_BUSINESS_ACCOUNT_ID>/message_templates
It is only necessary to define two product cards upon template creation. An approved template with two product cards can be used to send up to 10 cards in a template message.
{ "name": "<TEMPLATE_NAME>", "language": "<TEMPLATE_LANGUAGE>", "category": "marketing", "components": [ { "type": "body", "text": "<MESSAGE_BODY_TEXT>", "example": { "body_text": [ [ "<MESSAGE_BODY_TEXT_VARIABLE_EXAMPLE>", "<MESSAGE_BODY_TEXT_VARIABLE_EXAMPLE>" ] ] } }, { "type": "carousel", "cards": [ /* First media card */ { "components": [ { "type": "header", "format": "<CARD_HEADER_FORMAT>", "example": { "header_handle": [ "<CARD_HEADER_ASSET_HANDLE>" ] } }, { "type": "body", "text": "<CARD_BODY_TEXT>", "example": { "body_text": [ [ "<CARD_BODY_TEXT_VARIABLE_EXAMPLE>", "<CARD_BODY_TEXT_VARIABLE_EXAMPLE>" ] ] } }, /* At least 1 button required, maximum 2; button types can be mixed */ { "type": "buttons", "buttons": [ { "type": "quick_reply", "text": "<QUICK_REPLY_BUTTON_LABEL_TEXT>" }, { "type": "url", "text": "<URL_BUTTON_LABEL_TEXT>", "url": "<URL_BUTTON_URL>", "example": [ "<URL_BUTTON_URL_VARIABLE_EXAMPLE>" ] }, { "type": "phone_number", "text": "<PHONE_NUMBER_BUTTON_LABEL_TEXT>", "phone_number": "<PHONE_NUMBER>" } ] } ] }, /* Addt'l cards would follow, using same structure as first card */ ] } ] }
Placeholder | Description | Example Value |
---|---|---|
String | Required. Card body text. Supports variables. Maximum 160 characters. |
|
String | Required if card body text uses variables. Card body text example variable string(s). Number of strings must match the number of variable placeholders in the card body text string. If card body text uses a single variable, |
|
String | Required. Uploaded media asset handle. Use the Resumable Upload API to generate an asset handle. Media assets are automatically cropped to a wide ratio based on the WhatsApp user's device. |
|
String | Required. Card header format. Value can be |
|
String | Required. Message body text. Supports variables. Maximum 1024 characters. |
|
String | Required if message body text string uses variables. Message body text example variable string(s). Number of strings must match the number of variable placeholders in the message body text string. If message body text uses a single variable, |
|
String | Required if using a phone number button. Alphanumeric string. Business phone number to be called when the WhatsApp user taps the button. Maximum 20 characters. |
|
String | Required if using a phone number button. Phone number button label text. Maximum 25 characters. |
|
String | Required if using a quick-reply button. Quick-reply button label text. Maximum 25 characters. |
|
String | Required. Template language and locale code. |
|
String | Required. Template name. Maximum 512 characters. |
|
String | Required if using a URL button. URL button label text. 25 characters maximum. |
|
String | Required if using a URL button. URL to be loaded in the device's default web browser when the WhatsApp user taps the button. Supports 1 variable. Variable placeholder must be appended to the end of the URL string. Maximum 2000 characters. |
|
String | Required if URL button URL uses a variable. URL button URL example variable string. Maximum 2000 characters. |
|
This example request creates a media card carousel template with a message that uses 3 variables and 3 media cards. Each media card has card body text without variables, a quick reply button, and a URL button that uses a variable.
curl 'https://graph.facebook.com/v21.0
/102290129340398/message_templates' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
"name": "carousel_template_media_cards_v1",
"language": "en_US",
"category": "marketing",
"components": [
{
"type": "body",
"text": "Rare succulents for sale! {{1}}, add these unique plants to your collection. Each of these rare succulents are {{2}} if you checkout using code {{3}}. Shop now and add some unique and beautiful plants to your collection!",
"example": {
"body_text": [
[
"Pablo",
"30%",
"30OFF"
]
]
}
},
{
"type": "carousel",
"cards": [
{
"components": [
{
"type": "header",
"format": "image",
"example": {
"header_handle": [
"4::an..."
]
}
},
{
"type": "body",
"text": "Add a touch of elegance to your collection with the beautiful Aloe 'Blue Elf' succulent. Its deep blue-green leaves have a hint of pink around the edges."
},
{
"type": "buttons",
"buttons": [
{
"type": "quick_reply",
"text": "Send me more like this!"
},
{
"type": "url",
"text": "Shop",
"url": "https://www.luckyshrub.com/rare-succulents/{{1}}",
"example": [
"BLUE_ELF"
]
}
]
}
]
},
{
"components": [
{
"type": "header",
"format": "image",
"example": {
"header_handle": [
"4::an..."
]
}
},
{
"type": "body",
"text": "The Crassula Buddha's Temple is sure to be a conversation starter with its tiny temple shaped leaves, intricate details, and lacy texture."
},
{
"type": "buttons",
"buttons": [
{
"type": "quick_reply",
"text": "Send me more like this!"
},
{
"type": "url",
"text": "Shop",
"url": "https://www.luckyshrub.com/rare-succulents{{1}}",
"example": [
"BUDDHA"
]
}
]
}
]
},
{
"components": [
{
"type": "header",
"format": "image",
"example": {
"header_handle": [
"4::an..."
]
}
},
{
"type": "body",
"text": "The Echeveria 'Black Prince' is a stunning succulent, with near-black leaves, adorned with a hint of green around the edges, giving it its striking appearance."
},
{
"type": "buttons",
"buttons": [
{
"type": "quick_reply",
"text": "Send me more like this!"
},
{
"type": "url",
"text": "Shop",
"url": "https://www.luckyshrub.com/rare-succulents{{1}}",
"example": [
"BLACK_PRINCE"
]
}
]
}
]
}
]
}
]
}'
Once your catalog template is approved, you can use the Cloud API to send it in a template message.