Updated on November 24, 2026
To connect Tiny ERP (now Olist ERP) to WhatsApp through the official API, you register a webhook in Tiny, fetch the up-to-date order from API v3 when the notification arrives, and send a Meta-approved utility template to the customer’s mobile number. Each order status change becomes a message, and the tracking link goes in a dynamic URL button.
Some Brazilian context first: Tiny is one of the most widely used ERPs among Brazilian online stores, now part of Olist. Every shipped order in Brazil carries an electronic invoice (NF-e, nota fiscal eletrônica) authorized by the state tax authority (SEFAZ), and many parcels travel with Correios, the national postal service, which uses 13-character tracking codes such as BR123456789BR.
Tiny, Olist ERP and the two APIs
Tiny is now called Olist ERP, and the developer documentation lives at api-docs.erp.olist.com (in Portuguese). There are two APIs:
| API v2 | API v3 | |
|---|---|---|
| Base URL | https://api.tiny.com.br/api2/ | https://api.tiny.com.br/public-api/v3 |
| Authentication | token parameter generated in the account | OAuth 2.0 with Authorization: Bearer |
| Status | “no longer receives updates or new features” | recommended version |
For a new project, use v3.
API v3 OAuth flow
The flow is described in Authentication and authorization:
- Create an app in the ERP (Settings, General tab, Apps) with your redirect URL, granting only the modules the integration needs.
- Send the user to
https://accounts.tiny.com.br/realms/tiny/protocol/openid-connect/authwithclient_id,redirect_uri,scope=openidandresponse_type=code. - Exchange the
codefor tokens athttps://accounts.tiny.com.br/realms/tiny/protocol/openid-connect/token. - Send
Authorization: Bearer {access_token}on every call.
The access token expires after 4 hours and the refresh token after 1 day: refresh at least daily, or the user will have to authorize the app again.
Rate limits
In v3 the limit is per minute and per account (apps on the same account share the quota), from 30 to 140 reads per minute depending on the plan, according to the Olist help center. The X-RateLimit-Remaining and X-RateLimit-Reset headers tell you what’s left (rate limits). One lookup per event fits easily; a polling loop does not.
The order fields that matter
Get order is GET /pedidos/{idPedido}. These fields build the message (field names are in Portuguese):
| Field | Use in WhatsApp |
|---|---|
situacao | Picks which template to send |
numeroPedido and ecommerce.numeroPedidoEcommerce | Order number the customer recognizes |
cliente.nome, cliente.celular, cliente.telefone | Greeting and recipient |
transportador.formaEnvio.nome | “Shipped via Correios PAC” |
transportador.codigoRastreamento | Tracking code in the message body |
transportador.urlRastreamento | Target of the tracking button |
notaFiscal.id | Used to fetch the invoice link |
situacao (status) is a number: 0 Open, 1 Invoiced, 2 Cancelled, 3 Approved, 4 Preparing shipment, 5 Shipped, 6 Delivered, 7 Ready to ship, 8 Incomplete data, 9 Not delivered, 10 Being returned.
For the invoice (NF-e), GET /notas/{idNota}/link returns a link field (Get invoice link). If the order has no mobile number, GET /contatos/{idContato} returns telefone and celular from the contact record.
Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →
From Tiny event to WhatsApp message
| Status in Tiny | Template | Button |
|---|---|---|
| 3 Approved | pedido_aprovado | none |
| 1 Invoiced (NF-e issued) | pedido_faturado | dynamic URL to the invoice |
| 5 Shipped, with tracking code | pedido_enviado | dynamic URL to tracking |
| 6 Delivered | pedido_entregue | none (or quick reply) |
Many stores send only “shipped” and “delivered”. Cancellations and returns call for a human, not an automated template. For the full delivery journey, see the guide to WhatsApp delivery notifications.
Tiny webhooks
API v3 webhooks. According to the Webhooks page, you install the “Webhooks” app from the ERP app store (available only on some plans), go to Settings, General tab, Other settings, Webhooks, and fill in the URL for each notification. The events are: sales (order created or updated), shipped orders, stock movements and authorized invoices. Your endpoint must return HTTP 200; if it doesn’t, Olist retries up to 10 times, with a delay that grows by 5 minutes on each attempt.
API v2 webhooks. The POST https://api.tiny.com.br/api2/webhooks.php service (Tiny ERP webhooks) registers the URL via API with token, acao=incluir, evento and url. Useful events: atualizacao_situacao_pedido (order status update), envio_codigo_rastreio (tracking code) and envio_nota_fiscal (invoice); the URL must be public HTTPS.
Rules for both:
- Return 200 fast. Store the event in a queue and process it later; sending WhatsApp inside the request leads to retries.
- Treat the webhook as a trigger, not a data source. The payload examples in the v2 docs carry
pedidos[].id(status) andrastreamentos[].id_origem(tracking). Take the ID, fetch the order from v3 and decide based on current data. Log the raw payload of the first notifications and check the format your account actually sends.
Ready-to-use utility templates
Order updates are utility messages: Meta’s utility templates documentation lists order confirmations and updates, and warns that promotional content gets the template recategorized as marketing. Since the store’s customers are in Brazil, submit the templates in Portuguese (pt_BR); here is what each one says, with a suggested Portuguese text:
pedido_aprovado (order approved): “Hi {{1}}! Payment for order {{2}} was approved and we’re already picking your items. We’ll let you know here when it ships.” In Portuguese: Olá, {{1}}! O pagamento do pedido {{2}} foi aprovado e já estamos separando seus produtos. Avisaremos por aqui quando ele for enviado.
pedido_faturado (order invoiced): “{{1}}, the invoice for order {{2}} has been issued. Tap the button to view it.” In Portuguese: {{1}}, a nota fiscal do pedido {{2}} foi emitida. Toque no botão para ver o documento. Button “Ver nota fiscal”: https://yourstore.com.br/nf/{{1}}
pedido_enviado (order shipped): “{{1}}, your order {{2}} was shipped via {{3}}. Tracking code: {{4}}.” In Portuguese: {{1}}, seu pedido {{2}} foi enviado por {{3}}. Código de rastreio: {{4}}. Button “Rastrear pedido”: https://yourstore.com.br/r/{{1}}
pedido_entregue (order delivered): “{{1}}, order {{2}} shows as delivered. If anything didn’t arrive as expected, just reply to this message.” In Portuguese: {{1}}, o pedido {{2}} consta como entregue. Se algo não chegou como esperado, responda esta mensagem.
A URL button takes a single variable, at the end of the URL, and each template can have at most two URL buttons (template components). That’s why the base is your own domain: /r/{token} redirects to the order’s urlRastreamento, and /nf/{token} resolves the invoice link. Use a signed token, not the raw ID, so nobody can view someone else’s order by editing the URL. More on the variable suffix in templates with a dynamic URL button; the full send JSON is in how to send a WhatsApp template via API.
Node.js example: from Tiny webhook to WhatsApp
The server receives the webhook, returns 200, fetches the order and sends the template through Vectalk (on the Cloud API directly, use Meta’s URL with your PHONE_NUMBER_ID).
import express from "express";
import crypto from "node:crypto";
const TINY = "https://api.tiny.com.br/public-api/v3";
const sent = new Set(); // in production: a table with a unique key
// refresh with the refresh token before 4 h
const accessToken = async () => process.env.TINY_ACCESS_TOKEN;
const sign = (id) =>
id + "." + crypto.createHmac("sha256", process.env.LINK_SECRET).update(String(id)).digest("hex").slice(0, 16);
async function tiny(path) {
const r = await fetch(TINY + path, { headers: { Authorization: `Bearer ${await accessToken()}` } });
if (r.status === 429) throw new Error("Tiny rate limit; retry later");
if (!r.ok) throw new Error(`Tiny ${path}: ${r.status}`);
return r.json();
}
function mobile(c) {
let d = String(c?.celular || c?.telefone || "").replace(/\D/g, "");
if (d.length === 11) d = "55" + d;
return d.length === 13 ? d : null; // Brazilian mobile with area code only
}
const TEMPLATES = { 3: "pedido_aprovado", 1: "pedido_faturado", 5: "pedido_enviado", 6: "pedido_entregue" };
async function handle(orderId) {
const p = await tiny(`/pedidos/${orderId}`);
const template = TEMPLATES[p.situacao];
if (!template) return;
const key = `${p.id}:${p.situacao}`;
if (sent.has(key)) return; // idempotency
const to = mobile(p.cliente);
if (!to) return;
const name = (p.cliente.nome || "").split(" ")[0] || "cliente";
const number = String(p.ecommerce?.numeroPedidoEcommerce || p.numeroPedido);
let body = [name, number];
let button = null;
if (p.situacao === 1) {
if (!p.notaFiscal?.id) return;
button = sign(p.notaFiscal.id);
}
if (p.situacao === 5) {
const t = p.transportador || {};
if (!t.codigoRastreamento) return; // wait for the tracking event
body = [name, number, t.formaEnvio?.nome || "transportadora", t.codigoRastreamento];
button = sign(p.id);
}
const components = [{ type: "body", parameters: body.map((text) => ({ type: "text", text })) }];
if (button) components.push({ type: "button", sub_type: "url", index: "0", parameters: [{ type: "text", text: button }] });
const r = await fetch("https://apis.vectalk.com.br/api/messages", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.VECTALK_TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify({
messaging_product: "whatsapp",
to,
type: "template",
template: { name: template, language: { code: "pt_BR" }, components },
}),
}).then((res) => res.json());
if (r.messages?.[0]?.id) sent.add(key);
}
const app = express();
app.use(express.json());
app.post("/webhooks/tiny", (req, res) => {
res.sendStatus(200); // acknowledge right away; Tiny retries without a 200
const b = req.body || {};
const ids = [
...(b.pedidos || []).map((x) => x.id),
...(b.rastreamentos || []).filter((x) => x.tipo_origem === "pedido").map((x) => x.id_origem),
];
for (const id of new Set(ids.filter(Boolean))) handle(id).catch((e) => console.error(id, e.message));
});
app.listen(3000);
Production notes:
- A real queue. In production, store the event (Redis, SQS, a table) and process it in a worker with retries.
- Idempotency. An order + status key with a unique index in the database prevents duplicate messages when Tiny retries or when both the status and tracking events arrive for the same shipment.
- Tracking.
pedido_enviadoonly goes out oncecodigoRastreamentois filled in; if the code arrives later, the tracking event triggers the send.
Without code, the same flow fits in n8n.
Cost per order
Each utility template delivered to a Brazilian number costs BRL 0.0350 (Brazilian reais) on Meta’s rate card in effect since October 1, 2026. Since that date, utility messages are charged even inside the customer service window, and each number’s free allowance of 1,000 service messages per month does not cover utility. With three updates per order, 2,000 orders a month means up to 6,000 templates, or BRL 210.00 in Meta fees if all are delivered. If a template gets recategorized as marketing, the rate rises to BRL 0.3217. Run your numbers in the WhatsApp API pricing calculator and check the rules on Meta’s pricing page.
Does Tiny send WhatsApp messages on its own?
In the official Olist pages we checked, we found no native feature for sending updates to end customers through the official WhatsApp API; the connection is made by your own code or an orchestrator. For the bigger picture, see integrating the WhatsApp API with an ERP and WhatsApp API for e-commerce.
How to do it with Vectalk
Vectalk is a proxy for Meta’s official Cloud API: your server calls POST https://apis.vectalk.com.br/api/messages with the same template JSON as Meta (send template docs) and receives the same webhooks. Templates are created in the dashboard (which includes a Template Library) or via API, and the logs show every send. Billing is prepaid: each delivered message is deducted from your balance, with no card registered at Meta.
Vectalk has no native inbox, bulk messaging or AI: the Tiny-to-WhatsApp logic runs on your server or in n8n, and customer replies arrive at the webhook you configure. For the fundamentals, read the official WhatsApp API guide; sign up at apps.vectalk.com.br/register. Similar stores and ERPs: Conta Azul + WhatsApp and Loja Integrada + WhatsApp.
Frequently asked questions
I use Tiny API v2 with a token. Do I need to migrate?
Not right away: v2 is still documented, but it no longer gets updates or new features. New integrations should start on v3 with OAuth.
Do marketplace orders trigger messages too?
The webhook fires for any order in Tiny, wherever it came from. Before enabling it for marketplace orders, check each marketplace’s rules on contacting buyers outside the platform; when in doubt, send only for orders from your own store.
Do I need consent to send order updates?
Record at checkout that the customer agrees to receive order updates on WhatsApp. A phone number is personal data under Brazil’s data protection law (LGPD), and the most common legal basis for order notifications is performance of a contract (art. 7, V, of Law 13,709/2018). This is not legal advice; consult a lawyer.
Official sources checked on November 24, 2026: Olist ERP API v2, Authentication (v3), Rate limits (v3), API v3 apps, Get order, Get invoice link, Webhooks (v3), Tiny webhooks (v2), Utility templates (Meta), Template components (Meta), Pricing (Meta), 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.
