# Product Card Carousel Templates

{% hint style="info" %}
Product Card Carousel Templates are only available while using Cloud API.&#x20;
{% endhint %}

Product Card Carousel templates allow you to send a single text message (1), accompanied by a set of up to 10 carousel cards (2) in a horizontally scrollable view.

From January 2024, in addition to the mobile device experience, users can now view Carousel messages seamlessly on the WhatsApp Web Client.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FtmVI6xZbuXkEDkdTBcra%2Fimage.png?alt=media&#x26;token=3fa4de65-448e-4938-a62b-30e4c9f325fa" alt=""><figcaption></figcaption></figure>

#### SPM (View Button)

You can add the SPM button to your Product Card Carousel Template and users can tap it to see details about the product, and can add or remove the product from the WhatsApp shopping cart.&#x20;

See more details in [Single-Product Message Templates (View Button) ](https://docs.360dialog.com/partner/messaging/template-messages/single-product-message-templates)

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2Fhb0H7pAHQuL8mxScq4sf%2Fimage.png?alt=media&#x26;token=7b8b515c-371c-449c-b050-5fe101b796fe" alt=""><figcaption><p>Example Product Card Carrousel with View Button</p></figcaption></figure>

#### URL Buttons <a href="#url-buttons" id="url-buttons"></a>

Instead of **View** buttons you may wish to use **URL** buttons. When a WhatsApp user taps a URL button to buy a product, the URL is loaded in the device's default web browser, taking the user out of the WhatsApp client experience. This can be useful if, for example, you wish to load the product in your checkout page where users can add promo codes and find related products.

<figure><img src="https://2248475362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuyAl2S0lSHJaNDXJHo7A%2Fuploads%2FwXmsk2PKBPkSo6u8BiiA%2Fphoto.png?alt=media&#x26;token=9fd3cc5c-552c-4379-bd58-b747e005ac4e" alt=""><figcaption><p>Example Product Card Carrousel with URL Button</p></figcaption></figure>

#### Carousel Cards

Carousel templates support up to 10 carousel cards. Cards must have a media header (image or video) and can optionally include body text and up to 2 [quick reply buttons, phone number buttons, or URL buttons](https://docs.360dialog.com/partner/messaging/template-messages/..#buttons-1) or[ SPM buttons](https://docs.360dialog.com/partner/messaging/template-messages/single-product-message-templates) (button types can be mixed).

The media header format and buttons must be the same across all cards that make up a carousel template. Media assets will be cropped to a wide ratio based on the customer's device.

#### Catalogs <a href="#catalogs" id="catalogs"></a>

To use product card carousel templates, you must have an ecommerce[ product catalog](https://docs.360dialog.com/partner/messaging/commerce-and-payments/products-and-catalogs), with inventory, connected to your WhatsApp Business Account.&#x20;

#### Webhooks <a href="#webhooks" id="webhooks"></a>

If you send a carousel template composed of product cards that use a **View** button, when a customer adds one or more products to their cart and submits an order, you will receive a webhook that [describes the order](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#order-messages).

With URL button flows, since order placement happens outside of the WhatsApp, webhooks [describing the order](https://docs.360dialog.com/partner/onboarding/webhook-events-and-setup/webhook-events-partner-and-messaging-api#order-messages) are not triggered.&#x20;

### Creating Product Card Carousel Templates <a href="#creating-product-card-carousel-templates" id="creating-product-card-carousel-templates"></a>

Use the create template [endpoint](https://app.gitbook.com/s/-M4sMxKjL6eJRvZn6jeG-887967055/messaging-api/api-reference/templates#post-v1-configs-templates) to create the Product Card Carousel Template.

**Headers**

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| D360-API-KEY | string |             |

Once your template is approved, you can send it in a template message.

#### Post Body <a href="#post-body" id="post-body"></a>

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.

```json
{
  "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 product card */
        {
          "components": [
            {
              "type": "header",
              "format": "product"
            },

            /* Supports 1 button only, can be either an SPM button or URL button */
            {
              "type": "buttons",
              "buttons": [

                /* SPM button */
                {
                  "type": "spm",
                  "text": "View"
                }

                /* URL button */
                {
                  "type": "url",
                  "text": "<URL_BUTTON_LABEL_TEXT>",
                  "url": "<URL_BUTTON_URL>",
                  "example": [
                    "<URL_BUTTON_URL_VARIABLE_EXAMPLE>"
                  ]
                }

              ]
            }
          ]
        },
     
        /* Second product card would follow, using same structure as
           first card. It is only necessary to define two cards. */

      ]
    }
  ]
}
```

#### Properties <a href="#body-properties" id="body-properties"></a>

<table><thead><tr><th width="512.3333333333333">Placeholder</th><th width="267">Description</th><th>Example Value</th></tr></thead><tbody><tr><td><p><code>&#x3C;MESSAGE_BODY_TEXT></code></p><p></p><p><em>String</em></p></td><td><p><strong>Required.</strong><br></p><p>Message bubble text string. Supports variables.</p><p></p><p>Maximum 1024 characters.</p></td><td><code>Summer is here, and we've got the freshest produce around! Use code {{1}} to get {{2}} off your next order.</code></td></tr><tr><td><p><code>&#x3C;MESSAGE_BODY_TEXT_VARIABLE_EXAMPLE></code></p><p><em>String</em></p></td><td><p><strong>Required if the message body text string uses variables.</strong></p><p></p><p>Message body text example variable string(s). </p><p></p><p>Number of strings must match the number of variable placeholders in the message body text string.</p><p></p><p>If message body text uses a single variable, <code>body_text</code> value can be a string, otherwise it must be an array containing an array of strings.</p></td><td><code>"15OFF","15%"</code></td></tr><tr><td><p><code>&#x3C;TEMPLATE_LANGUAGE></code></p><p><em>Enum</em></p></td><td><p><strong>Required.</strong><br></p><p>Template <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/supported-languages">language and locale code</a>.</p></td><td><code>en_US</code></td></tr><tr><td><p><code>&#x3C;TEMPLATE_NAME></code></p><p><em>String</em></p></td><td><p><strong>Required.</strong><br></p><p>Template name.</p><p></p><p>Maximum 512 characters.</p></td><td><code>summer_carousel_promo_2023</code></td></tr><tr><td><p><code>&#x3C;URL_BUTTON_LABEL_TEXT></code></p><p><em>String</em></p></td><td><p><strong>Required if using a URL button.</strong><br></p><p><a href="..#url-buttons">URL button</a> label text. </p><p></p><p>25 characters maximum.</p></td><td><code>Buy now</code></td></tr><tr><td><p><code>&#x3C;URL_BUTTON_URL></code></p><p><em>String</em></p></td><td><p><strong>Required if using a URL button.</strong><br></p><p>URL of website that loads in the device's default mobile web browser when the <a href="https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/components#url-buttons">URL button</a> is tapped by the app user.</p><p></p><p>Supports 1 variable, appended to the end of the URL string.</p><p></p><p>Maximum 2000 characters.</p></td><td><code>https://www.luckyshrub.com/shop?promo={{1}}</code></td></tr><tr><td><p><code>&#x3C;URL_BUTTON_VAR_EXAMPLE></code></p><p><em>String</em></p></td><td><p><strong>Required if using a URL button.</strong><br></p><p>URL of website. Supports 1 variable.<br></p><p>If using a variable, add sample variable property to the end of the URL string. The URL loads in the device's default mobile web browser when the customer taps the <a href="..#url-buttons">URL button</a>.</p><p></p><p>Maximum 2000 characters.</p></td><td><code>https://www.luckyshrub.com/shop?promo=summer_lemons_2023</code></td></tr></tbody></table>

#### **Example Request**

```json
{
    "name": "template_name",
    "language": "en",
    "category": "MARKETING",
    "components": [{
            "type": "BODY",
            "text": "Rare succulents for sale! {{1}}, add these unique plants to your collection.",
            "example": {
                "body_text": [
                    [
                        "Pablo"
                    ]
                ]
            }
        }, {
            "type": "CAROUSEL",
            "cards": [

                {
                    "components": [{
                            "type": "HEADER",
                            "format": "PRODUCT"
                        },

                        {
                            "type": "buttons",
                            "buttons": [

                                {
                                    "type": "spm",
                                    "text": "View"
                                }

                            ]
                        }
                    ]
                },
                {
                    "components": [{
                            "type": "HEADER",
                            "format": "PRODUCT"
                        },

                        {
                            "type": "buttons",
                            "buttons": [

                                {
                                    "type": "spm",
                                    "text": "View"
                                }

                            ]
                        }
                    ]
                },
                {
                    "components": [{
                            "type": "HEADER",
                            "format": "PRODUCT"
                        },

                        {
                            "type": "buttons",
                            "buttons": [

                                {
                                    "type": "spm",
                                    "text": "View"
                                }

                            ]
                        }
                    ]
                }


            ]
        }
    ]
}
```

#### Example Response <a href="#example-response" id="example-response"></a>

```json
{
    "category": "MARKETING",
    "components": [
    //Array of Components
    ],
    "external_id": "11987839xxxxxxxx",
    "id": "dDJN6HNxxxxxxxxxxxxxWT",
    "language": "en",
    "name": "template_name",
    "namespace": "ed620b19_xxxx_xxxx_xxxx_670f20036e2b",
    "rejected_reason": null,
    "status": "submitted"
}
```

## Sending Product Card Carousel Templates <a href="#sending-coupon-templates" id="sending-coupon-templates"></a>

Once your carousel template is approved, you can use the Cloud API to send it in a Product Card Carousel Template Message.

<mark style="color:green;">`POST`</mark> `https://waba-v2.360dialog.io/messages`

#### Request Body

| Name               | Type                           | Description                                                                                                                  |
| ------------------ | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| messaging\_product | string                         | <p><strong>Required only for Cloud API.</strong><br>Messaging service used for the request. Use <code>"whatsapp"</code>.</p> |
| recipient\_type    | string                         | individual                                                                                                                   |
| to                 | string                         | Recipient phone number                                                                                                       |
| type               | string                         | template                                                                                                                     |
| name               | string                         | Template name                                                                                                                |
| language           | string                         | Template language                                                                                                            |
| code               | string                         | Language code                                                                                                                |
| components         | Your template components array | <p><strong>Required.</strong></p><p>Assemble your payload similar to the structure of the template you created.</p>          |

{% hint style="warning" %}
It is only possible to send Templates with an Active status. A message template's status can change automatically from **Active** to **Paused** or **Disabled** based on feedback from customers. For this reason, we recommend that you [monitor status changes](#monitoring-status-changes) to take appropriate actions whenever a message template that you rely upon becomes, or is in danger of becoming, paused or disabled.
{% endhint %}

#### Example with SPM View Button

```json
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "phone_number",
  "type": "template",
  "template": {
    "name": "template_name",
    "language": {
      "code": "en"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "Pablo"
          }
        ]
      },
      {
        "type": "carousel",
        "cards": [
          {
            "card_index": 0,
            "components": [
              {
                "type": "header",
                "parameters": [
                  {
                    "type": "product",
                    "product": {
                      "product_retailer_id": "osb5529j3w",
                      "catalog_id": "419472613037220"
                    }
                  }
                ]
              }
            ]
          },
          {
            "card_index": 1,
            "components": [
              {
                "type": "header",
                "parameters": [
                  {
                    "type": "product",
                    "product": {
                      "product_retailer_id": "huhn",
                      "catalog_id": "419472613037220"
                    }
                  }
                ]
              }
            ]
          },
          {
            "card_index": 2,
            "components": [
              {
                "type": "header",
                "parameters": [
                  {
                    "type": "product",
                    "product": {
                      "product_retailer_id": "best_product_ever",
                      "catalog_id": "419472613037220"
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.360dialog.com/partner/messaging/template-messages/product-card-carousel-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
