# Catalog Templates

Catalog templates are [marketing templates](https://app.gitbook.com/o/-M4UA2Des2wa1sGak_JB/s/-M4sMxKjL6eJRvZn6jeG-887967055/~/edit/~/changes/2393/get-started/pricing/free-vs-billed-messaging) that allow you to showcase your product catalog entirely within WhatsApp. Catalog templates display a product thumbnail header image of your choice and custom body text, along with a fixed text header and fixed text sub-header.

<figure><img src="/files/l1D8J6sHM6ZoHZ40VQBi" alt=""><figcaption><p>When a customer taps the <strong>View catalog</strong> button in a catalog template message, your product catalog appears within WhatsApp.</p></figcaption></figure>

#### Requirements&#x20;

You **must** have inventory uploaded to Meta in an ecommerce catalog connected to your WhatsApp Business Account. See [Products and Catalogs.](/docs/messaging/catalogs.md)

If you require any assistance, please reach out to our Support Team.&#x20;

## Template Creation <a href="#request-syntax" id="request-syntax"></a>

Use the create template endpoint and assemble the Catalog Template components in the request:

<mark style="color:green;">`POST`</mark> `[base-url]/v1/configs/templates`&#x20;

The message template name field is limited to 512 characters. The message template content field is limited to 1024 characters.

#### Headers

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

#### Request Body

| Name                                         | Type            | Description                                                                                                                                |
| -------------------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| name<mark style="color:red;">\*</mark>       | string          |                                                                                                                                            |
| components<mark style="color:red;">\*</mark> | array\[objects] | Array of objects that describe the components that make up the template.                                                                   |
| category<mark style="color:red;">\*</mark>   | string          | Allowed values: **`MARKETING`**                                                                                                            |
| language<mark style="color:red;">\*</mark>   | string          | [View list of supported languages here.](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

Once your template is approved, you can use Cloud API to send it in a template message.

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

```json
{
  "name": "<NAME>",
  "language": "<LANGUAGE>",
  "category": "MARKETING",
  "components": [
    {
      "type": "BODY",
      "text": "<BODY_TEXT>",
      "example": {
        "body_text": [
          [
            "<EXAMPLE_BODY_TEXT>"
          ]
        ]
      }
    },
    {
      "type": "FOOTER",
      "text": "<FOOTER_TEXT>"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "CATALOG",
          "text": "View catalog"
        }
      ]
    }
  ]
}
```

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

| Placeholder                                                                               | Description                                                                                                                                                                                              | Sample Value                                                                                                                                                       |
| ----------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>\<BODY\_TEXT></code></p><p><em>String</em></p>                                   | <p><strong>Required.</strong><br></p><p>Template body text. Variables are supported.</p><p></p><p>Maximum 1024 characters.</p>                                                                           | `Now shop for your favourite products right here on WhatsApp! Get Rs {{1}} off on all orders above {{2}}Rs! Valid for your first {{3}} orders placed on WhatsApp!` |
| <p><code>\<EXAMPLE\_BODY\_TEXT></code></p><p><em>String (of an array of strings)</em></p> | <p><strong>Required if body text uses variables.</strong></p><p></p><p>Sample strings to replace variable placeholders in <code>\<BODY\_TEXT></code> string.</p><p></p><p>Maximum 1024 characters.</p>   | `100`                                                                                                                                                              |
| <p><code>\<FOOTER\_TEXT></code></p><p><em>String</em></p>                                 | <p><strong>Optional.</strong><br></p><p>Template footer text. Variables are supported.<br></p><p>Maximum 60 characters.</p>                                                                              | `Best grocery deals on WhatsApp!`                                                                                                                                  |
| <p><code>\<LANGUAGE></code></p><p><em>String</em></p>                                     | <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> | `en_US`                                                                                                                                                            |
| <p><code>\<NAME></code></p><p><em>String</em></p>                                         | <p><strong>Required.</strong><br></p><p>Template name.</p><p></p><p>Maximum 512 characters.</p>                                                                                                          | `intro_catalog_offer`                                                                                                                                              |

**Example Request**

```json
{
  "name": "intro_catalog_offer",
  "language": "en_US",
  "category": "MARKETING",
  "components": [
    {
      "type": "BODY",
      "text": "Now shop for your favourite products right here on WhatsApp! Get Rs {{1}} off on all orders above {{2}}Rs! Valid for your first {{3}} orders placed on WhatsApp!",
      "example": {
        "body_text": [
          [
            "100",
            "400",
            "3"
          ]
        ]
      }
    },
    {
      "type": "FOOTER",
      "text": "Best grocery deals on WhatsApp!"
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "CATALOG",
          "text": "View catalog"
        }
      ]
    }
  ]
}
```

## Sending Catalog Templates&#x20;

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

#### Request Body

| Name       | Type   | Description                                                                                                                                |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| components | String | See [Components](#properties-1)                                                                                                            |
| language   | String | [View list of supported languages here.](https://developers.facebook.com/docs/whatsapp/api/messages/message-templates#supported-languages) |

{% tabs %}
{% tab title="201: Created " %}

{% endtab %}
{% endtabs %}

**Post Body:**

```json
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<TO>",
  "type": "template",
  "template": {
    "name": "<NAME>",
    "language": {
      "code": "<CODE>"
    },
    "components": [

      /* Body component required if template uses variables, otherwise omit */
      {
        "type": "body",
        "parameters": [
          {
            "type": "<TYPE>",
            "text": "<TEXT>"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "CATALOG",
        "index": 0,
        "parameters": [
          {
            "type": "action",
            "action": {
              "thumbnail_product_retailer_id": "<THUMBNAIL_PRODUCT_RETAILER_ID>"
            }
          }
        ]
      }
    ]
  }
}
```

#### Components <a href="#properties" id="properties"></a>

| Placeholder                                                                   | Description                                                                                                                                                                                                                                                                                                                                     | Sample Value          |
| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| <p><code>\<CODE></code></p><p><em>String</em></p>                             | <p><strong>Required.</strong></p><p><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>                                                                                                                                 | `en_US`               |
| <p><code>\<NAME></code></p><p><em>String</em></p>                             | <p><strong>Required.</strong></p><p><br></p><p>Template name.</p>                                                                                                                                                                                                                                                                               | `intro_catalog_offer` |
| <p><code>\<THUMBNAIL\_PRODUCT\_RETAILER\_ID></code></p><p><em>String</em></p> | <p><strong>Optional.</strong></p><p><br></p><p>Item SKU number. Labeled as Content ID in the Commerce Manager.</p><p><br></p><p>The thumbnail of this item will be used as the message's header image.</p><p><br></p><p>If the <code>parameters</code> object is omitted, the product image of the first item in your catalog will be used.</p> | `2lc20305pt`          |
| <p><code>\<TEXT></code></p><p><em>String</em></p>                             | <p><strong>Required if template uses variables.</strong></p><p><br></p><p>Template variable.</p>                                                                                                                                                                                                                                                | `100`                 |
| <p><code>\<TO></code></p><p><em>String</em></p>                               | <p><strong>Required.</strong></p><p><br></p><p>Customer phone number.</p>                                                                                                                                                                                                                                                                       | `+16505551234`        |
| <p><code>\<TYPE></code></p><p><em>String</em></p>                             | <p><strong>Required if template uses variables.</strong></p><p><br></p><p>Template variable type.</p>                                                                                                                                                                                                                                           | `text`                |

**Example Request**

```json
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "+16505551234",
  "type": "template",
  "template": {
    "name": "intro_catalog_offer",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "100"
          },
          {
            "type": "text",
            "text": "400"
          },
          {
            "type": "text",
            "text": "3"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "CATALOG",
        "index": 0,
        "parameters": [
          {
            "type": "action",
            "action": {
              "thumbnail_product_retailer_id": "2lc20305pt"
            }
          }
        ]
      }
    ]
  }
}
```


---

# 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/docs/resources/templates/catalog-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.
