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

# Charges with Pix and boleto

> How to send the native WhatsApp charge card with Pix (copia e cola or key) and boleto through the Zapster API, and where each field shows up for your customer.

A charge is a card message: your customer sees the charge code, the items, the total and a button to pay with Pix, with boleto or with both. It is sent through the same messages endpoint, [`POST /wa/messages`](https://developer.zapsterapi.com/pt-BR/v1/api-reference/messages/sending), with the `charge` field.

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

## Amounts in cents

`amount` and `items[].amount` are integers in the smallest unit of the currency. For the Brazilian real, that is cents:

| You want to charge | Send |
| - | - |
| R\$ 316,90 | `31690` |
| R\$ 10,00 | `1000` |
| R\$ 0,10 | `10` |

> [!WARNING]
>
> Sending `10` meaning R$ 10,00 creates a charge of R$ 0,10. Amounts with decimal places, like `10.5`, are rejected.

## Currency

The `currency` field is optional and defaults to `"BRL"`. It takes an upper case ISO 4217 code (for example `"BRL"`). Pix and boleto only exist in reais, so a charge with `pix` or `boleto` in another currency is rejected. Since every charge needs `pix` or `boleto` today, in practice the only accepted currency is the real.

## Payment methods

Send `pix`, `boleto` or both. `pix` takes three forms.

### Pix copia e cola

Send the copia e cola code (BR Code) generated by your bank or payment gateway. `merchant_name` is optional, because the code already carries the payee name.

```json theme={null}
{
  "instance_id": "ozj35qv418rpmlrb",
  "recipient": "5511999999999",
  "text": "Hi Maria, your December invoice is ready. Pay with the Pix below.",
  "charge": {
    "reference_id": "FAT-2026-12-0042",
    "amount": 31690,
    "items": [
      { "name": "Pro plan, December 2026", "amount": 29700 },
      { "name": "Additional instance", "amount": 1990 }
    ],
    "pix": { "code": "00020101021226...6304ABCD", "merchant_name": "My Company" }
  }
}
```

### Pix copia e cola with the key

The same code, plus the Pix key and its type. `key` and `key_type` go together, and `key_type` is `cpf`, `cnpj`, `email`, `phone` or `random` (random key).

```json theme={null}
"pix": {
  "code": "00020101021226...6304ABCD",
  "merchant_name": "My Company",
  "key": "billing@mycompany.com",
  "key_type": "email"
}
```

### Pix with only the key

Without `code`, WhatsApp itself builds a Pix code from your key, the `merchant_name`, the charge `amount` and the `reference_id` as the Pix identifier. Your customer copies a code that already has the amount filled in.

```json theme={null}
"charge": {
  "reference_id": "FAT2026120042",
  "amount": 31690,
  "pix": {
    "key": "billing@mycompany.com",
    "key_type": "email",
    "merchant_name": "My Company"
  }
}
```

In this form the code follows the static Pix rules:

* `merchant_name` is required and takes up to 25 characters.
* `reference_id` becomes the Pix identifier and takes up to 25 letters and digits, with no hyphen, dot, space or other symbols. Without `reference_id`, a valid identifier is generated.

### Boleto

Send the digitable line, with 47 or 48 digits. Dots and spaces are accepted. The boleto can go with any of the Pix forms.

```json theme={null}
"boleto": { "digitable_line": "50990.00001 00000.000000 00000.000000 1 00000000000000" }
```

## How the card looks

![Charge card on a phone with each area linked to the field that fills it](https://mintcdn.com/zapsterapi/JPeGVqygSFC8v6au/pt-BR/v1/guides/images/charges/charge-card-annotated.png?fit=max\&auto=format\&n=JPeGVqygSFC8v6au\&q=85\&s=797b0e2025d7f865f58254c913bc6696)

| Card area | Field |
| - | - |
| "CHARGE #FAT-2026-12-0042" header | `reference_id` |
| Item names, followed by "N items" (with a single item, "Quantity 1") | `items[].name` and `items[].quantity` |
| "Pay with" with the Pix icon | `pix` |
| "Total" | `amount` |
| Text below the card | `text` |
| Payment button | `pix` and `boleto` |

The fixed labels of the card follow the language of your customer's device.

`merchant_name` does not show on the card. It goes inside the Pix code, and your customer sees it in the bank app when confirming the payment.

Without `items`, the card shows a single item named "Cobrança" with the total. When `items` is sent, the sum of `amount` times `quantity` of the items must equal the charge `amount`.

### Phone and WhatsApp Web

* **Phone:** the "Copy Pix code" button copies the Pix code straight to the clipboard.
* **WhatsApp Web:** the button is "Review and pay", which opens the order details. The Pix code is copied from there.

## Combinations and scheduling

A charge cannot be combined with `media`, `buttons` or `template`, and `text` is required because it becomes the card body. It accepts `reply_to`, to quote another message, and `send_at`, to be scheduled. It counts toward the daily message limit like any other message.

## Webhooks

In `message.sent`, the charge arrives in `content.charge`, in the same shape you sent (amounts in cents), with `text` as the body:

```json theme={null}
{
  "type": "text",
  "content": {
    "text": "Hi Maria, your December invoice is ready. Pay with the Pix below.",
    "charge": {
      "reference_id": "FAT-2026-12-0042",
      "currency": "BRL",
      "amount": 31690,
      "items": [
        { "name": "Pro plan, December 2026", "amount": 29700, "quantity": 1 },
        { "name": "Additional instance", "amount": 1990, "quantity": 1 }
      ],
      "pix": { "code": "00020101021226...6304ABCD", "merchant_name": "My Company" }
    }
  }
}
```

A charge received from another account (for example, one sent with WhatsApp Business) arrives in `message.received` with the same `content.charge`, filled with the fields it carries.

> [!NOTE]
>
> WhatsApp does not report whether the charge was paid. Confirm the payment with your bank or gateway, which receives the Pix or the boleto.

## Errors

| Status | Code | When |
| - | - | - |
| `400` | `custom` (in `charge`) | The charge was combined with `media`, `buttons` or `template`, has neither `pix` nor `boleto`, the items do not add up to the total, `pix` has neither `code` nor `key`, `key` came without `key_type`, Pix or boleto in a currency other than `BRL`, or the digitable line does not have 47 or 48 digits. |
| `400` | `custom` (in `charge.reference_id` or `charge.pix.merchant_name`) | Pix with only the key and a `reference_id` with symbols or over 25 characters, or a missing `merchant_name` or one over 25 characters. |
| `400` | `invalid_type` (in `charge.amount`) | The amount has decimal places. Send it in cents. |
| `400` | `invalid_string` (in `charge.currency`) | The currency is not an upper case ISO 4217 code. |
| `400` | `waba_feature_not_supported` | The instance uses the official API (WABA). |
| `412` | `instance_update_required` | The unofficial instance runs a version older than charge support. Turn the instance off and on to update it. Scheduled messages are checked both when scheduled and when sent. |

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.