Create WhatsApp Catalog Message Template
POST Method
Kaleyra allows you to create catalog templates that allow you to display your product catalog within WhatsApp messages. The 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. Customers can then click on the View catalogue button to see the whole product catalog.
Sample WhatsApp Catalog Message as displayed on end-user device:
After the end-customer clicks on the View catalogue button, the product listed under the catalog appears:
Prerequisites
The following are the prerequisites for creating the catalog message template:
- The Catalog should be linked to the WABA ID being used.
 - Businesses must have inventory uploaded to Meta in an e-commerce catalog connected to their WhatsApp Business Account.
 
API Domain and Value
| api_domain | Value | 
|---|---|
| IN pod | api.in.kaleyra.io | 
| SG Pod | api.ap.kaleyra.io | 
| EU Pod | api.eu.kaleyra.io | 
| NA pod | api.na.kaleyra.ai | 
API request to Create a WhatsApp Catalog Template
To create a WhatsApp catalog template, use the /whatsapp/template endpoint.
Request Format
The following is the request format to create a WhatsApp catalog message template:
curl --location --request POST 'https://<api_domain>/v1/<sid>/whatsapp/template' \
 --header 'api-key: <api_key>' \
 --form 'name="<name>"' \
 --form 'category="<category>"' \
 --form 'language="<language>"' \
 --form 'header="{\"type\":\"none\"}";type=application/json' \
 --form 'body="<body>"' \
 --form \
 'button_data="[
	{
   \"type\":\"<button_data_type>\"
}
]";type=application/json' --form 'sample_body="<sample_body>"' \
 --form 'footer="<footer>"' \
 --form 'waba_id="<waba_id>"' \Sample Request
The following is the sample request to create a WhatsApp catalog message template:
curl --location --request POST 'https://api.in.kaleyra.io/v1/HXXXXXXX071IN/whatsapp/template' \
 --header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3' \
 --form 'name="catalog_test"' \
 --form 'category="marketing"' \
 --form 'language="en"' \
 --form 'header="{\"type\":\"none\"}";type=application/json' \
 --form 'body="Hello, I am the new virtual assistant. I can help you discover products or provide support. Please reach out if I can help!{{$1}}{{$2}}"' \
 --form \
 'button_data="[
	{
   \"type\":\"catalog\"
}
]";type=application/json' --form 'sample_body="Hello, I am the new virtual assistant. I can help you discover products or provide support. Please reach out if I can help!{{$1}}{{$2}}"' \
 --form 'footer="This is the footer text"' \
 --form 'waba_id="xxxxxxxxxxxxxx74443"' \Parameters and Data Types
Following is the list of parameters and data types supported:
Parameter  | Data Type  | Description  | Example  | Mandatory?  | 
|---|---|---|---|---|
  | String  | Account SID (Security Identifier).  | HXXXXXXX071IN  | Yes  | 
  | String  | API key generated from kaleyra.io account.  | Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3  | Yes  | 
  | String  | Template name.  | catalog_test  | Yes  | 
  | String  | The Marketing is only supported Category.  | Marketing  | Yes  | 
  | String  | The language in which you want to create the template.  | en_us  | Yes  | 
  | JSON  | Only type None is supported for the WhatsApp catalog template.  | 
  | Yes  | 
  | String  | Body of the message.  | Hello, I am the new virtual assistant. I can help you discover products or provide support. Please reach out if I can help!{{$1}}{{$2}}  | Yes  | 
  | List of JSON  | Only type Catalog is supported for the WhatsApp catalog template.  | 
  | Yes  | 
  | String  | Sample of the message you want to send with Catalog.  | Hello, I am the new virtual assistant. I can help you discover products or provide support. Please reach out if I can help!{{$1}}{{$2}}  | Yes  | 
  | String  | Body of the footer.  | This is the footer text  | No  | 
  | String  | WhatsApp Business Account ID  | xxxxxxxxxxxxxx74443  | Yes  | 
Sample Success Response
The following success message appears with status 200:
{
    "status": 200,
    "message": "Template created successfully.",
    "data": [],
    "error": {}
}Error Codes
For information related to the WhatsApp error code, see WhatsApp Error Codes.
Note:To send the WhatsApp catalog message using the template, see Send a Catalog Message through WhatsApp Template.
Updated 4 months ago
