← Blog

·

Conta Azul + WhatsApp: payment reminders and invoice notices via the official API

Updated on November 24, 2026

To connect Conta Azul to WhatsApp through the official API, your system authenticates against the Conta Azul API (OAuth 2.0), reads receivable installments and the payment requests attached to them (boleto, Pix or payment link), looks up the customer’s phone number and sends a utility template approved by Meta. Conta Azul has no webhooks yet, so the job runs on a schedule (polling). The notice can only be about the company’s own customer’s invoice: collecting third-party debt is prohibited.

Some Brazilian context for readers outside Brazil: Conta Azul is a cloud ERP widely used by small and mid-sized Brazilian companies. A boleto is a bank payment slip with a barcode, Pix is the Central Bank’s instant payment system, and NF-e and NFS-e are the mandatory electronic tax invoices for goods and services.

What you can automate

Conta Azul stores customers, receivables, payment requests and tax invoices. The table shows where each piece of data lives in the new API and which message it becomes:

MomentConta Azul dataWhatsApp message
Payment request createdInstallment with solicitacoes_cobrancas (type, url, status)“Your R$ X invoice is due on DD/MM”, with the boleto PDF or a button to the link
Day before the due dateInstallments filtered by data_vencimento_de and data_vencimento_ateReminder with a pay button
Payment receivedInstallment with status QUITADOPayment confirmation
Invoice issuedNF-e or NFS-e with status EMITIDA“Your invoice no. X has been issued”

To design the reminder schedule, see the guide to WhatsApp billing reminders. For the big picture of ERP plus WhatsApp, see WhatsApp API ERP integration.

What about Conta Azul’s own WhatsApp sending?

The Receba Fácil page says Conta Azul’s collection system sends due-date reminders by email, SMS and WhatsApp, with a boleto, Pix or card payment link. If that is enough, use the built-in feature. The API route makes sense when you want the message to come from your own number, with your own templates, tied into your customer service.

How the Conta Azul API works

The migration guide states that the legacy API has been discontinued. Old credentials do not work with the new one. Everything below refers to the new API, at https://api-v2.contaazul.com.

OAuth 2.0 authentication

The flow is Authorization Code (authentication guide):

  1. Create an application in the Developer Portal and note the client_id and client_secret.
  2. Send the company’s user to https://login.contaazul.com/#/oauth/authorize with response_type=code, client_id, redirect_uri, state and the fixed scope openid+profile+aws.cognito.signin.user.admin. The returned code is valid for 3 minutes.
  3. Exchange the code at POST https://api-v2.contaazul.com/oauth/token with Authorization: Basic base64(client_id:client_secret) and grant_type=authorization_code.
  4. Use Authorization: Bearer <access_token> on API calls.

The access_token expires in 1 hour. The refresh_token lasts up to 2 years but changes on every refresh: always store the new one, because the previous one stops working. Each connected company goes through the flow once and gets its own tokens.

Endpoints that matter for billing and invoices

ResourceEndpointUse
Receivable installmentsGET /v1/financeiro/eventos-financeiros/contas-a-receber/buscarList by due date (data_vencimento_de and data_vencimento_ate are required), with cliente.id, total, nao_pago and status_traduzido
Installment detailsGET /v1/financeiro/eventos-financeiros/parcelas/{id}Returns solicitacoes_cobrancas with id, tipo_solicitacao_cobranca, url and status
Boleto PDFGET /v1/financeiro/eventos-financeiros/contas-a-receber/cobranca/{id_cobranca}/imprimirPDF file; Pix and payment links have no file (error 422)
PersonGET /v1/pessoas/{id}telefone_celular and contato_cobranca_faturamento.whatsapp
ChangesGET /v1/financeiro/eventos-financeiros/alteracoesIDs of events changed within a period
NF-eGET /v1/notas-fiscaisProduct invoices with status EMITIDA or CORRIGIDA_SUCESSO
NFS-eGET /v1/notas-fiscais-servicoService invoices, window of up to 15 days per query

About invoices: GET /v1/notas-fiscais/{chave} returns the NF-e XML (or a ZIP if there is a correction letter), not a PDF. The documentation we reviewed has no route for the invoice PDF. That is why the invoice notice below is plain text with the number, without an attachment.

Rate limits and no webhooks

