Ecommerce integration

WooCommerce

WooCommerce AI integration
  • CategoryEcommerce
  • AuthConsumer key + secret
  • Scopes1

Overview

Connect WooCommerce so the AI agent can look up your customers' orders and answer questions about your products. You connect it from Connections > Integrations with your store address and a Read/Write REST API key that you create in WordPress. Once it is connected, you can also use your WooCommerce orders in campaigns and let the AI agent create unpaid orders that customers pay on your own checkout page.

What MessageMind can do with it

  • When a customer gives an order number, the AI agent finds the order in your store and tells them its status, totals, shipping details and the updates written in the order notes.
  • Before sharing anything about an order, the AI agent asks for the email address on the order (or the phone number, when the order has no email) and checks that it matches.
  • Order numbers changed by a plugin, such as numbers with letters in front, can be looked up too.
  • Your published products can be imported into AI Training, so the AI agent can recommend them and quote prices, options and product links.
  • With Sync Products on, products you publish, edit or delete in WooCommerce are updated in AI Training as well.
  • With Let the AI take orders on, the AI agent prices a basket against your live store, offers your delivery options with their cost, creates an unpaid order and sends the customer your store's payment link.
  • Campaigns can start when an order is placed (Order Created) or moves from one status to another (Order Status Changed), for any order or only orders with certain products. The same two events can also be used as a campaign goal.
  • Messages in a campaign started by an order can include order details such as Order Number, Order Total and Customer First Name.
  • The Create Coupon action makes a new coupon in your store, and a later step can send the code to the contact.
  • In a campaign started by an order, the Change Order Status action moves that order to the status you pick.
  • The Customer purchased condition checks whether a contact has bought certain products from your store, or anything at all.
  • If you run more than one WooCommerce store, list them on the settings page. The AI agent then works out which store an order belongs to and asks the customer when it isn't clear.

Requirements

  • A Starter, Professional or Enterprise plan.
  • A WordPress site running WooCommerce whose address starts with https.
  • WordPress permalinks set to any option other than Plain, under Settings > Permalinks in WordPress.
  • A WordPress login that can open WooCommerce > Settings, to create the REST API key.
  • To let the AI agent take orders: at least one payment method switched on in WooCommerce.

How to connect

  1. In your WordPress admin, open WooCommerce > Settings > Advanced > REST API.
  2. Click Add key. On a store with no keys yet, the button reads Create an API key.
  3. Enter a Description you will recognise later, such as MessageMind.
  4. In User, choose an administrator account.
  5. Set Permissions to Read/Write and click Generate API key.
  6. Copy the Consumer key and Consumer secret that WooCommerce shows.
  7. In MessageMind, open Connections > Integrations from the top bar and find WooCommerce under Ecommerce, or search for it.
  8. Click Connect on the WooCommerce row to open the Connect to WooCommerce window.
  9. In Store URL, enter your shop's web address, for example https://example.com.
  10. Paste the Consumer key from WooCommerce into Consumer Key and the Consumer secret into Consumer Secret.
  11. Click Connect. MessageMind checks that the address works and that the key can both read and write. This takes a few seconds.
  12. The window closes and the WooCommerce row shows a tick and a Disconnect button.
  13. Next, import your products into AI Training and pick your options on the settings page (see Example workflows and Configuration).

Authentication and permissions

Mechanism
A WooCommerce REST API key. You create it in your WordPress admin and paste it into MessageMind together with your store address. There is no sign-in window to go through.
Credentials
Store URL, Consumer Key and Consumer Secret, entered in the Connect to WooCommerce window. The key and secret come from WooCommerce > Settings > Advanced > REST API. Once saved, they show only as a hidden value on the WooCommerce settings page.

Required scopes

  • Read/Write, chosen in the Permissions field when you create the key. Product sync, coupons, order status changes and orders taken by the AI agent all write to your store.

Available data and actions

Reads

  • Orders, found by order number: status, totals, payment method, billing and shipping details, custom fields added by your plugins (a tracking number, for example) and all order notes, private notes included.
  • Published products when you import them or while Sync Products is on: name, descriptions, price, variations and their options, category, tags, images, SKU and product link.
  • Your store's currency and order statuses, custom statuses included, which campaign steps offer as choices.
  • Past orders matching a contact's email or phone, for the Customer purchased condition. Cancelled, refunded, failed and unpaid orders don't count as purchases.
  • New orders and status changes, once you have saved a campaign that uses a WooCommerce trigger. The billing name, email and phone on the order add the buyer to your contacts or update them.
  • Delivery options and prices, payment methods and discount codes for a basket, when the AI agent takes an order.

Writes

  • Coupons from the Create Coupon action. In WooCommerce they carry the description Created by a MessageMind automation.
  • Order statuses, changed by the Change Order Status action.
  • Unpaid orders with the status Pending payment, when Let the AI take orders is on. If nobody pays in time, the order is moved to Cancelled with a note.
  • Entries whose names start with MessageMind, under WooCommerce > Settings > Advanced > Webhooks. Your store uses them to tell MessageMind about new orders and product changes. They are added when you turn on Sync Products or save a campaign that uses a WooCommerce trigger or goal.

