> ## Documentation Index
> Fetch the complete documentation index at: https://developer.zapsterapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Copy code via link

> How to send a Pix copia e cola code, a boleto line or a coupon with a button that opens a page to copy the code, on any device.

Use the copy button to send a code your customer will paste into another app: a Pix copia e cola code, the typeable line of a boleto or a discount coupon. The native copy button depends on how each WhatsApp version shows the message and may not show up on some devices; in link mode, the button reaches any device.

## How to send

Send a `copyable` button with `"render_as": "link"`:

```json theme={null}
{
  "label": "Copy Pix code",
  "type": "copyable",
  "copy_code": "00020126580014br.gov.bcb.pix...6304ABCD",
  "render_as": "link"
}
```

A complete example, with the text and the button, through the [`POST /wa/messages`](https://developer.zapsterapi.com/pt-BR/v1/api-reference/messages/sending) endpoint:

```json theme={null}
{
  "instance_id": "ozj35qv418rpmlrb",
  "recipient": "5511999999999",
  "text": "Hi, Maria! Here is the Pix for December's tuition.",
  "buttons": [
    {
      "label": "Copy Pix code",
      "type": "copyable",
      "copy_code": "00020126580014br.gov.bcb.pix...6304ABCD",
      "render_as": "link"
    }
  ]
}
```

Send the `copy_code` whole, exactly as your bank or payment gateway generated it. The `label` follows the rule for every button: up to 20 characters.

## How it works

![Message on a phone with the Pix text and, below it, the "Copiar código Pix" link button](https://mintcdn.com/zapsterapi/PcMLVrJhd0XftqXs/pt-BR/v1/guides/images/copy-code-link/mensagem-com-botao.png?fit=max\&auto=format\&n=PcMLVrJhd0XftqXs\&q=85\&s=c42d0d505dd5174b5a10ff9948f116e2)

1. The message arrives with the button. With `render_as: "link"`, the API sends the button as a link (`url`) button with the same `label`.
2. Tapping the button opens a page that shows the full code.
3. On that page, the recipient copies the code, spaces and special characters included, and pastes it into the bank or store app.

## `native` or `link`

| `render_as` | What the recipient sees | When to use |
| - | - | - |
| `native` (default) | WhatsApp's native copy button, which copies without leaving the chat | When you know the recipient's device shows the native button |
| `link` | A link button that opens a page to copy the code | When the code must reach any device, such as Pix, boleto and coupons |

## Rules and support

* The converted button counts as a `url` button for every [button rule](https://developer.zapsterapi.com/en/v1/guides/messages-with-buttons.md#support-by-connection-type).
* It works on the phone, on WhatsApp Web and in groups.
* On official (WABA) instances, the button is accepted in a session message and follows the rule of exactly 1 `url` button per message, with no `reply` buttons alongside.
* `render_as` only applies when `type` is `copyable`. On any other button type, the request is rejected with a `400` error.

> [!NOTE]
>
> As with the native button, the code travels inside the message: anyone with access to the message can see the code.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.