Cost attribution per tenant on the WhatsApp API

Attribute WhatsApp message costs to customers: capture pricing from status webhooks, store categories, reconcile with invoices and handle tier changes.

When a platform resells WhatsApp capability, the Meta bill is one number and the customers are many. Finance wants to know what each customer cost, product wants to price plans sensibly and support wants to explain a surprise. None of that is possible if cost data is reconstructed after the fact from message counts. This article describes how to capture pricing facts at the time of each message, attribute them per tenant and reconcile against invoices.

How does Meta bill WhatsApp messages?

Meta bills per delivered message, with the rate depending on the message category and the recipient's country calling code. Messages sent but not delivered are not charged, and messages from users to the business are free.

Meta's pricing documentation describes template categories (marketing, utility, authentication) and non-template categories for replies in the 24-hour customer service window. Some messages are free by rule; for example, Meta documents a free allowance of the first 1,000 service messages per business phone number each month from October 1, 2026, and a free entry point window of up to 7 days after a Click to WhatsApp ad response. Rates change, so this article gives no prices; current figures are on Meta's rate card and summarised on the pricing page. Meta also states that volume tiers for utility and authentication messages are calculated at the business portfolio level, which matters for attribution when several tenants share a portfolio.

What should be captured per message?

Capture the pricing object from each status webhook and store it beside the message id. It is the only per-message record of whether a message was billable and under which category, and it arrives at the moment the fact is known. The webhooks reference explains how to receive and deduplicate those status events.

Meta documents that status webhooks include a pricing object: billable messages show a type of regular, and free service messages show free_customer_service. The category and the billable flag are what you attribute. Store the raw pricing object as received, plus your normalised fields, so a later change in Meta's format does not lose history.

CREATE TABLE message_cost ( tenant_id uuid NOT NULL, channel_id text NOT NULL, message_id text NOT NULL, recipient_cc text, -- country calling code of the recipient category text, -- marketing | utility | authentication | service | ... billable boolean, pricing_type text, -- regular | free_customer_service | ... campaign_id uuid, -- your own dimension occurred_at timestamptz NOT NULL, raw_pricing jsonb, PRIMARY KEY (tenant_id, message_id) ); -- monthly roll-up per tenant, category and market SELECT tenant_id, date_trunc('month', occurred_at) AS month, category, recipient_cc, count(*) FILTER (WHERE billable) AS billable_messages FROM message_cost GROUP BY 1,2,3,4;

Notice that the roll-up counts messages, not money. Counting units by category and market is exact and stable; converting to money is a separate step that applies the current rate card. Keeping the two apart means a rate change does not require re-ingesting history, and you can show a customer both the units and the price used.

Which dimensions make the data useful?

Tenant is the minimum; channel, campaign, template and country make it actionable. Each additional dimension answers a question finance or the customer will eventually ask, and adding them later is far more expensive than capturing them up front.

DimensionQuestion it answers
TenantWhat did this customer cost this month?
ChannelWhich of their numbers drives cost?
CategoryIs cost mostly marketing, utility or authentication?
Recipient marketWhich countries are expensive?
Campaign or templateWhich send caused this spike?
Window versus templateHow much traffic is free replies versus paid templates?

Meta also exposes pricing_analytics, which provides per-message pricing breakdowns and intra-month tiering information for delivered messages, and notes that tiering information is not in webhooks. Use it to cross-check your own roll-ups and to read where a tenant sits in a volume tier.

How do you reconcile against the invoice?

Reconcile by comparing your monthly unit counts by category and market against Meta's invoice or analytics, and investigate differences by message sample. A small, explainable gap is normal; an unexplained one points to missed webhooks.

  • Count billable messages in your store per messaging account and market for the invoice period.
  • Compare with the invoice or the pricing analytics export for the same account and period, mind the time zone used for the period boundary.
  • For each mismatch, sample message ids on both sides and find which side lacks them.
  • Backfill from the provider's message history for any gap caused by webhook outages, using the recovery approach from the logging article.
  • Record the reconciliation result and its date for audit.

Billing is attributed per messaging account, and each account has its own billing relationship. If customers connect their own accounts and pay Meta directly, as Tech Provider customers do, your attribution is informational for the platform and the invoice belongs to the customer. If a partner extends a credit line, Meta's invoice lands on the partner and attribution becomes how the partner charges its customers. Know which model your arrangement is before designing the pricing page.

Which edge cases distort attribution?

Four cases distort attribution if ignored: free service messages, replays that look like duplicates, messages whose status never arrives and tenants that share a portfolio. Each has a simple rule.

  • Free service messages still count as traffic; keep them in the roll-up with billable set to false so the free share is visible.
  • Deduplicate status events by message id before counting, since webhook delivery is at least once.
  • For messages with no delivered status after a long interval, record them as unresolved instead of guessing, then fill from history during reconciliation.
  • When tenants share a portfolio, record the portfolio on the channel so tier effects can be explained, and agree the allocation rule before the first invoice.

How do you turn attribution into plans and alerts?

Use the data to set plan limits in units rather than money, to warn tenants as they approach a threshold and to show them what is driving their usage. Surprises are what turn into disputes.

Expose each tenant's own usage in your dashboard, split by category. A warning at a chosen fraction of the expected monthly units, sent to the tenant before the end of the month, is cheaper than an invoice conversation afterwards. For your own platform quotas, a provider may offer a usage endpoint; the Hub's usage call returns current quota usage and plan information under the billing:read scope, which is separate from Meta message costs. Keep the two concepts apart in your product: platform quota usage and WhatsApp message charges are different line items.

Finally, treat the rate card as configuration with an effective date. Meta changes rates on a schedule, and a roll-up that multiplies old units by the new price rewrites history. Store the price version used for every statement.

Frequently asked questions

Are undelivered messages billed?

Meta's pricing documentation says businesses are charged only when a message is delivered. Your attribution should therefore key on delivered messages with a billable pricing type.

Where do I find the category of a billed message?

In the pricing object of the status webhook, and in Meta's pricing analytics for delivered messages. Store it at ingestion time rather than inferring it later.

Should I store prices or only message counts?

Store counts by category and market, plus the rate version applied when you compute money. Rates change, and counts remain valid history.

Fontes

Documentação oficial da Meta, conferida em 31 de outubro de 2026.