Skip to main content

What they are

Besides template events and the channel disconnection notice, the workspace global webhook can receive two groups of account events:
  • Billing: payment declined, payment recovered, subscription canceled, instance suspended and instance released for non-payment.
  • Meta account restriction (ACCOUNT_RESTRICTION): Meta restricted the WhatsApp Business account (WABA), recorded a violation or scheduled its deactivation.
These events do not depend on a channel. They arrive at the global webhook, the template webhook, with no instance.

How to subscribe

Add the events to events when you create or update the global webhook:
  • Global webhook only. Channel webhooks and the instance default webhook reject these events with 422.
  • DEFAULT format only. The global webhook is already DEFAULT.
  • Each event is independent. Subscribe only to the ones you use, with or without template events and CHANNEL_DISCONNECTED.
  • In the dashboard, subscribing to a billing event requires the See billing permission (Owner and Manager, see Team and roles).
  • A PATCH with events replaces the list. To keep receiving them, send the events that were already subscribed again.

Billing events

What your server receives

The body is the event:
  • instanceIds lists the instances covered by the invoice. One invoice can cover more than one.
  • invoiceRef identifies the invoice and is the same on failure and recovery. With two invoices failing in the same workspace, it tells which one was paid.
  • amount is decimal text ("99.90") and currency is the uppercase ISO 4217 code. On failure, amount is the amount due; on recovery, the amount paid. When the recovery comes from a subscription status change, and not from paying an invoice, amount and currency are null, and so is invoiceRef if there is no invoice.
  • attemptCount is the charge attempt number, and nextAttemptAt is the next automatic attempt, or null when there is none.
failureCode can be null. When a card is declined, the payment provider does not always report the reason. Do not rely on it to handle the failure.
The body never carries card data, payment provider ids, invoice link, email or name.

Meta account restriction (ACCOUNT_RESTRICTION)

Sent when Meta reports one of these situations on the WhatsApp Business account (WABA) of your channels: The restriction does not disconnect the channel and does not change its state in Omni Z-API. When Meta actually disconnects the account, the channel disconnection notice also arrives, one per channel.

What your server receives

The restriction_info, ban_info and violation_info blocks are passed on as Meta sends them, untranslated. The possible values, such as restriction_type and waba_ban_state, are in Meta’s documentation and may change. The event object may also carry other routing fields that are not part of the contract: ignore the ones not in this table.

One notice per workspace

  • One account, one notice. The restriction belongs to the account, so the workspace receives one notice with the instances list, not one notice per channel.
  • Per number. If Meta mentions different numbers (for example, call restrictions), one notice is sent per number, each with its own phone_number and notice_id.
  • Repetition. A Meta resend can produce a second notice with the same notice_id. The same situation reported again by Meta at another moment produces a different notice_id.

Order and repetition

Delivery is at least once and arrival order is not guaranteed (see Delivery and retries):
  • discard repetitions by id (billing) or by notice_id (restriction);
  • order by occurredAt (billing) or by moment (restriction), not by arrival time.