Catalog Template
Catalog templates are marketing templates 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.
When a customer taps the View catalog button in a catalog template message, your product catalog appears within WhatsApp.
Refer here for detailed information on how to create and use Catalog templates.
Create Catalog Templates
- Supported ONLY on CAPI
- Template Type should always be “CATALOG"
- Category Type should always be “MARKETING"
- Catalog connection is not required for template creation (but will be required while sending the template)
curl --location 'https://api.gupshup.io/wa/app/:appId/template' \
--header 'apikey: {{api_key}}' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'languageCode={{language_code}}' \
--data-urlencode 'content={{template body}}' \
--data-urlencode 'footer={{template footer}}' \
--data-urlencode 'category=MARKETING' \
--data-urlencode 'example={{template body example}}' \
--data-urlencode 'vertical={{template vertical}}' \
--data-urlencode 'elementName={{template name}}' \
--data-urlencode 'templateType=CATALOG'
{
"name": "intro_catalog_offer",
"language": "en_US",
"category": "MARKETING",
"components": [
{
"type": "BODY",
"text": "Now {{1}} shop for your favourite products right here on WhatsApp!",
"example": {
"body_text": [
[
"100"
]
]
}
},
{
"type": "FOOTER",
"text": "Best grocery deals on WhatsApp!"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "CATALOG",
"text": "View catalog"
}
]
}
]
}
{
"status": "success",
"template": {
"appId": "ceb2b861-24f6-406c-901f-3f788e02f5ea",
"category": "MARKETING",
"containerMeta": "{\"appId\":\"ceb2b861-24f6-406c-901f-3f788e02f5ea\",\"data\":\"Dear {{1}}, here are our products.\",\"buttons\":[{\"type\":\"CATALOG\",\"text\":\"View catalog\"}],\"footer\":\"Thank you for shopping with us\",\"sampleText\":\"Dear Aditya, here are our products.\",\"enableSample\":true,\"editTemplate\":false,\"allowTemplateCategoryChange\":false,\"addSecurityRecommendation\":false}",
"createdOn": 1689575961310,
"data": "Dear {{1}}, here are our products.\nThank you for shopping with us | [View catalog]",
"elementName": "mpm_self_catalog_ex",
"id": "e89dd724-535b-4e35-bebf-9d0a29174232",
"languageCode": "en",
"languagePolicy": "deterministic",
"meta": "{\"example\":\"Dear Aditya, here are our products.\"}",
"modifiedOn": 1689575961310,
"namespace": "6a54628a_7f29_45a7_80b1_46549f39062d",
"priority": 1,
"retry": 0,
"stage": "NONE",
"status": "PENDING",
"templateType": "CATALOG",
"vertical": "Testing",
"wabaId": "103775135696983"
}
}
Request Parameters
Key | Description | Constraints |
---|---|---|
apikey | Apikey of the account where the app is to be created | Should be a valid gupshup.io apikey |
Content | Template body | |
languageCode | Valid Language code for the template | |
footer | Template Footer | Optional |
category | Template Category | Must always be MARKETING for catalog template |
example | Template Body example | If params are used in body |
vertical | Template Vertical | |
elementName | Template Name | |
templatetType | Template Type | Must be CATALOG for catalog template |
appid | Valid App ID |
Response Parameters
Key | Description |
---|---|
status | Creation status |
Template | Template got created |
Send Catalog Templates
- Supported ONLY on CAPI
- Template Params should contain the productId which will be sent as thumbnail for the catalog (Must be the last element in templateParams list).
- Sending these templates not supported through Gupshup UI
curl --location 'https://api.gupshup.io/wa/app/:appId/template' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: {{apiKey}}' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source={{sender_phone_number}}' \
--data-urlencode 'destination={{destination_phone_number}}' \
--data-urlencode 'src.name={{app_name}}' \
--data-urlencode 'template={"id":"{{template_id}}","params":{{template_params_list}} }'
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "<TO>",
"type": "template",
"template": {
"name": "<NAME>",
"language": {
"code": "<CODE>"
},
"components": [
{
"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>"
}
}
]
}
]
}
}
Response
Status Code | Response | Comment |
---|---|---|
Success 200 | { "status": "submitted", "messageId": "4bed9a90-9f7a-4584-be5b-8ee1cba61a01" } | |
Error 401 | { "message": { "message": "Authentication Failed" }, "status": "error" } | When APIKey authentication fails or apikey is not sent |
Request Parameters
Key | Description | Constraints |
---|---|---|
apikey | Apikey of the account where the app is to be created | Should be a valid gupshup.io apikey |
source | Source Phone Number | |
src.name | Source App Name | |
destination | Destination phone number | |
Template | JSON containing template details | - Must include valid template id - Params must include all params including a product ID (which is to be used as a thumbnail (last in the list)) |
Response Parameters
Key | Description |
---|---|
status | Message status |
Message | Message ID |
Updated about 2 months ago