← Blog

·

Bling + WhatsApp: invoices and order status via the official API

Updated on November 10, 2026

To send Bling invoices and order status over the official WhatsApp API, you create an app on Bling’s API v3, turn on webhooks for the invoice (NF-e) and order (sales order) resources, validate the X-Bling-Signature-256 signature and, when an invoice is authorized or an order changes status, send a Meta-approved utility template. The DANFE PDF should go as a document attached to the template: Bling’s public DANFE link asks the customer for an access code. Each notice costs R$ 0.0350 per delivered message in Brazil.

Bling is a Brazilian ERP for small and mid-sized businesses. In Brazil, sales of goods are documented with an electronic invoice (NF-e) authorized by the tax authority, and the DANFE is its printable PDF version. This guide goes deep on Bling; the broader view of ERP + WhatsApp (invoices, orders and billing) is in WhatsApp API ERP integration.

What Bling already does on WhatsApp

According to Bling’s help center, the ERP already has WhatsApp shortcuts:

  • Invoice: once issued, the invoice can be sent by WhatsApp to the contact’s mobile number if the “Fone” field is filled in (invoice recipient). The DANFE can be sent “via WhatsApp Web or email” (DANFE).
  • Sales order: under Vendas > Pedidos de Venda, the three-dot menu lets you send by email or WhatsApp (send an order to a customer).
  • Bling Conta boleto: under Financeiro > Contas a receber, there’s “Enviar por Whatsapp” (boletos in Bling Conta).

These are triggered by a user, one at a time, from Bling’s screens (for the DANFE, via WhatsApp Web). On the official pages we checked, we found no automatic sending of invoices or statuses through the official WhatsApp API. To have every authorized invoice reach the customer on its own, from the company number and with an approved template, you integrate through Bling’s API v3. If you’re new to the WhatsApp API, read the official WhatsApp API guide.

Bling API v3: app, OAuth and limits

Access is through an OAuth 2.0 app (apps):

  1. In Central de Extensões > Área do Integrador, click Criar aplicativo and choose the app’s visibility. The user needs the “Cadastro de aplicativos” permission.
  2. Select the scopes for sales orders, invoices and contacts. A resource only shows up in the webhooks tab if the app has its scope.
  3. Authorize at https://bling.com.br/Api/v3/oauth/authorize and exchange the code at https://bling.com.br/Api/v3/oauth/token within 30 seconds, sending the app credentials as Basic auth.
  4. Renew with the refresh token, which expires in 30 days. Send the enable-jwt: 1 header to get JWT tokens, since opaque tokens were discontinued (JWT migration).

Calls go to https://api.bling.com.br/Api/v3. Limits are 3 requests per second and 120,000 per day per account, with HTTP 429 when exceeded (limits). One notice per invoice takes two or three lookups (invoice, contact, sometimes order), so a paced queue is mandatory on peak days (WhatsApp API integration architecture).

Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →

Webhooks: resources, events and signature

In the app’s Webhooks tab, you register the receiving servers and, for each resource, pick the server, the actions and the payload version (webhooks). Events only start after the app receives the user’s tokens.

ResourceActionsWhatsApp use
invoicecreated, updated, deletedNF-e authorized, canceled
consumer_invoicecreated, updated, deletedNFC-e (retail receipt)
ordercreated, updated, deletedOrder status change
product, stock, product_suppliercreated, updated, deletedUsually no message
virtual_stockupdated only (enabled together with stock)Usually no message

The event name is the resource and action joined by a dot (invoice.updated, order.updated). Setting a record’s status to “deleted” sends updated, not deleted. Every payload shares the same envelope:

{
  "eventId": "01HZX...",
  "date": "2026-11-10T14:32:10Z",
  "version": "v1",
  "event": "invoice.updated",
  "companyId": "abc123",
  "data": { "id": 12345678 }
}

The structure of data varies by resource, action and version, and the webhooks page details each one; the example above shows only the id. For WhatsApp, treat the id as the key and fetch the current invoice or order from the API before sending, because event order isn’t guaranteed.

