← Blog

·

VTEX + official WhatsApp API: orders, shipping and recovery

Updated on November 10, 2026

To send VTEX order notifications over the official WhatsApp API, you configure the Orders Hook (Feed v3) with POST /api/orders/hook/config, filter the statuses you care about (payment-approved, invoiced, canceled), receive each change on your endpoint and, for each one, fetch the order and send a Meta-approved template. The phone number is in clientProfileData.phone and tracking in packageAttachment.packages[].trackingUrl. Order and shipping updates are utility messages (R$ 0.0350 per delivered message to Brazil); abandoned cart is marketing.

This is the technical guide for VTEX. The overall WhatsApp strategy for online stores is in WhatsApp API for ecommerce.

Feed or Hook: which one to use

VTEX offers two ways to track orders, described in the Orders Feed v3 guide:

FeedHook
ModelA queue you read with GET /api/orders/feed and acknowledge with POST /api/orders/feed (commit)VTEX sends a POST to your endpoint on every change
SetupPOST /api/orders/feed/configPOST /api/orders/hook/config
Good forBatch processing, servers without a public endpointNear-real-time alerts such as WhatsApp
RetentionmessageRetentionPeriodInSeconds between 345600 and 1209600 (4 to 14 days)Configuration removed after 3 days without notifications

For WhatsApp, the Hook is the natural choice: customers want to know their payment was approved right away, not on the next polling cycle. One important detail: each appKey can configure or access one feed and one hook. If another system already uses the hook with the same key, create a dedicated appKey for the WhatsApp integration, with the Feed v3 and Hook Admin role.

Configure the Orders Hook

The call uses the X-VTEX-API-AppKey and X-VTEX-API-AppToken headers (Orders API). There are two filter types:

  • FromWorkflow: a list of statuses. Simple and enough for per-step notifications.
  • FromOrders: a JSONata expression over the order, for rules like “only sales channel 1”. Test the expression with POST /api/orders/expressions/jsonata.

Mixing fields from both types returns 409 Conflict.

curl -X POST "https://{account}.vtexcommercestable.com.br/api/orders/hook/config" \
  -H "X-VTEX-API-AppKey: $VTEX_APP_KEY" \
  -H "X-VTEX-API-AppToken: $VTEX_APP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "type": "FromWorkflow",
      "status": ["payment-approved", "invoiced", "canceled"]
    },
    "hook": {
      "url": "https://integration.yourstore.com/vtex/hook",
      "headers": { "x-hook-secret": "a-long-random-value" }
    }
  }'

When you save, VTEX sends {"hookConfig": "ping"} to the URL. If your endpoint doesn’t return 200, the API responds 400 and the configuration isn’t saved. The headers you define are sent with every notification: use them to authenticate the call on your side, since the hook guide doesn’t describe a body signature.

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

What the hook delivers

The notification body is short. The Orders API reference example contains:

{
  "Domain": "Fulfillment",
  "OrderId": "v52277740atmc-01",
  "State": "ready-for-handling",
  "LastState": "window-to-cancel",
  "LastChange": "2019-08-14T17:11:39.2550122Z",
  "CurrentChange": "2019-08-14T17:12:48.0965893Z",
  "Origin": { "Account": "automacaoqa", "Key": "vtexappkey-appvtex" }
}

There’s no phone and no items. With the OrderId, you call GET /api/oms/pvt/orders/{orderId} and pull what the message needs:

FieldUse in WhatsApp
clientProfileData.firstNameName in the greeting
clientProfileData.phoneRecipient (normalize to digits with country code)
status and statusDescriptionStep confirmation
packageAttachment.packages[].invoiceNumberInvoice number
packageAttachment.packages[].courierCarrier
packageAttachment.packages[].trackingNumber and trackingUrlTracking code and link

packageAttachment is created after invoicing, so the shipping notice makes sense from invoiced onward. In the reference’s own examples the phone appears with and without +, so always normalize. Stores using Data Protection Plus (a closed-beta feature in selected regions) have a different endpoint for personal data; read the personal data guide before integrating.

Order status and the message for each step

VTEX documents the status flow in the orders overview. The most useful ones for WhatsApp:

StatusMeaningMessageCategory
payment-pendingAwaiting paymentPending Pix or boleto, with amountUtility
payment-approvedPayment approvedOrder confirmationUtility
invoicedOrder invoiced (invoice issued)Order shipped, with trackingUtility
canceledOrder canceledCancellation and refund noticeUtility

Avoid messaging on both order-created and payment-pending, and remember there’s a cancellation window (window-to-cancel) before ready-for-handling. For last-mile tracking, carrier events complete the picture: see WhatsApp delivery notifications.

Sample endpoint (Node.js)