The API FAQ states:

  • Rate limit: 600 calls per minute and up to 10 per second, per connected ERP account. Beyond that you get HTTP 429.
  • Webhooks: not available yet. The official recommendation is recurring polling of the endpoints.
  • Testing: a Development App gives you a test account with fictitious data for 30 days.

In practice, two jobs cover it: a daily one for installments due tomorrow, and another every 15 or 30 minutes that queries /alteracoes to catch payments. That endpoint only returns the changed IDs, without saying what changed, so compare against the last state you stored.

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

Three ready-to-use utility templates

Outside the 24-hour window, the WhatsApp API only sends approved templates. A notice about the customer’s own invoice, with no offer, is utility; Meta reclassifies as marketing any template that mixes the notice with a promotion, as explained on the template categorization page. Meta decides the category during review. Since your recipients are in Brazil, submit the templates in Portuguese (pt_BR); the English text below shows the structure.

1. Payment request issued (document header): header in DOCUMENT format with the boleto PDF.

Hi {{1}}. Your {{2}} invoice for {{3}} has been issued and is due on {{4}}. The boleto is attached. If you have already paid, please disregard this message.

2. Day before the due date (dynamic URL button):

Hi {{1}}. Reminder: your {{2}} invoice for {{3}} is due tomorrow, {{4}}. Tap the button below to see your payment options.

“View invoice” button with URL https://pay.yourcompany.com/i/{{1}}. The template components documentation allows one variable per URL, always at the end, and up to two URL buttons per template. So use your own domain with a short code that redirects to the Conta Azul payment request url.

3. Tax invoice issued:

Hi {{1}}. Invoice no. {{2}}, for {{3}}, regarding {{4}}, was issued on {{5}}. Keep this message for your records.

More examples in payment reminder message templates. Variables, buttons and the send JSON are covered in how to send a WhatsApp template message via API.

Python example: day-before reminder

The script refreshes the token, lists installments due tomorrow, fetches the payment request and phone number, and sends template 2. It uses the Vectalk URL; on the Cloud API directly, swap in Meta’s URL with your PHONE_NUMBER_ID.

import base64, os, re, time, datetime as dt, requests

CA = "https://api-v2.contaazul.com"
VT = "https://apis.vectalk.com.br/api/messages"

def refresh_token(refresh):
    cred = base64.b64encode(f"{os.environ['CA_ID']}:{os.environ['CA_SECRET']}".encode()).decode()
    r = requests.post(f"{CA}/oauth/token", headers={"Authorization": f"Basic {cred}"},
                      data={"grant_type": "refresh_token", "refresh_token": refresh})
    r.raise_for_status()
    tok = r.json()
    save_refresh(tok["refresh_token"])  # store the new one: the old one stops working
    return tok["access_token"]

def ca_get(path, token, **params):
    time.sleep(0.15)  # stay under 10 calls per second
    r = requests.get(f"{CA}{path}", headers={"Authorization": f"Bearer {token}"}, params=params)
    r.raise_for_status()
    return r.json()

def phone(person):
    raw = (person.get("contato_cobranca_faturamento") or {}).get("whatsapp") or person.get("telefone_celular") or ""
    num = re.sub(r"\D", "", raw)
    return num if num.startswith("55") else "55" + num

def send(to, name, amount, ref, due, code):
    body = {
        "messaging_product": "whatsapp", "to": to, "type": "template",
        "template": {"name": "invoice_due_tomorrow", "language": {"code": "pt_BR"}, "components": [
            {"type": "body", "parameters": [{"type": "text", "text": t} for t in (name, amount, ref, due)]},
            {"type": "button", "sub_type": "url", "index": "0", "parameters": [{"type": "text", "text": code}]},
        ]},
    }
    r = requests.post(VT, json=body, headers={"Authorization": f"Bearer {os.environ['VECTALK_TOKEN']}"})
    return r.json()

