Tell the team when a tracking number is added
Notice and team email with the carrier and tracking number. A validated order.tracking_added@1 definition.
When someone adds a tracking number to an order, or buys a shipping label, tell the team at once with the order number, the carrier and the number. Trigger: order.tracking_added@1. Actions: notify_me@1 and send_internal_email@1.
This is the tracking moment, not the shipped moment. A shipping label writes the tracking number before the carrier has the parcel and before the order's status becomes shipped. For the shipped moment use order.fulfilled@1.
Model background: Automations.
The definition
{
"schemaVersion": 1,
"trigger": {
"type": "order.tracking_added@1",
"origins": [
"USER",
"API",
"MCP",
"ASSISTANT",
"BULK",
"IMPORT",
"DUPLICATE",
"SYSTEM",
"AUTOMATION"
]
},
"steps": [
{
"id": "tell",
"type": "action",
"contract": "notify_me@1",
"input": {
"title": "Tracking added to order {{order.number}}",
"message": "{{shipment.carrier}} {{shipment.trackingNumber}}. This is the moment a tracking number was added, for example when a label is bought. It does not mean the parcel has shipped."
}
},
{
"id": "mail",
"type": "action",
"contract": "send_internal_email@1",
"input": {
"recipientUserIds": ["user_REPLACE_WITH_TEAM_MEMBER_ID"],
"subject": "Tracking added to order {{order.number}}",
"body": "A tracking number was added to order {{order.number}}. Carrier: {{shipment.carrier}}. Tracking number: {{shipment.trackingNumber}}. The parcel may not have shipped yet.",
"includeEntityLink": true
}
}
]
}Replace user_REPLACE_WITH_TEAM_MEMBER_ID with the id of a team member (1 to 5 user ids, never an email address). The notice goes to the people who manage automations in the dashboard; the email goes only to the people you name.
How it works
order.tracking_added@1fires once per new non-empty tracking number of an order, in the transaction that writes it. That happens when an order is shipped with a tracking number (Fulfill), when a number is added or corrected on an order that already shipped, when a shipping label is bought, and, only for a number the order has not had before, when cancelling a shipment makes another live shipment's number the order's number (a number fires once per order and counts when its label is bought, so this is rare: it happens for a label bought before the automation was switched on).- Its facts are the order facts without the status transition, plus
event.facts.shipment.carrier(text, may be empty) andevent.facts.shipment.trackingNumber. No tracking link is ever a fact, because some carrier links contain a postal code. - A text may use the order variables,
{{shipment.carrier}}and{{shipment.trackingNumber}}. The tracking number is personal data (a parcel id can identify a recipient at the carrier), so print it only into your own notices, emails and HTTP bodies and a filter or a condition on it is refused (FILTER_PATH_INVALID). Filter onevent.facts.shipment.carrierinstead (the dashboard form offers only the carrier). - To alert on one carrier only, add a trigger
filterwith{ "op": "all", "rules": [{ "path": "event.facts.shipment.carrier", "op": "eq", "value": "UPS" }] }. - Events come from the dashboard, the API and the carrier pipeline (
USER,API,SYSTEM). An MCP or assistant fulfilment recordsUSER, asorder.fulfilled@1does.
What it does not do
- It is not "the order was shipped".
order.fulfilled@1is the shipped moment, once per order. A label purchase fires this trigger earlier. To act only once the order is really shipped, useorder.fulfilled@1, or add awaitand then a condition oncurrent.order.statusbeingSHIPPED,DELIVERED,FULFILLEDorCOMPLETED. - It does not fire when the same number is written again, when the tracking is cleared, when an order is created or imported with a tracking number, for a return label, or for a correction back to a number already recorded for that order. Changing A to B and back to A records A once.
- It does not email the shopper a shipping update. The platform already emails the customer when an order ships, so a
send_customer_email@1under this trigger would be a second email, never the shipped email. A marketing email goes only to a customer who agreed to marketing emails; an email about the order carries no offers. - The recipients of the team email must still be allowed to receive it at send time, or the run ends
SKIPPEDwithNO_RECIPIENTS.
Create it
With the Admin MCP:
get_automation_guidewithtopic: "triggers", then"messages".validate_automation_definition. Fix every finding.test_automationwithentity: { "type": "Order", "id": "<an order id>" }. The test uses the order's current tracking number, or the example numberSAMPLE-TRACKINGwhen it has none, and nothing is saved or sent.create_automation_draftwithname: "Tracking number added".- Tell the merchant to approve it in the dashboard.
With the SDK:
const check = await admin.validateAutomationDefinition(storeId, { definition });
if (!check.ok) throw new Error(JSON.stringify(check.errors));
const draft = await admin.createAutomation(storeId, {
name: 'Tracking number added',
definition,
});What the merchant sees
A draft in Settings, then Automations. Once on, each new tracking number on an order sends a notice in the dashboard and an email to the people you chose, for example "Tracking added to order 1042" with the carrier, the number and a link to the order. The history shows one row per new number.
Get alerted when one of your automations fails
Notify the owner and email the team when another automation fails for good. A validated automation.run_failed@1 definition.
Tag the order and tell the team when a payment is disputed
Tag the order and alert the team when Stripe or PayPal opens a chargeback. A validated payment.disputed@1 definition.