Skip to content

Order status & track-and-trace

Once an order is in MendriX, you usually want to know when its status changes: accepted, on the way, delivered, and every scan in between. The recommended pattern is webhooks for immediacy + polling as a safety net.

Step 1 — Receive status events (webhooks)

Section titled “Step 1 — Receive status events (webhooks)”

Ask your MendriX administrator to configure the relevant Event–Consequence pairs pointing at your endpoint. Useful events for tracking:

  • order accepted / rejected / finished,
  • order trace (scan status) changed,
  • task status changed / task completed,
  • ETA / late-notification events.

Expose an HTTPS endpoint that returns 2xx quickly, then processes asynchronously:

import express from 'express';
const app = express();
app.use(express.json()); // or express.text() for XML templates
app.post('/webhooks/mendrix', (req, res) => {
// 1) Acknowledge fast so MendriX does not retry.
res.sendStatus(204);
// 2) Extract the order id from the payload (shape is tenant-defined) and
// fetch the authoritative state from the REST API.
const orderId = req.body.orderId ?? req.body.OrderId;
queue.add(() => refreshOrder(orderId));
});
app.listen(8080);

Secure the endpoint with one of the supported outbound auth methods (Basic, Bearer, Digest, OAuth2) — MendriX does not HMAC-sign payloads. See Webhooks.

Step 2 — Fetch the authoritative state (SOAP)

Section titled “Step 2 — Fetch the authoritative state (SOAP)”

After a webhook (or on a schedule), call the Custom Link to get the order’s current fields and task statuses. This is a two-step SOAP call: request the matching Ids, then request the full order data for them — see Order retrieval & sync for the full field reference. For scan-level events (pickup scanned, delivered, …), use RequestTracesGoods — see Traces (track & trace).

Request the full order (including its tasks) by Id:

<?xml version="1.0" encoding="windows-1252"?>
<EoCustomLinkRequestOrdersNormal Type="TEoCustomLinkRequestOrdersNormal">
<Nested>False</Nested>
<Filter Type="TEoFilterOrdersNormal">
<KeysExplicitAsCsv>ORDER_ID</KeysExplicitAsCsv>
</Filter>
</EoCustomLinkRequestOrdersNormal>

Entity-escape this payload into the ARequest parameter of the ExecuteRequest SOAP operation and POST it to the Custom Link endpoint — see how calls work and the server time example for the full envelope and a working curl command.

For scan events on the order’s goods, call RequestTracesGoods with OrderIdsAsCsv set to the order Id — see Traces (track & trace).

Webhooks can be missed (endpoint down longer than the retry window — see the retry policy). Run a periodic sweep as a safety net using the same SOAP calls as Step 2:

On a schedule, call RequestOrdersNormalIds with SequenceMinimum set to the highest Sequence value you’ve already processed — see incremental sync — then RequestOrdersNormal for the full data of any new Ids, and reconcile against your local copy.

  1. Webhook → enqueue the order id.
  2. SOAP read (RequestOrdersNormal / RequestTracesGoods) → fetch authoritative status, update your system.
  3. Scheduled SequenceMinimum sweep → safety net for missed deliveries.
  4. Make every write idempotent so duplicate signals are harmless.