← Blog

·

Mercado Pago + WhatsApp API: payment notifications and reminders

Updated on November 24, 2026

To notify customers on WhatsApp when a payment changes in Mercado Pago, turn on Webhooks notifications for your application on the payment topic, validate the x-signature header, look up the payment with GET /v1/payments/{id} and, depending on its status, send a utility template through the official WhatsApp Business API: Pix approved, boleto issued, payment declined. The notification only carries the payment ID; status and details come from the lookup. The customer’s phone and consent come from your own records, linked through external_reference.

Quick context for readers outside Brazil: Pix is Brazil’s instant payment system (paid with a QR code or a “copy and paste” code), and a boleto is a bank payment slip paid by a due date. To build checkout inside the chat, see the WhatsApp payment link guide; here the focus is automatic notifications.

Which message to send for each event

The payment webhook fires when a payment is created or its state changes. The lookup returns status and status_detail, listed in Mercado Pago’s results documentation. The practical map:

Situationstatus / status_detailWhatsApp message
Pix created, awaiting paymentpending / pending_waiting_transferPix code and deadline (see the Pix section)
Boleto issuedpending / pending_waiting_paymentBoleto link and due date
Payment approvedapproved / accreditedOrder confirmation
Under reviewin_processNotice that the payment is being reviewed
Declinedrejected / cc_rejected_*, bank_error etc.Notice with an option to try another method
Cancelled or expiredcancelled / expired, by_payer, by_collectorCancellation notice (optional)
RefundedrefundedRefund confirmation
Disputecharged_back, in_mediationInternal alert; handle with your team before contacting the customer

A few details from the Pix documentation and other payment methods:

  • For Pix, the copy-and-paste code is in point_of_interaction.transaction_data.qr_code, the image in qr_code_base64 and a payment page in ticket_url. The default expiration is 24 hours, adjustable with date_of_expiration from 30 minutes to 30 days.
  • For boletos (payment_method_id bolbradesco), the link is in transaction_details.external_resource_url. The default due date is 3 days, adjustable from 1 to 30.
  • A payment left pending for 30 days is cancelled with status_detail expired.

Set up webhooks in Mercado Pago

Per the Webhooks page:

  1. In Your integrations, open the application and go to Webhooks > Configure notifications.
  2. Fill in the test mode URL and the production mode URL. The test URL receives events from test credentials.
  3. Select the topics. For payment notifications, payment. For subscriptions, subscription_authorized_payment (recurring payment) and subscription_preapproval (subscription link).
  4. Save and copy the generated secret signature. You’ll use it to validate the origin.

A notification_url sent when creating the payment takes priority over the one in the dashboard, and dashboard setup doesn’t apply to QR Code or Subscriptions. Avoid IPN notifications: they are slated for deprecation and don’t allow origin validation.

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

What arrives and how to validate it

A sample notification, in the documented format:

{
  "action": "payment.updated",
  "api_version": "v1",
  "data": { "id": "123456789" },
  "date_created": "2026-11-24T10:04:58.396-03:00",
  "id": 12345,
  "live_mode": true,
  "type": "payment",
  "user_id": 44444
}

The request carries an x-signature header in the format ts=1764000000,v1=<hash> and an x-request-id header. Validation, as Mercado Pago’s official SDKs do it, is a hex HMAC SHA-256 using the secret signature over this text:

id:<data.id from the query string>;request-id:<x-request-id>;ts:<ts>;

Compare the result with v1, or use the official SDK’s validator; the code below follows the logic of the Node.js SDK.

Timing matters too: Mercado Pago expects HTTP 200 or 201 within 22 seconds. Without it, it retries every 15 minutes; after the third attempt the interval grows, but deliveries keep coming. So respond immediately, process in the background and be ready to receive the same notification more than once.

Policy and template category

The WhatsApp Business Messaging Policy lists debt collection among prohibited activities, next to payday loans and paycheck advances. That doesn’t prevent you from updating customers about payment for their own purchase or subscription: Meta’s template categorization page treats non-promotional messages tied to the user’s order, account or transaction as utility, and gives a monthly payment reminder for a service as an example. What pushes a template into marketing is mixing in a promotion (“pay today and get 10% off”).