AI agent use cases

  • A customer writes on WhatsApp: "Any news on order 10452?" The AI agent asks for the email used at checkout, checks it, and replies with the status and the tracking number your shipping plugin added to the order.
  • A visitor on your website chat asks for a waterproof jacket under 100. The AI agent searches your imported products and answers with a few matching jackets, their prices and links.
  • Someone on Instagram wants a ticket for a workshop you sell in WooCommerce. The AI agent prices it, takes their name, email and billing address, and sends a link to pay on your checkout.
  • Each new order starts a campaign that sends a thank-you message with the order number and total.
  • When an order moves from Processing to Completed, a campaign creates a coupon only that customer can use and sends it with a request for a review.
  • A follow-up campaign about a product skips contacts who already bought it, using the Customer purchased condition.

Configuration

  • Click the gear button on the WooCommerce row in Connections > Integrations to open WooCommerce Settings. Make your changes and click Save at the top. Back returns to Integrations.
  • Under Instructions for your AI, write rules the AI agent follows when it answers about an order, for example details it must never share.
  • Sync Products updates AI Training whenever you publish, edit or delete a product in WooCommerce. It is off after you connect.
  • Let the AI take orders allows the AI agent to create unpaid orders and send your payment link. It is off after you connect.
  • Cancel an unpaid order after appears once Let the AI take orders is on. Enter 15 to 1440 minutes. Left empty, it is 60.
  • Under Stores, the store you connected is listed first, named after its web address, with its key and secret hidden. Click Add store to add another WooCommerce store with its Store name, Store URL, Consumer Key and Consumer Secret, or the bin button to remove one.
  • Give each store the name your customers know it by, such as the brand or website, when you add it. With several stores listed, the AI agent matches what the customer says to these names.
  • Order Status Settings holds a description for each order status, which the AI agent uses to explain a status to customers. Click Create new order status (Add Status when the list is empty) to add one with a Name and Description.

Example workflows

Bring your products into AI Training

  1. Connect WooCommerce first.
  2. Open AI Lab > AI Training and go to Products. Services accounts see Offerings there, and the buttons below say Offering instead of Product.
  3. Click Add Product and choose Import Products From Store.
  4. Select WooCommerce. Leave Existing products will be overwritten unticked to merge the store's data into products you already have, or tick it to replace products that have the same link.
  5. Click Continue and wait for the import to finish. Your published products come in.
  6. Back in Connections > Integrations, click the gear button on the WooCommerce row, turn on Sync Products and click Save, so later changes in WooCommerce reach AI Training.

A customer asks where their order is

  1. A customer writes on Instagram: "Where is my order 4821?"
  2. If you listed more than one store and the message doesn't say which, the AI agent asks where they ordered.
  3. It finds order 4821 and asks for the email address used on the order.
  4. The email matches, so the AI agent says the order is Completed and gives the tracking number from the order notes.

The AI agent takes an order in the chat

  1. On the WooCommerce settings page, turn on Let the AI take orders, set Cancel an unpaid order after and click Save.
  2. A customer on WhatsApp asks to buy two bags of your house blend, delivered to their home, and gives a discount code.
  3. The AI agent checks both items and the code with your store, asks for the delivery address and lists your delivery options with the price and total for each.
  4. The customer picks express delivery. The AI agent asks for their name, email and billing address.
  5. It creates the order in WooCommerce with the status Pending payment and sends the order number, the total, the payment link and the time the order will be cancelled if unpaid.
  6. The customer pays on your checkout page. If nobody pays in time, the order is cancelled.

Send a coupon when an order is completed

  1. Open Workspace, click Campaigns in the left rail, click Create campaign and give it a name.
  2. Click Add a Trigger and pick Order Status Changed under WooCommerce.
  3. Set From status to Processing and To status to Completed, choose what the order must contain (Any product, for example) and click Save trigger.
  4. Add an Action step and pick Create Coupon under WooCommerce in the Choose an action window.
  5. Choose Percentage off as Discount type, enter 10 as Amount, turn on Only for this contact and fill in any limits you want.
  6. Add another Action step after it, pick Send Email or Send SMS, and insert the Coupon code variable in the message.
  7. Switch the campaign from Draft to Published and click Save.

Disconnect and reconnect

  • Open Connections > Integrations and click Disconnect on the WooCommerce row. It happens straight away and shows "Integration Successfully Removed".
  • The AI agent stops looking up WooCommerce orders and taking orders, and the WooCommerce triggers, actions and Customer purchased condition in your campaigns stop working.
  • MessageMind removes its Sync Products entries from your store. Entries added for campaign triggers stay under WooCommerce > Settings > Advanced > Webhooks, so delete the ones whose name starts with MessageMind.
  • Products you imported stay in AI Training, and coupons and orders already created stay in WooCommerce.
  • Cancel any unpaid orders created by the AI agent that are still open in WooCommerce > Orders.
  • The stores you added, your Instructions for your AI and the Sync Products and Let the AI take orders switches are cleared.
  • To cut access on the store side too, revoke the key in WooCommerce > Settings > Advanced > REST API.