Limited-Time Offer Templates

Limited-Time Offer Templates are only available while using Cloud API.

Limited-time offer templates allow you to display expiration dates and running countdown timers for offer codes in template messages, making it easy for you to communicate time-bound offers and drive customer engagement.

Limitations

  • Only templates categorized as MARKETING are supported.

  • Footer components are not supported.

  • Users who view a limited-time offer template message using that WhatsApp web app or desktop app will not see the offer, but will instead see a message indicating that they have received a message but that it's not supported in the client they are using.

Template Creation

Use the create template endpoint to create coupon code templates.

POST https://waba-v2.360dialog.io/v1/configs/templates

Headers

{
  "id": "546151681022936",
  "status": "PENDING",
  "category": "MARKETING"
}

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

Post Body

{
  "name": "<TEMPLATE_NAME>",
  "language": "<TEMPLATE_LANGUAGE>",
  "category": "marketing",
  "components": [

    /* Header component optional */
    {
      "type": "header",
      "format": "<HEADER_FORMAT>",
      "example": {
        "header_handle": [
          "<HEADER_ASSET_HANDLE>"
        ]
      }
    },

    /* Limited-time offer component required */
    {
      "type": "limited_time_offer",
      "limited_time_offer": {
        "text": "<LIMITED_TIME_OFFER_TEXT>",
        "has_expiration": <HAS_EXPIRATION>
      }
    },

    /* Body component required */
    {
      "type": "body",
      "text": "<BODY_TEXT>",
      "example": {
        "body_text": [<BODY_TEXT_VARIABLE_EXAMPLES>]
      }
    },

    /* Copy code button component required if "has_expiration" is set to true.
       If set to false but want to use a copy code button, it must appear
       first in the "buttons" array. URL button component is always required. */
    {
      "type": "buttons",
      "buttons": [
        {
          "type": "copy_code",
          "example": "<OFFER_CODE_EXAMPLE>"
        },
        {
          "type": "url",
          "text": "<URL_BUTTON_TEXT>",
          "url": "<URL_BUTTON_URL>",
          "example": [
            "<URL_EXAMPLE_WITH_VARIABLE_EXAMPLE>"
          ]
        }
      ]
    }
  ]
}

Properties

Offer Expiration Details

The delivered message can display an offer expiration details section with a heading, an optional expiration timer, and the offer code itself.

The expiration timer is a text string that is not customizable, but it will change to red text if the message is viewed and the offer code is expiring within the next hour. (You include the actual offer code and its expiration timestamp when you send the template in a template message.)

Example Request

This is an example request to create a limited-time offer template that uses:

  • an image header component

  • body text component with variables

  • the limited time offer component

  • a copy code button

  • a button URL with a variable

{
  "name": "limited_time_offer_caribbean_pkg_2023",
  "language": "en_US",
  "category": "marketing",
  "components": [
    {
      "type": "header",
      "format": "image",
      "example": {
        "header_handle": [
          "4::aW..."
        ]
      }
    },
    {
      "type": "limited_time_offer",
      "limited_time_offer": {
        "text": "Expiring offer!",
        "has_expiration": true
      }
    },
    {
      "type": "body",
      "text": "Good news, {{1}}! Use code {{2}} to get 25% off all Caribbean Destination packages!",
      "example": {
        "body_text": [
          [
            "Pablo",
            "CARIBE25"
          ]
        ]
      }
    },
    {
      "type": "buttons",
      "buttons": [
        {
          "type": "copy_code",
          "example": "CARIBE25"
        },
        {
          "type": "url",
          "text": "Book now!",
          "url": "https://awesomedestinations.com/offers?code={{1}}",
          "example": [
            "https://awesomedestinations.com/offers?ref=n3mtql"
          ]
        }
      ]
    }
  ]
}

Sending Coupon Templates

Use the Cloud API to send approved coupon code templates in template messages.

POST https://waba-v2.360dialog.io/messages

Upon success, the API will respond with the following:

{
  "messaging_product": "whatsapp",
  "contacts": [
    {
      "input": "<INPUT>",
      "wa_id": "<WA_ID>"
    }
  ],
  "messages": [
    {
      "id": "<ID>"
    }
  ]
}

Post Body

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "<CUSTOMER_PHONE_NUMBER>",
  "type": "template",
  "template": {
    "name": "<TEMPLATE_NAME>",
    "language": {
      "code": "<TEMPLATE_LANGUAGE_CODE>"
    },
    "components": [

      /* Required if template uses header, otherwise omit */
      {
        "type": "header",
        "parameters": [
          {
            "type": "<HEADER_TYPE>",
            "<HEADER_TYPE>": {
              "id": "<HEADER_ASSET_ID>"
            }
          }
        ]
      },

      /* Body and params required if templates uses body params, otherwise omit */
      {
        "type": "body",
        "parameters": [
          <BODY_VARIABLES>
        ]
      },

      /* Required if template uses offer expiration details, otherwise omit */
      {
        "type": "limited_time_offer",
        "parameters": [
          {
            "type": "limited_time_offer",
            "limited_time_offer": {
              "expiration_time_ms": <EXPIRATION_TIME>
            }
          }
        ]
      },

      /* Copy code button required if template uses offer expiration details, or 
         if uses a copy code button without the offer expiration details */
      {
        "type": "button",
        "sub_type": "copy_code",
        "index": 0,
        "parameters": [
          {
            "type": "coupon_code",
            "coupon_code": "<OFFER_CODE>"
          }
        ]
      },

      /* Required */
      {
        "type": "button",
        "sub_type": "url",
        "index": <URL_BUTTON_INDEX>,
        "parameters": [
          {
            "type": "text",
            "text": "<URL_VARIABLE>"
          }
        ]
      }
    ]
  }
}

Properties

Example Request

Example request to send a limited-time offer template that uses:

  • an image header

  • body text variables

  • the offer expiration details

  • a copy code button

  • a URL button with a variable

{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "16505555555",
  "type": "template",
  "template": {
    "name": "limited_time_offer_caribbean_pkg_2023",
    "language": {
      "code": "en_US"
    },
    "components": [
      {
        "type": "header",
        "parameters": [
          {
            "type": "image",
            "image": {
              "id": "1602186516975000"
            }
          }
        ]
      },
      {
        "type": "body",
        "parameters": [
          {
            "type": "text",
            "text": "Pablo"
          },
          {
            "type": "text",
            "text": "CARIBE25"
          }
        ]
      },
      {
        "type": "limited_time_offer",
        "parameters": [
          {
            "type": "limited_time_offer",
            "limited_time_offer": {
              "expiration_time_ms": 1209600000
            }
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "copy_code",
        "index": 0,
        "parameters": [
          {
            "type": "coupon_code",
            "coupon_code": "CARIBE25"
          }
        ]
      },
      {
        "type": "button",
        "sub_type": "url",
        "index": 1,
        "parameters": [
          {
            "type": "text",
            "text": "n3mtql"
          }
        ]
      }
    ]
  }
}

Example Response

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

Last updated