In practice, for customers in Brazil (rates in Brazilian reais):

MessageExpected categoryPrice per delivered message (since October 1, 2026)
Payment approved, boleto issued, payment declinedUtilityR$ 0.0350
Same notice with a coupon or offerMarketingR$ 0.3217
Free-form text with the 24-hour window openService1,000 free per month per number; then R$ 0.0350

Since October 1, 2026, utility templates are charged even inside the customer service window, and the service allowance doesn’t cover utility. Meta sets the category during review. The full reminder schedule, with timing and wording, is in WhatsApp billing reminders.

Three sample templates:

  • payment_approved: “Hi {{1}}! We received payment for order {{2}} for R$ {{3}}. We’re getting everything ready.”
  • boleto_issued: “Hi {{1}}! The boleto for order {{2}} is due on {{3}}. Tap the button to view and pay.” (dynamic URL button with the boleto link)
  • payment_declined: “Hi {{1}}. Payment for order {{2}} wasn’t approved. You can try again with another method using the button below.”

The dynamic URL button is covered in template with a dynamic URL button.

What about Pix copy and paste?

The Pix copy-and-paste code is longer than 100 characters. The template copy code button (COPY_CODE) accepts at most 20, per the template components page. It won’t work for Pix. Options that do:

  • Window open: send the code in a plain text message on its own, so it’s easy to copy.
  • Window closed: use the payment features of the Payments API for Brazil, such as the order_details message with pix_dynamic_code or the order details template, which carry the code generated by your payment provider. Step by step in Pix payments in the WhatsApp API.
  • Simple alternative: a template with a URL button pointing to Mercado Pago’s ticket_url, where the customer sees the QR and the code.

WhatsApp doesn’t reconcile payments: Mercado Pago confirms the payment.

Node.js code: from webhook to template

The example validates the signature, looks up the payment, avoids repeated notices and picks the template by status. Sending goes to Vectalk, which forwards it to the Cloud API with the same body Meta expects.

import express from "express";
import crypto from "node:crypto";

const app = express();
app.use(express.json());

const MP_TOKEN = process.env.MP_ACCESS_TOKEN;
const MP_SECRET = process.env.MP_WEBHOOK_SECRET;
const VECTALK_TOKEN = process.env.VECTALK_TOKEN;
const notified = new Set(); // in production, a table with a unique (payment_id, status)

