We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.

Sending Product Card Carousel Templates

This document describes how to send approved product card carousel templates to WhatsApp users.

Request Syntax

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

Post Body

{
  "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. */

        ]
      }
    ]
  }
}

Post Body Parameters

PlaceholderDescriptionExample Value

<CARD_INDEX>

Integer

Required.

Zero-indexed order in which card should appear within the card carousel. 0 indicates first card, 1 indicates second card, etc.

0

<CATALOG_ID>

String

Required.

ID of connected ecommerce catalog containing the product.

194836987003835

<MESSAGE_BODY_TEXT_VARIABLE>

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 text, currency, and date_time types. See Messages Parameters.

There is no maximum character limit on this value, but it does count against the message body text limit of 1024 characters.

{
  "type":"text",
  "text": "Pablo"
}

<PRODUCT_ID>

String

Required.

Product ID.

vrpj01fvwp

<TEMPLATE_LANGUAGE>

String

Required.

Template language and locale code.

en_US

<TEMPLATE_NAME>

String

Required.

Template name.

Maximum 512 characters.

carousel_template_media_cards_v1

<WHATSAPP_USER_PHONE_NUMBER>

String

Required.

WhatsApp user phone number.

+16505551234

Example Request

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"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}'