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

KeyDescriptionConstraints
apikeyApikey of the account where the app is to be createdShould be a valid gupshup.io apikey
ContentTemplate body
languageCodeValid Language code for the template
footerTemplate FooterOptional
categoryTemplate CategoryMust always be MARKETING for catalog template
exampleTemplate Body exampleIf params are used in body
verticalTemplate Vertical
elementNameTemplate Name
templatetTypeTemplate TypeMust be CATALOG for catalog template
appidValid App ID

Response Parameters

KeyDescription
statusCreation status
TemplateTemplate 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/api/v1/template/msg' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: 7ysmxxxxxxxxxxxxxxxxvs6' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source=234812xxxxxx' \
--data-urlencode 'destination=917900xxxxxx' \
--data-urlencode 'src.name=myfoodangel' \
--data-urlencode 'template={"id":"6288db5e-824e-4fdf-990c-b157280f6db1","params": ["wc_post_id_8567"]}'
{
  "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 CodeResponseComment
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

KeyDescriptionConstraints
apikeyApikey of the account where the app is to be createdShould be a valid gupshup.io apikey
sourceSource Phone Number
src.nameSource App Name
destinationDestination phone number
TemplateJSON 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

KeyDescription
statusMessage status
MessageMessage ID