# Activate a Credit Card Using Chat Apps
---

Use communication channels to notify your clients that their new credit card has been sent and let them active it online once they receive it.

The client will receive a notification message with a button to click. The button will include a phone number of the bank to call.

This tutorial explains how to send credit card activation instructions to customers through [WhatsApp](https://www.infobip.com/docs/whatsapp).

 Note
This tutorial uses WhatsApp as the communication channel but you can use other template-based communication channels, such as [KakaoTalk](https://www.infobip.com/docs/api/channels/kakao/alim/send-kakao-alim-message), [LINE](https://www.infobip.com/docs/api/channels/line/send-line-message), Viber, and Zalo.

## Prerequisites

* [Infobip account](https://portal.infobip.com/login/?callback=https%3A%2F%2Fportal.infobip.com%2F). If you do not have one, you can create a [free trial account](https://www.infobip.com/signup).
* Infobip API key with `whatsapp:message:send` scope. You can find out more about how to create an API key with the correct scope [here](https://www.infobip.com/docs/essentials/api-essentials/api-authorization).
* Your favorite HTTP client. In this example, we will use `curl`. Additionally, you can choose the official [Infobip SDK](https://www.infobip.com/docs/sdk) for your preferred programming language.
* Your sender. If you are in the free trial period, you can use Infobip's test sender, `447860099299`.
   If you want to configure your custom sender, request a new number or an alphanumeric sender through the [Infobip account](https://portal.infobip.com/channels-and-numbers/channels/sms/overview) or using Infobip Numbers API.
* Destination - a phone number to which the message will be sent. If you are in the free trial period, you can only send messages to your verified phone number.

## What is a WhatsApp template message?

As opposed to regular messages that need to be user-initiated and can only happen within a 24-hour window, template messages can be sent and delivered at any time. Check out our [product documentation](https://www.infobip.com/docs/whatsapp/message-types-and-templates#message-templates) for more details.

 Note
Each communication channel has its own template compliance and guidelines.

## Summary of the steps

* Create and register a WhatsApp template.
* Send a WhatsApp template message.

## Create a template [#create-a-template]

You can create a WhatsApp template through the API or use the Infobip web interface.

Note
For other template-based communication channels, contact your Infobip account manager to create and register a template.

### Use the web interface
Here are some sample placeholders you can use to personalize your template message. For the detailed steps on how to register a new template, check out our [product documentation](https://www.infobip.com/docs/whatsapp/message-types-and-templates/message-templates#create-and-register-a-whatsapp-message-template).

| Template name   | Template body                                                                                                                                               | Language | Call to Action Template Buttons                                                                                          | Approved |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------ | -------- |
| Card_activation | Hi {{1}}. Your credit card has been sent to your address today. In order to activate your card, please give us a call. | en       | Button:Type of action: Call Phone NumberButton Text: Contact us Country: GB +44 Phone Number: 1123456789 | ✅       |

Note
Some channels don't support buttons. Provide it within a template's text field instead.

### Use the API

Use the Create a WhatsApp template endpoint to create your template.

```bash
curl -L -g 'https://{baseUrl}/whatsapp/2/senders/447796344125/templates' \
-H 'Authorization: {authorization}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
  "name": "media_template_with_call_to_action_buttons",
  "language": "en",
  "category": "MARKETING",
  "allowCategoryChange": false,
  "structure": {
    "body": {
      "text": "Hi {{1}}. Your credit card has been sent to your address today. In order to activate your card, please give us a call.",
      "examples": [
        "example"
      ]
    },
    "buttons": [
      {
        "text": "Contact us",
        "phoneNumber": "1123456789",
        "type": "PHONE_NUMBER"
      }
    ],
    "type": "MEDIA"
  }
}'
```

__Key points:__

* Once you create a template, Infobip sends it for the WhatsApp validation process. You can edit the template, following the editing rules.
* For `category`, use the `MARKETING` value. This will adapt further field options in the API docs.
* For `buttons`, use `PHONE_NUMBER`. This will adapt further field options in the API docs.

### Register a WhatsApp template

Infobip takes care of your template registration. During the process, you can edit your template following the editing rules. You can also set up a webhook to get the updates about your template registration process.

## Send a message [#send-a-message]

Once registered, use the template to contact users for card verification.

```bash
curl -L -g 'https://{baseUrl}/whatsapp/1/message/template' \
-H 'Authorization: {authorization}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
  "messages": [
    {
      "from": "441134960000",
      "to": "441134960001",
      "messageId": "a28dd97c-1ffb-4fcf-99f1-0b557ed381da",
      "content": {
        "templateName": "card_activation",
        "templateData": {
          "body": {
            "placeholders": [
              "Nick"
            ]
          }
        },
        "language": "en_GB"
        }
      }
    }
  ]
}'
```

__Key points:__

* Use the international number formatting when adding a number to the `to` field. For example, for British numbers, the value will look like this: `44754322576`.