> ## 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.

# Pix key card

> How to send the native WhatsApp Pix key card through the Zapster API: the payee name, the key and a button that copies the key so your customer can make the Pix.

The Pix key card is WhatsApp's "send me a Pix to this key": your customer sees the payee name, the key and a button that copies the key to paste in the bank app. It has no amount, items or charge code. To charge an amount, use a [charge with Pix and boleto](https://developer.zapsterapi.com/en/v1/guides/send-charges.md).

The card is sent through the same messages endpoint, [`POST /wa/messages`](https://developer.zapsterapi.com/pt-BR/v1/api-reference/messages/sending), with the `pix_key` field.

> [!NOTE]
>
> Available on unofficial instances (QR code) only. On instances using the official API (WABA) the request returns `400 waba_feature_not_supported`.

> [!TIP]
>
> Only need a button to copy the code? See [Copy code via link](https://developer.zapsterapi.com/en/v1/guides/copy-code-link.md).

## Sending

```json theme={null}
{
  "instance_id": "ozj35qv418rpmlrb",
  "recipient": "5511999999999",
  "pix_key": {
    "key": "billing@mycompany.com",
    "key_type": "email",
    "merchant_name": "My Company"
  }
}
```

All three fields are required:

| Field | What it is |
| - | - |
| `merchant_name` | Payee name, shown as the card title. |
| `key_type` | Key type: `cpf`, `cnpj`, `email`, `phone` or `random` (random key). |
| `key` | The Pix key, validated by its type (see below). |

> [!WARNING]
>
> The card has no text body: WhatsApp drops the text of the message without notice. That is why a request with `text` is rejected. To explain the payment, send the text in a separate message, before or after the card.

## Key format

The key is validated by its type and sent to WhatsApp in the format the Pix system stores it. The card shows the key as it was sent: a CPF shows only its digits (`CPF: 12345678909`), without punctuation.

| `key_type` | Accepts | Example sent | Sent to WhatsApp as |
| - | - | - | - |
| `cpf` | 11 digits, with or without punctuation | `123.456.789-09` | `12345678909` |
| `cnpj` | 14 characters, with or without punctuation | `12.345.678/0001-95` | `12345678000195` |
| `phone` | Brazilian mobile or landline with the country code `55` and the area code, with or without `+` | `+55 (11) 99999-9999` | `+5511999999999` |
| `email` | Valid e-mail of up to 77 characters | `billing@mycompany.com` | the e-mail as sent |
| `random` | Random key in the format the bank generates | `123e4567-e89b-42d3-a456-426614174000` | the key in lower case |

The alphanumeric CNPJ (letters in the first 12 positions) is also accepted and goes in upper case.

> [!NOTE]
>
> Long e-mails are cut on the card, ending with an ellipsis. The button still copies the whole key.

## How the card shows up

![Pix key card on a phone with each area linked to the field that fills it](https://mintcdn.com/zapsterapi/cw8nMVpHc0ssmQ84/pt-BR/v1/guides/images/pix-key/pix-key-card-annotated.png?fit=max\&auto=format\&n=cw8nMVpHc0ssmQ84\&q=85\&s=474e3236efc2050c03184fcee5980212)

| Card area | Field |
| - | - |
| Title ("Zapster" in the picture) | `merchant_name` |
| Type and key ("CPF: 12345678909") | `key_type` and `key` |
| "Copy Pix key" button | copies the `key` |

The fixed texts of the card follow the language of your customer's device; in the picture, the phone is in English.

## Combinations and scheduling

The Pix key card cannot be combined with `text`, `charge`, `media`, `buttons` or `template`. It accepts `reply_to`, to quote another message, and `send_at`, to be scheduled. Each card counts towards the daily message limit like any other message.

## Webhooks

On `message.sent`, the card arrives in `content.pix_key`, in the same shape as the request, with the key in the format it was sent:

```json theme={null}
{
  "type": "text",
  "content": {
    "pix_key": {
      "key": "billing@mycompany.com",
      "key_type": "email",
      "merchant_name": "My Company"
    }
  }
}
```

A Pix key card received from another account (for example, sent from WhatsApp Business) arrives on `message.received` with the same `content.pix_key`, filled with the fields it carries.

> [!NOTE]
>
> WhatsApp does not tell whether your customer copied the key or made the Pix. Confirm the payment with your bank.

## Errors

| Status | Code | When it happens |
| - | - | - |
| `400` | `custom` (on `text`) | The request has `text`, which the card does not show. |
| `400` | `custom` (on `pix_key`) | The card was combined with `charge`, `media`, `buttons` or `template`. |
| `400` | `custom` (on `pix_key.key`) | The key does not match the `key_type` format. The error message states the expected format. |
| `400` | `invalid_type`, `too_small` or `invalid_enum_value` (on `pix_key`) | `key`, `key_type` or `merchant_name` is missing (or empty), or `key_type` is not one of the accepted types. |
| `400` | `waba_feature_not_supported` | The instance uses the official API (WABA). |
| `412` | `instance_update_required` | The unofficial instance runs a version older than the Pix key card. Power the instance off and on to update it. Scheduled messages are checked both when scheduled and when fired. |

In all these cases no message is sent or scheduled.


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