Delivery rules that shape the service design:

  • Signature: the X-Bling-Signature-256 header carries sha256=<hex>, a hex HMAC-SHA256 of the JSON payload using the app’s client secret, in UTF-8.
  • Reply within 5 seconds: the receiver must return 2xx within 5 seconds.
  • Retries for 3 days: failures are retried for up to 3 days at growing intervals. After the last failure, the webhook for that resource is disabled until someone re-enables it manually.
  • Order and duplicates: order isn’t guaranteed and duplicates can happen. Bling recommends answering 2xx to duplicates and processing through a queue.

The disable rule is the most sensitive point: a server down over a long holiday weekend can switch off your invoice notices without anyone noticing. Monitor the webhooks tab or alert when no events arrive for a few business hours.

Invoices: from “Authorized” to a PDF on WhatsApp

When invoice.updated arrives, call GET /nfe/{idNotaFiscal}. Useful fields: numero, serie, chaveAcesso, situacao, valorNota, contato.telefone, linkDanfe and linkPDF. situacao is numeric:

CodeStatusAction
1Pendente (pending)Nothing
5Autorizada (authorized)Send the invoice
6Emitida DANFE (DANFE issued)Send the invoice (if not sent yet)
2Cancelada (canceled)Notify cancellation, if the invoice was already sent
4Rejeitada (rejected)Alert your internal team, not the customer

The others (awaiting receipt, registered, awaiting protocol, denied, status check, blocked) are intermediate or exception states.

Here’s the trap: Bling added a security layer to the DANFE. A DANFE link opened publicly in a browser asks for an access code, and Bling itself warns that customers will see the password screen if you pass the raw link along (DANFE viewing security).

The clean fix is to download the PDF with the authenticated call (GET /nfe/documento/{chaveAcesso}?formato=pdf, per the API changelog and reference; the response is JSON whose conteudo field holds the PDF gzip-compressed and base64-encoded), upload the file to the WhatsApp API and send a template with a document header:

import base64, gzip, os, re, httpx

BLING = "https://api.bling.com.br/Api/v3"
VECTALK = "https://apis.vectalk.com.br/api"
H_VECTALK = {"Authorization": f"Bearer {os.environ['VECTALK_TOKEN']}"}  # instance token

async def send_invoice(nfe_id: int, bling_token: str):
    hb = {"Authorization": f"Bearer {bling_token}", "enable-jwt": "1"}
    async with httpx.AsyncClient(timeout=30) as c:
        inv = (await c.get(f"{BLING}/nfe/{nfe_id}", headers=hb)).json()["data"]
        if inv["situacao"] not in (5, 6) or already_sent(nfe_id):
            return
        to = re.sub(r"\D", "", inv["contato"].get("telefone") or "")
        if len(to) in (10, 11):  # Brazilian area code + number
            to = "55" + to
        if not to:
            return

        doc = (await c.get(f"{BLING}/nfe/documento/{inv['chaveAcesso']}",
                           params={"formato": "pdf"}, headers=hb)).json()["data"][0]
        pdf = gzip.decompress(base64.b64decode(doc["conteudo"]))  # base64 + GZIP
        up = await c.post(f"{VECTALK}/media", headers=H_VECTALK,
                          files={"file": (f"NF-{inv['numero']}.pdf", pdf, "application/pdf")},
                          data={"type": "application/pdf", "messaging_product": "whatsapp"})
        media_id = up.json()["id"]

        await c.post(f"{VECTALK}/messages", headers=H_VECTALK, json={
            "messaging_product": "whatsapp",
            "to": to,
            "type": "template",
            "template": {
                "name": "nota_fiscal_emitida",
                "language": {"code": "pt_BR"},
                "components": [
                    {"type": "header", "parameters": [
                        {"type": "document", "document": {"id": media_id, "filename": f"NF-{inv['numero']}.pdf"}}]},
                    {"type": "body", "parameters": [
                        {"type": "text", "text": str(inv["numero"])},
                        {"type": "text", "text": f"R$ {inv['valorNota']:.2f}".replace(".", ",")}]},
                ],
            },
        })
        mark_sent(nfe_id)

The template text (in Portuguese for Brazilian customers) can read: “Invoice no. {{1}}, amount {{2}}, has been issued and is attached to this message.” It’s utility: non-promotional and tied to the customer’s transaction (template categorization). Document headers and media sending are covered in how to send images, PDFs, audio and video via the API.

