We are sunsetting On-Premises API. Refer to our On-Premises API Sunset document for details, and to learn how to migrate to our next-generation Cloud API.

Sending Catalog Template Messages

This document explains how to send approved catalog template messages. See Sell Products & Services to learn more about product catalogs and ways to showcase your products.

Before You Start

You need to:

Once the catalog message template is approved, you can use the API to send a message.

Limitation

The feature is not available in India.

Request Syntax

Use the WhatsApp Business Phone Number > Messages endpoint to send a catalog template message using a catalog template with an APPROVED status.

POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>/messages

Post Body

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<TO>",
  "type": "template",
  "template": {
    "name": "<NAME>",
    "language": {
      "policy": "<POLICY>",
      "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>"
            }
          }
        ]
      }
    ]
  }
}

Properties

PlaceholderDescriptionSample Value

<POLICY>

String

Required.


Template language policy options.

deterministic

<CODE>

String

Required.


Template language and locale code.

en_US

<NAME>

String

Required.


Template name.

intro_catalog_offer

<THUMBNAIL_PRODUCT_RETAILER_ID>

String

Required.


Item SKU number. Labeled as Content ID in the Commerce Manager.


The thumbnail of this item will be used as the message's header image.


If the parameters object is omitted, the product image of the first item in your catalog will be used.

2lc20305pt

<TEXT>

String

Required if template uses variables.


Template variable.

100

<TO>

String

Required.


Customer phone number.

16505551234

<TYPE>

String

Required if template uses variables.


Template variable type.

text

Example Request

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "16505551234",
  "type": "template",
  "template": {
    "name": "intro_catalog_offer",
    "language": {
      "policy": "deterministic",
      "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"
            }
          }
        ]
      }
    ]
  }
}

Example Response

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "16505551234",
      "wa_id": "16505551234"
    }
  ],
  "messages": [
    {
      "id": "wamid.HBgLMTY1MDM4Nzk0MzkVAgARGBI5RkEwM0EyODFEQzQ2NDYzQTMA"
    }
  ]
}