Answer a “where is my order?” email in WooCommerce with AI
Find a customer's orders by email, see where the latest one stands and any tracking number, and get a reply drafted for you to send.
Prerequisites
A connected site running WooCommerce 10.9 or newer on WordPress 6.9 or newer, and the email address the customer ordered with.
A customer at [customer email address] asked where their order is. Order number they gave: [order number, or none] Find their orders with the woocommerce/orders-query ability (billing_email set to their address, include_line_items true, per_page 100). They come back newest first. If they gave an order number that is not among these orders, do not look it up: tell me and stop. If no order matches that email, say so and stop. Use the order they gave, or else the newest order that is not failed, pending or cancelled, and tell me about any of those you skipped. Read that order's notes from the WooCommerce REST API (GET /wc/v3/orders/ followed by the order id and /notes) and look for a tracking number or a shipping note. Tell me the order number, the date, the status, the items and any tracking you found. Then draft a short, friendly reply I can send myself: what they ordered, where it stands, and the tracking number if there is one. If the order is still processing, say it has not shipped yet and do not promise a delivery date. Do not email the customer and do not change anything. Last, ask me whether to add a private note to that order saying the customer asked for an update today. Only on my yes, add it with the woocommerce/order-add-note ability and customer_note false, and confirm the note id.
Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:
Run the “Answer a “where is my order?” email in WooCommerce with AI” recipe from the WPVibe cookbook on my connected site.
"Where is my order?" is the email every store gets most, and answering it means a search: find the customer's orders, open the newest one, scroll the notes for a tracking number, and then write the reply. It takes five minutes each time, and when the inbox has a dozen of them the polite answers start getting short.
The AI finds the orders placed with the customer's email address through WooCommerce's own order abilities, guest checkouts included, skips failed, unpaid and cancelled attempts, and reads the latest real order's notes from the WooCommerce REST API to find any tracking number you already sent. It tells you the order number, items and status, and drafts a reply for you to send yourself. It never emails the customer, and it will not look up an order number that does not belong to that email address, since "where is my order" is also how people fish for other customers' details.
Paste the customer's email address into the prompt, and an order number if they gave one. If the order is still Processing, the draft says so plainly and does not promise a delivery date, so add one yourself only if you know it. At the end the AI offers to add a private order note recording that the customer asked; it adds it only if you say yes, and your customer never sees it.
Outcome
The order's status and tracking in the chat, and a reply drafted for you to send.