> For the complete documentation index, see [llms.txt](https://help.1msg.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.1msg.io/docs/russkii/api-1msg/shablony-waba/shablon-promokod-coupon-code.md).

# Шаблон Промокод (Coupon Code)

Coupon Code Templates — это *маркетинговые шаблоны* сообщений WhatsApp, которые содержат **одну кнопку “Скопировать код”**. При нажатии на кнопку код автоматически копируется в буфер обмена пользователя, что удобно для акций, скидок и промо-кампаний.

<div data-full-width="false"><figure><img src="/files/Xd1VnuiPk4kJbsA55aKE" alt=""><figcaption></figcaption></figure></div>

**Ограничения**

* Не поддерживаются в WhatsApp Web клиенте.
* Код купона ограничен **15 символами**.
* **Текст кнопки нельзя изменить**, и в шаблоне может быть только одна кнопка такого типа.

## Создание шаблона "Промокод"

Создание шаблона описано[ в документации API ](https://1msg-docs.web.app/ru#tag/Shablony/operation/addTemplate)в методе /addTemplate.

Шаблон Каталог:

* **Текст кнопки "Скопировать код" нельзя изменить**, и в шаблоне может быть только одна кнопка такого типа.

<details>

<summary>Пример создания шаблона  "Coupon Code"</summary>

```json
POST https://api.1msg.io/{{channel}}/addTemplate
Content-Type: application/json
Body:{
  "name": "coupon_code_fall2023_26off",
  "category": "MARKETING",
  "language": "en_US",
  "components": [
    {
      "type": "HEADER",
      "format": "TEXT",
      "text": "Our Fall Sale is on!"
    },
    {
      "type": "BODY",
      "text": "Shop now through November and use code {{1}} to get {{2}} off of all merchandise!",
      "example": {
        "body_text": [
          [
            "25OFF",
            "25%"
          ]
        ]
      }
    },
    {
      "type": "BUTTONS",
      "buttons": [
        {
          "type": "QUICK_REPLY",
          "text": "Unsubscribe"
        },
        {
          "type": "COPY_CODE",
          "example": "25OFF"
        }
      ]
    }
  ]
}

```

</details>

## Отправить шаблон "Промокод" <a href="#kak-otpravit-shablon-katalog" id="kak-otpravit-shablon-katalog"></a>

Отправка шаблона описана [ в документации API ](https://1msg-docs.web.app/ru#tag/Shablony/operation/sendTemplate)в методе /sendTemplate.

<details>

<summary>Пример отправки шаблона "Coupon Code"</summary>

```json
POST https://api.1msg.io/{{channel}}/sendTemplate
Content-Type: application/json
Body: {
  "template": "coupon_code_fall2023_25off",
  "language": {
    "policy": "deterministic",
    "code": "en_US"
  },
  "namespace": "{{namespace}}",
  "params": [
    {
      "type": "body",
      "parameters": [
        {
          "type": "text",
          "text": "25OFF"
        },
        {
          "type": "text",
          "text": "25%"
        }
      ]
    },
    {
      "type": "button",
      "sub_type": "COPY_CODE",
      "index": 1,
      "parameters": [
        {
          "type": "coupon_code",
          "coupon_code": "25OFF"
        }
      ]
    }
  ],
  "phone": "XXXXXXXXXXX"
}

        
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.1msg.io/docs/russkii/api-1msg/shablony-waba/shablon-promokod-coupon-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