The invoice phone may be empty. In that case, fetch the contact with GET /contatos/{idContato}, which has separate celular (mobile) and telefone (landline) fields, and prefer the mobile.

Order status and tracking

For orders, the order.updated webhook leads to GET /pedidos/vendas/{idPedidoVenda}. Useful fields: numero, numeroLoja (the number the customer saw on the online store), situacao.id, situacao.valor, total, notaFiscal.id and transporte.volumes[].codigoRastreamento. The order’s contact carries an id and name but no phone: fetch the mobile from /contatos/{id}.

Order statuses aren’t fixed: each account can have its own. List yours with GET /situacoes/modulos and GET /situacoes/modulos/{idModuloSistema} and map by ID. A typical mapping:

Status (example)MessageCategory
Em aberto (open)Order receivedUtility
Em andamento / Atendido (in progress / fulfilled)Order being picked or invoicedUtility
Tracking code filled inOrder shipped, with codeUtility
Cancelado (canceled)Order canceledUtility

Store the last notified status per order: order.updated fires for any change, not only status changes. And if the online store (Tray, Nuvemshop, Shopify) already sends status updates to the customer, let Bling send only the invoice to avoid duplicates. The Tray case is in Tray + official WhatsApp.

Cost and good practices

For recipients in Brazil, since October 1, 2026, each delivered utility template costs R$ 0.0350 (pricing). A thousand invoices sent over WhatsApp cost R$ 35.00. Utility sent inside the customer service window has also been charged since October 2026. Model it with the WhatsApp API pricing calculator.

Three cautions:

  • Opt-in: ask for consent to receive order updates on WhatsApp at checkout or sign-up.
  • Billing: a boleto reminder for your own customer is utility; third-party debt collection is prohibited by WhatsApp’s Business Messaging Policy. For billing flows from the ERP, see Omie + WhatsApp and Asaas + WhatsApp.
  • Personal data: invoices contain tax IDs (CPF/CNPJ), addresses and amounts. Sending them must comply with Brazil’s data protection law, the LGPD (Law 13,709/2018); this article is not a substitute for legal advice.

How to do it with Vectalk

Vectalk is a proxy for Meta’s official Cloud API. Your service receives the Bling webhook, uploads the PDF with POST https://apis.vectalk.com.br/api/media (media upload) and sends the template with POST https://apis.vectalk.com.br/api/messages (send template). Media and templates use the instance token. Delivery statuses arrive as webhooks in Meta’s format (webhooks).

Billing is prepaid and deducted per delivered message, with no card at Meta. With coexistence, the number can stay in the WhatsApp Business app. Vectalk isn’t an extension in Bling’s Central de Extensões and has no native inbox, AI or bulk sending: the bridge is your Bling app, in your own backend or a tool like n8n. Create your account at apps.vectalk.com.br/register.

Frequently asked questions

Can I send the DANFE link instead of the PDF?

You can, but the customer will hit the access-code screen Bling requires for public DANFE links. Downloading the PDF through the authenticated API and sending it as a document avoids that.

Which event tells me the invoice was authorized?

The invoice.updated webhook. It doesn’t say what changed: call GET /nfe/{id} and check whether situacao is 5 (authorized) or 6 (DANFE issued).

Why did my Bling webhooks stop?

If your endpoint failed for the whole retry period (up to 3 days), Bling disables that resource’s webhook. Re-enable it in the app’s Webhooks tab and reprocess the gap by querying invoices through the API.

Is Bling’s API v2 still an option?

This guide uses API v3, which is the version documented on Bling’s developer portal, with OAuth and webhooks. New integrations should start there.


Official sources consulted on November 10, 2026: Bling: API v3, Bling: apps and OAuth, Bling: JWT migration, Bling: limits, Bling: webhooks, Bling: API reference, Bling: changelog, Bling: DANFE viewing security, Bling: invoice recipient, Bling: send a sales order, Bling: boletos in Bling Conta, Meta: template categorization, Meta: pricing, WhatsApp Business Messaging Policy, Vectalk: media upload, Vectalk: send template, Vectalk: webhooks.

Put your business on the official WhatsApp

Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.