function validSignature(req) {
  const parts = Object.fromEntries(
    (req.get("x-signature") || "").split(",").map((p) => p.trim().split("="))
  );
  const dataId = req.query["data.id"];
  const requestId = req.get("x-request-id");
  if (!parts.ts || !parts.v1) return false;
  let manifest = "";
  if (dataId) manifest += `id:${dataId};`;
  if (requestId) manifest += `request-id:${requestId};`;
  manifest += `ts:${parts.ts};`;
  const expected = crypto.createHmac("sha256", MP_SECRET).update(manifest).digest("hex");
  return expected.length === parts.v1.length &&
    crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

app.post("/webhooks/mercadopago", (req, res) => {
  if (!validSignature(req)) return res.sendStatus(401);
  res.sendStatus(200);
  if (req.body?.type === "payment") handle(req.body.data.id).catch(console.error);
});

async function handle(paymentId) {
  const pay = await fetch(`https://api.mercadopago.com/v1/payments/${paymentId}`, {
    headers: { Authorization: `Bearer ${MP_TOKEN}` },
  }).then((r) => r.json());

  const key = `${pay.id}:${pay.status}`;
  if (notified.has(key)) return;
  notified.add(key);

  const order = await findOrder(pay.external_reference); // your database: phone, name, opt-in
  if (!order?.whatsappOptIn) return;

  const amount = pay.transaction_amount.toFixed(2).replace(".", ",");
  const templates = {
    approved: ["payment_approved", [order.name, order.id, amount]],
    rejected: ["payment_declined", [order.name, order.id]],
  };
  if (pay.status === "pending" && pay.payment_method_id === "bolbradesco") {
    const due = new Date(pay.date_of_expiration).toLocaleDateString("pt-BR");
    return sendTemplate(order.phone, "boleto_issued", [order.name, order.id, due],
      pay.transaction_details.external_resource_url);
  }
  const t = templates[pay.status];
  if (t) await sendTemplate(order.phone, t[0], t[1]);
}

async function sendTemplate(phone, name, texts, buttonUrl) {
  const components = [{ type: "body", parameters: texts.map((t) => ({ type: "text", text: String(t) })) }];
  if (buttonUrl) {
    // dynamic URL button: the template URL ends in {{1}} and only the suffix goes here
    components.push({ type: "button", sub_type: "url", index: "0",
      parameters: [{ type: "text", text: buttonUrl.split("/").pop() }] });
  }
  const r = await fetch("https://apis.vectalk.com.br/api/messages", {
    method: "POST",
    headers: { Authorization: `Bearer ${VECTALK_TOKEN}`, "Content-Type": "application/json" },
    body: JSON.stringify({
      messaging_product: "whatsapp",
      to: phone,
      type: "template",
      template: { name, language: { code: "pt_BR" }, components },
    }),
  });
  console.log(name, r.status, await r.text());
}

app.listen(3000);

The id:status key prevents notifying the same state twice; findOrder is your database, with phone and opt-in. The dynamic URL button only takes the suffix of the URL registered in the template: check the boleto link format in the test environment. The language code stays pt_BR because the customers in this example are in Brazil; use the language your template was approved in.

No code: Zapier and n8n

ToolWhat existsNote
Zapier“Notifications for Mercado Pago” app, with triggers such as “New Accredited Payment”Triggers only; the page doesn’t say who publishes the app (app page)
n8n“MercadoPago” node, maintained by a partner and verified by n8nActions only (payment link, reports), no payment trigger (node page); use the Webhook node to receive events

We didn’t find, in Mercado Pago’s developer documentation, a native integration that sends payment notifications through the official WhatsApp API. The path is Mercado Pago’s webhook plus the WhatsApp API, directly or through one of these tools. The same design works for other gateways, such as Pagar.me with WhatsApp and Asaas with WhatsApp.

How to do it with Vectalk

Vectalk is a proxy for the official WhatsApp API: templates are created and approved in the dashboard’s Template Library or via the API, and sending goes to POST https://apis.vectalk.com.br/api/messages with the same JSON Meta uses (send template). Status webhooks (delivered, read, failed) follow Meta’s documentation and tell you whether the payment notice arrived.

Each delivered message is deducted from your prepaid Vectalk balance, with no card registered at Meta. Vectalk has no inbox, CRM or bulk sending in its dashboard: the Mercado Pago webhook logic runs in your system or in a tool connected to the API. To get started, create your account.

Frequently asked questions

Does Mercado Pago notify customers on WhatsApp by itself?

We didn’t find that in the developer documentation. Mercado Pago notifies your system through the webhook, and your system sends the message through the WhatsApp API.

Which status means the Pix was paid?

status approved with status_detail accredited. Until the customer pays, the Pix stays pending with pending_waiting_transfer.

Can I put the Pix copy-and-paste code in a copy code button?

No. The COPY_CODE button accepts up to 20 characters, and the Pix code is much longer. Send the code as text while the window is open, or use the Pix features of the Payments API for Brazil.

Is a payment notice utility or marketing?

A notice about payment for the customer’s own purchase or subscription, with no promotion, fits Meta’s definition of utility. Meta decides when it reviews the template.

Why did I get the same notification several times?

Mercado Pago retries when it doesn’t get a 200 or 201 within 22 seconds, and each status change on a payment triggers a new notification. Respond immediately and store the payment ID and status pair so you don’t notify twice.


Official sources checked on November 24, 2026: Mercado Pago: Webhooks, Mercado Pago: IPN, Mercado Pago: get payment, Mercado Pago: results and status, Mercado Pago: Pix integration, Mercado Pago: other payment methods, Mercado Pago: subscription webhooks, Mercado Pago Node.js SDK, WhatsApp Business Messaging Policy, Template categorization, Template components, Payments API Brazil, Pricing, 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.