app.post('/vtex/hook', express.json(), async (req, res) => {
  if (req.body.hookConfig === 'ping') return res.sendStatus(200);
  if (req.get('x-hook-secret') !== process.env.HOOK_SECRET) return res.sendStatus(401);
  res.sendStatus(200); // VTEX requires 200 within 5000 ms
  queue.add('vtex-order', req.body, { jobId: `${req.body.OrderId}:${req.body.State}` });
});

worker.process('vtex-order', async ({ data }) => {
  const order = await vtex.get(`/api/oms/pvt/orders/${data.OrderId}`);
  const to = (order.clientProfileData.phone || '').replace(/\D/g, '');
  const pkg = order.packageAttachment?.packages?.[0];
  const map = {
    'payment-approved': ['order_confirmed', [order.clientProfileData.firstName, order.orderId]],
    'invoiced': ['order_shipped', [order.clientProfileData.firstName, order.orderId, pkg?.courier || 'carrier']],
    'canceled': ['order_canceled', [order.clientProfileData.firstName, order.orderId]],
  };
  const [name, vars] = map[data.State] || [];
  if (!name || !to) return;
  await sendTemplate(to, name, vars); // POST /api/messages with Meta's template JSON
});

The jobId built from OrderId + State prevents two messages when VTEX resends a notification: when your endpoint fails, VTEX recalculates the next retry interval using a geometric progression. The queue also protects your rate limit: on a 429, VTEX recommends waiting before retrying. The full design is in WhatsApp API integration architecture.

For the shipping notice, a dynamic URL button with the tracking code works well when the carrier URL has a fixed part. If trackingUrl varies a lot, use a link on your store (/tracking/{orderId}) that redirects. Add UTM parameters to the button to measure clicks: see WhatsApp template UTM tracking.

Abandoned cart on VTEX

Here VTEX doesn’t use the Orders Hook, because there’s no order yet. There are two official mechanisms:

  • Native email via a Master Data trigger: a trigger on the Customer entity when Last session changes, with checkout and cart filters plus Receives newsletter? = true. The session expires after 30 minutes, and only then does the trigger’s timer start (setting up abandoned carts).
  • WhatsApp through VTEX CX Platform: VTEX has a cart recovery agent that sends WhatsApp templates, and documents a webhook that headless or app storefronts can call to notify it (integrating with the abandoned cart webhook).

If you want recovery on your own number with your own templates, the trigger has to come from your frontend or backend, which knows when an orderForm with a phone number went idle. Meta treats this template as marketing and it requires marketing opt-in; the newsletter filter VTEX uses for email mirrors that rule nicely. Timing and copy are in recovering Pix, boleto and abandoned carts.

Cost per order

For recipients in Brazil, since October 1, 2026: R$ 0.0350 per delivered utility template and R$ 0.3217 per marketing template (pricing). Three utility notices per order (confirmed, shipped and delivered, the last one from the carrier) cost R$ 0.105. Utility sent inside the customer service window has also been charged since October 2026, and the 1,000 free service messages per number per month don’t cover utility. VTEX stores selling in other countries pay the recipient country’s rate: see WhatsApp API pricing by country.

If the order starts inside WhatsApp, see also WhatsApp orders with order_details.

How to do it with Vectalk

Vectalk is a proxy for Meta’s official Cloud API. Your worker calls POST https://apis.vectalk.com.br/api/messages with Meta’s template JSON (send template), and delivery statuses arrive as webhooks in Meta’s format (webhooks). Templates are created in the dashboard, with the Template Library, or via the API.

Billing is prepaid and deducted per delivered message, with no card registered at Meta. With coexistence, the number can stay in the WhatsApp Business app. Vectalk has no native inbox, AI or bulk sending, and it isn’t a VTEX App Store app: the bridge is your backend or a tool like n8n. Start with the official WhatsApp API guide and create your account at apps.vectalk.com.br/register.

Frequently asked questions

Can I use the same hook for the ERP and for WhatsApp?

Each appKey has a single hook. If the ERP already uses the hook with one key, create another appKey for the WhatsApp integration. Alternatively, run one service that receives the hook and fans events out internally.

Why did my hook stop arriving?

VTEX removes a hook configuration after three days without notifications. Low-traffic stores and test environments should check with GET /api/orders/hook/config and recreate it when needed.

Does the hook include the customer’s phone?

No. It carries OrderId, State and timestamps. The phone comes from GET /api/oms/pvt/orders/{orderId}, in clientProfileData.phone.

Does VTEX already have native WhatsApp?

Yes: VTEX CX Platform offers WhatsApp agents and automations, including cart recovery. A custom API integration makes sense when you want your own templates, your own number and the logic in your system.


Official sources consulted on November 10, 2026: VTEX: Orders Feed v3 and Hook, VTEX: Orders API, VTEX: orders overview and statuses, VTEX: personal data (Data Protection Plus), VTEX: setting up abandoned carts, VTEX: CX Platform abandoned cart webhook, Meta: template categorization, Meta: pricing, 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.