## Overview

The **dispatch cost calculator** shows how much a WhatsApp campaign will cost **before** you send it
and how much it cost **afterward**. The math is based on the **per-message tariff** Meta charges per
**template category** (marketing, utility and authentication) and the recipient's **country**,
converted from **USD** to **BRL** at the current exchange rate.

> Only **WhatsApp Cloud** is billed by Meta. **WhatsApp Web** inboxes have no per-message Meta cost,
> so they show up as **free** (`billable: false`).

The platform uses this same number in two places: the **calculator** (a what-if simulation) and the
**audience cost estimate** shown in the campaign composer.

## Prerequisites

- Access to the **Campaigns** module.
- For a billed cost: a connected **WhatsApp Cloud inbox** (Web generates no Meta cost).
- The campaign's **template category** — **marketing**, **utility** or **authentication**. The
  category is what sets the per-message tariff.

## Step by step

1. Open **Campaigns** in the sidebar.
2. Open the **Dispatch calculator** (the calculator button on the campaigns screen).
3. Choose the recipients' **country** from the selector (e.g., BR, US, MX...).
4. For each **category** (marketing, utility, authentication), enter the **quantity** of messages.
5. Per row, review the **per-message tariff** (in USD) and the **total in BRL**.
6. Check the highlighted **estimated total cost** (USD and BRL) and the number of **billable** messages.

In the campaign composer, when you set the **audience** and the **category**, the platform also shows
the **estimated cost** of the resolved audience (labels, specific contacts, saved segments or all),
already in BRL.

## Settings & options

- **Per-category tariffs (USD)**: each category has a per-message tariff per country, following Meta's
  2026 official rate card.
- **USD → BRL conversion**: uses the live exchange rate of the day (cached ~1h). Use **Refresh** to
  fetch a fresh quote bypassing the cache, or **Adjust** to enter a manual what-if rate.
- **Rate source**: the badge shows whether the rate is **live**, **estimated** (a fallback used when
  the quote is unavailable) or **manual**.
- **Admin-editable tariff (override)**: Meta has **no pricing API**, so an administrator can **edit
  the tariff** per category/country with the real negotiated price. The row gets a **custom** badge.
  Leaving the tariff field **blank and saving** **restores** the official/synced rate.
- **Sync (official)**: reads **Meta's own published rate table** (the "Rates in USD" CSV linked from
  the developer pricing page) and refreshes the per-country, per-category tariffs. Updated rows then
  show the **synced** source. An **admin override still wins** over a synced rate — syncing never
  erases the price you negotiated. If the read fails, **nothing changes**: the editable/base table
  stays in force.
- **Alternative rate source**: to feed the tariffs yourself, point the `WHATSAPP_PRICING_SOURCE_URL`
  environment variable at a **JSON or CSV** endpoint carrying the rate per country and category. The
  platform uses that source instead of the official page.
- **Audience cost estimate (in the composer)**: when you pick audience + category, the platform
  resolves the phone-bearing contacts and returns the **estimated cost** in BRL and whether it is
  **billable**.
- **Estimated vs. actual cost on the campaign**: the campaign stores the **estimated cost**
  (`estimated_cost`), the **actual cost** (`actual_cost`) and the **currency** (`currency`, default
  BRL). The estimate is written at creation (Cloud only); the actual cost accrues as billable messages
  (delivered/read/replied) are counted.

## Use cases

- **Budget a promotion**: simulate 10,000 marketing messages to Brazil and see the BRL total before
  approving.
- **Compare categories**: see the price difference between marketing, utility and authentication to
  pick the best format.
- **Validate billing**: record the real price negotiated with Meta in the editable tariff and compare
  the **estimated cost** with the **actual cost** at the end of the campaign.

## Tips, limits & best practices

- **WhatsApp Web has no Meta cost**: Web rows and campaigns show up as **free** (`billable: false`)
  and don't add to the budget.
- **Restore the official tariff**: to undo an override, leave the tariff field **blank** and save —
  this reverts to the official/synced rate.
- **Tariff = real price**: since Meta exposes no pricing via API, keep the editable tariff aligned
  with your contract so the estimate matches the invoice.
- **Exchange rate**: if the rate is marked **estimated**, it's a fallback — refresh to get the live
  quote before closing a budget.

## Troubleshooting

- **Cost shows R$ 0 or is missing**: the campaign is on **WhatsApp Web** (no Meta billing) **or** the
  audience is very large and exceeded the estimate limit (above ~5,000 contacts), in which case the
  estimate is skipped so creation never hangs — the **actual cost** is still counted during sending.
- **Synced but the tariff didn't change**: there is an **admin override** for that country and
  category — the override wins over the synced rate. Clear the field and save to restore it.
- **The table won't sync**: the message says **why** — the source returned an error, could not be
  reached, or answered without readable rates. In every case the platform keeps the editable/base
  table as the source of truth. If it persists, point `WHATSAPP_PRICING_SOURCE_URL` at your own
  JSON/CSV endpoint or set the tariff manually.
- **Rate marked "estimated"**: the live quote wasn't available; use **Refresh** or enter a **manual**
  rate.

## See also

- [WhatsApp campaign for contact lists](/hc/ajuda/articles/campaigns-whatsapp-campaign-en)
- [HSM templates and variables](/hc/ajuda/articles/campaigns-templates-hsm-variaveis-en)
- [Campaigns overview](/hc/ajuda/articles/campaigns-overview-en)