def run():
    token = refresh_token(load_refresh())
    tomorrow = (dt.date.today() + dt.timedelta(days=1)).isoformat()
    page = 1
    while True:
        res = ca_get("/v1/financeiro/eventos-financeiros/contas-a-receber/buscar", token,
                     pagina=page, tamanho_pagina=50, data_vencimento_de=tomorrow, data_vencimento_ate=tomorrow)
        for p in res.get("itens", []):
            if p["status_traduzido"] not in ("EM_ABERTO", "RECEBIDO_PARCIAL") or already_sent(p["id"], "day_before"):
                continue
            det = ca_get(f"/v1/financeiro/eventos-financeiros/parcelas/{p['id']}", token)
            reqs = [c for c in det.get("solicitacoes_cobrancas") or [] if c.get("url")]
            if not reqs:
                continue  # installment without a payment request
            person = ca_get(f"/v1/pessoas/{p['cliente']['id']}", token)
            to = phone(person)
            if len(to) < 12:
                continue  # customer without a mobile number
            amount = f"R$ {p['nao_pago']:,.2f}".replace(",", "X").replace(".", ",").replace("X", ".")
            due = dt.date.fromisoformat(p["data_vencimento"]).strftime("%d/%m/%Y")
            out = send(to, person["nome"], amount, p["descricao"], due, shorten(reqs[-1]["url"]))
            mark_sent(p["id"], "day_before", out.get("messages", [{}])[0].get("id"))
        if page * 50 >= res.get("itens_totais", 0):
            break
        page += 1

run()

The functions load_refresh, save_refresh, already_sent, mark_sent and shorten live in your database (token, deduplication and the button’s short code). For template 1, download the PDF from /imprimir, upload it to the media route and send its id in the header component with "type": "document" and a filename such as boleto-august.pdf. The PDF walkthrough is in how to send a PDF via the WhatsApp API.

Keep token refresh in a single process: if two jobs refresh at the same time, one invalidates the other. And when you get HTTP 429, wait before retrying.

How much it costs

Each utility template delivered to a Brazilian number costs R$ 0.0350 (Brazilian reais) on Meta’s rate card in effect since October 1, 2026. Since that date, utility is charged even inside the customer service window, and each number’s allowance of 1,000 free service messages per month does not cover utility. Example: 1,500 invoices a month with an issued notice, a day-before reminder and a confirmation add up to 4,500 templates, or R$ 157.50 in Meta fees if all are delivered. Run your numbers in the WhatsApp API pricing calculator and check the rules on Meta’s pricing page.

Policy and LGPD considerations

  • Only the customer’s own invoices. The WhatsApp Business Messaging Policy prohibits third-party debt collection. A collection agency working for another company does not qualify.
  • Informative tone. Threats lead to blocks, which hurt the number’s quality rating.
  • Consent. Record that the customer agreed to receive notices on WhatsApp (contract, sign-up form or checkout).
  • LGPD. Brazil’s data protection law, Law 13,709/2018, treats phone numbers and financial data as personal data. The most common legal basis for notices about the customer’s own invoice is performance of a contract (art. 7, V). Store the Conta Azul tokens as secrets: they grant administrator access. This is not legal advice; consult a lawyer.

How to do it with Vectalk

Vectalk is a proxy for Meta’s official Cloud API: your system calls https://apis.vectalk.com.br/api/messages with Meta’s same template JSON (template reference) and receives the same webhooks. Templates are created in the dashboard (which includes a Template Library) or via the API, and the logs show every send. Billing works on prepaid credit: each delivered message is deducted from the balance and you never register a card with Meta.

Vectalk has no built-in inbox, bulk sending or AI: the polling job runs in your system or in an orchestrator, and replies arrive at the webhook you configure. For the fundamentals, read the official WhatsApp API guide. Sign up at apps.vectalk.com.br/register.

Other ERPs: Omie and Tiny.

Frequently asked questions

Does Conta Azul have a webhook for when a boleto is paid?

No. The official FAQ says webhooks are not available yet and recommends polling. Query /alteracoes at short intervals and, for each ID, read the installment and check whether the status has changed to QUITADO.

Is a payment reminder utility or marketing?

Utility, as long as it only covers the customer’s invoice and has no offer. Add a promotion and Meta reclassifies it as marketing (R$ 0.3217 per message in Brazil).

Can I send the tax invoice PDF?

According to the documentation we reviewed, the API returns the NF-e XML, not the PDF. If your system generates the DANFE (the printable version of the NF-e) or stores the PDF, you can send it in a template with a document header. Otherwise, send a text notice.


Official sources consulted on November 24, 2026: Conta Azul API authentication, Renewing the access token, Legacy API migration guide, Conta Azul API FAQ, Financial API, Payment requests API, People API, Invoices API, Receba Fácil (Conta Azul), Template categorization (Meta), Template components (Meta), WhatsApp platform pricing (Meta), WhatsApp Business Messaging Policy, Vectalk: send template.

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.