# 16 · AI agent in depth: products, orders and bookings, testimonials, tools, then review, tests and quality

**Purpose:** let the AI agent sell for you (quote from your product list, take orders and bookings, send matching testimonials, look things up in your own system), then check its answers and make them better (tests, review, quality, usage).

## Before you start

- An AI agent that is already set up: business details, knowledge base and a try in the Playground. See [05 · AI agent and knowledge](https://wsapme.com/guides/ai-agent-and-knowledge.md).
- AI credits. Playground replies and test runs use credits like real replies.
- You are an owner or admin of the workspace. Other team members cannot change the agent, and they do not see the **Tools**, **Sales** and **Usage** tabs.

**Watch first (4:11, Malay narration):** [AI agent: sell, check and improve](https://wsapme.com/guide-media/video/16-ai-agent-selling-and-quality-malay.mp4). A home bakery sets a product's stock, looks at the order form, takes an order in the Playground (the agent then hands the chat to the team, as the order form asks), tags a testimonial with a topic, runs the agent tests and walks through Review, Quality and Usage. The agent is not switched on and nothing is sent to a customer.

> The agent in this guide was **never switched on**. Screenshots use a demo workspace with made-up data and Demo mode on. Screens that need real customer chats (orders, review queue, activity, quality and usage figures) are shown empty and explained from how the product works; those parts are marked *(from the documentation, not captured)*.

The AI Agent page has these tabs: **Settings**, **Knowledge base**, **Products**, **Testimonials**, **Tools**, **Playground**, **Tests**, **Orders & bookings**, **Sales**, **Review**, **Quality**, **Activity**, **Credits** and **Usage**. On a small screen, scroll the row of tabs sideways to reach the last ones.

## Half 1 · Sell

## Part 1 · Products

The agent quotes prices, stock and links only from this list, so it cannot invent a price.

1. In the sidebar, click **AI Agent**, then the **Products** tab.
2. Click **Add product**. Type the **Name** and **Price (RM)**. Fill **Stock** only if you count stock; leave it empty and the product shows as **Available**. **SKU**, **Description**, **Link (shop page)** and a **Photo** are optional. The agent can send the photo when a customer asks for it.
3. Keep **The agent may offer this product** ticked and click **Save**. Untick it later to hide a product from the agent without deleting it (it then shows **Hidden**).
4. To change a product, click the pencil icon on its row. The same form opens as **Edit product**. A product with stock shows, for example, **12 in stock**; at zero it shows **Out of stock**.

   ![Edit product with Stock set to 12](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/02-product-dialog.webp)

5. To add many products at once, click **Export CSV** (or **CSV template** when the list is empty) to get the columns (name, price, stock, sku, link, image_url, description), fill the file and click **Import CSV**. Rows that could not be read are listed under **Some rows were skipped**.

   ![The Products tab with the order options](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/01-products.webp)

Above the list are the options that decide what happens when the agent takes an order:

| Option | What it does |
|---|---|
| **Take stock off when the agent takes an order** | Only for products with a stock number. Cancelling the order in **Orders & bookings** puts the stock back. |
| **Add a payment link to order summaries** | The customer pays the exact total through your own payment gateway and the order shows as paid. You can tick it only after you connect Stripe here or a payment gateway (CHIP, Billplz or BayarCash) in **Settings → Payments** (see [20 · Sales pages, bookings, payments and domains](https://wsapme.com/guides/sales-pages-bookings-payments-and-domains.md) for that form). Once it is on, **Remind customers who haven't paid** can send one WhatsApp reminder with the link after 6, 12 or 24 hours. *(from the documentation, not captured: no gateway is connected in the demo workspace)* |
| **Add delivery charges to orders** | Set the **Delivery fee (RM)**, a different fee for Sabah, Sarawak and Labuan if you want one, and **Free from order total (RM)**, then click **Save delivery charges**. The agent asks for the address with the postcode and adds the charge to the total. Pickup is free. An address it cannot place shows "delivery to be confirmed" and gets no payment link. *(the fee fields were not opened in this guide)* |
| **Read payment receipts customers send** | When a customer with an unpaid order sends a transfer slip, the agent reads the amount and the order shows as "payment claimed" for you to check. It never marks an order paid by itself. Needs an AI model that can see images. |

**Connect Stripe** and **Connect your shop** (Shopify or WooCommerce, synced every hour) are further down the page. They ask for keys from those services and were not used in this guide. For WooCommerce, see [17 · WooCommerce](https://wsapme.com/guides/woocommerce.md).

## Part 2 · How the agent takes an order or a booking

1. Click **Settings** and scroll to **Orders & bookings**. Each box is a form the agent fills in by chatting. Click **Order form** or **Booking form** to add a ready-made one, or **Custom form** to start empty. You can have up to 5 forms.
2. A form has a **Name**, **When to use it** (for example "The customer wants to buy or order products.") and the **Details to collect**. The Order form asks for **Items and quantities**, **Name for the order**, **Delivery or pickup**, **Date needed** and **Notes**. Tick **Required** for details the agent must get, and use **Add detail** for your own.
3. Under the details: **On** switches the form on, **Email & WhatsApp owners and admins** tells you about each new order, and **Hand the chat to the team afterwards** pauses the agent in that chat once the order is saved. The customer may then get your **Message when handing over** (under **Handing over to your team** further down **Settings**). It is in English by default ("Sure! A member of our team will get back to you shortly."), so change it if your customers write in Malay.

   ![The Order form in the settings](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/03-order-forms.webp)

4. **Booking times from** decides how bookings get their time. **Customers say a date and time (no slots)** just writes down what the customer says. If you have a sales page with a booking form, choose its booking slots instead: the agent then offers only free times, there are no double bookings, and you can tick the option to ask for the page's deposit, which adds a payment link to the confirmation. *(booking slots and deposits: from the documentation, not captured)*
5. Click **Save settings**. *Save was not clicked in this guide; the demo workspace already had the Order form.*

In a chat, the agent collects the details in a natural way, shows a summary and saves the order only after the customer confirms. Details the customer already gave are filled in, not asked again: the **WhatsApp number** they are chatting from goes on the phone line, and a **location pin** they shared is used as the address (the agent asks them to confirm it and add a house or unit number). In the Playground the agent uses the sample number 0123456789. When the items are in your product list, Wsapme works out the total itself and sends the customer an order summary.

**Try it without sending anything:**

1. Click **Playground** and type an order the way a customer would, for example `Hai, nak order 2 Chocolate Fudge Cake (1 kg). Nama Aina, pickup hari Jumaat ni pukul 3 petang.`
2. Answer the agent's questions and confirm the summary.

   ![An order taken in the Playground](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/04-playground-order.webp)

**What you should see:** under the agent's last reply, a line starting with **Would save order:** with the details it collected, and **Would send the customer:** with the order lines and the total worked out from your product list (in the example, 2 × RM85.00 = RM170.00). If the form has **Hand the chat to the team afterwards** ticked, the reply can also be your handover message, marked **Would hand over to your team**; the picture above is a run without it. Replies differ a little from run to run. In the Playground nothing is saved and nothing is sent. If the agent says it has to check with the team instead, a detail did not fit your knowledge base (for example a pickup on a day you are closed).

## Part 3 · Orders & bookings and the Sales dashboard

1. Click **Orders & bookings**. Every order or booking a customer confirmed is listed here with its details, the customer and an **Open chat** button. Until the agent has taken one, the page says **Nothing here yet.**
2. Use the filters at the top: payment (**Any payment**, **Unpaid**, **Receipt to check**, **Paid**), status (**All**, **New**, **Done**, **Cancelled**) and the form. **Export CSV** and **Export to Google Sheets** save the list (turn Demo mode off first).

*(From the documentation, not captured: the rest of this part needs real orders.)*

- **Payment:** an order with a payment link shows **Awaiting payment**, **Paid** or **Payment failed**, and **Copy payment link** lets you send the link again. A booking with a deposit shows **Awaiting deposit** or the deposit as paid.
- **Receipts:** when the agent has read a transfer slip, the order shows **Payment claimed — check** (or **amount mismatch**). Click **View receipt**, check that the money is in your bank account, then click **Confirm paid** or reject it. Only an owner or admin can confirm.
- **Shipping:** click **Mark shipped**, choose the courier and type the **Tracking number**, then click **Mark shipped and tell the customer**. The customer gets one WhatsApp message, with a tracking link for J&T, Pos Laju, Ninja Van, City-Link and DHL eCommerce. Afterwards click **Mark delivered**. When the customer later asks "dah pos ke?", the agent answers from this status.
- **Status:** mark an order done or cancelled when you have handled it. Cancelling puts the stock back if stock was taken off.

3. Click **Sales** for the totals: **Orders**, **Order value**, **Collected online**, **Paid rate**, **Average order**, **Chats that ordered**, **Bookings & other forms** and **Cancelled**, for **7 days**, **30 days** or **90 days**. Below are **Per day**, **Payments**, **Top products** and **Waiting for payment** (orders older than a day with an unpaid link).
4. Under **Weekly digest**, tick **By email** or **On WhatsApp** to get last week's sales, receipts to check, unpaid orders and unanswered questions every Monday at 09:00. *(not ticked in this guide)*

   ![The Sales dashboard before any order](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/05-sales.webp)

## Part 4 · Testimonials

The agent can send real customer testimonials that match what the customer needs. You make a short list of **topics**; when a customer's message clearly matches one, the agent answers as usual and then sends a few testimonials of that topic. It never writes a testimonial itself, never sends the same one twice to a customer, and sends each topic to a customer at most once a day.

1. Click **Testimonials**, then **Topics**.
2. Under **Add a topic**, type the topic (for example `Diabetes` for a health shop, or `Hari jadi` for a bakery) and, in the second box, the words customers use for it. Click **Add topic**.

   ![The Topics list](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/06-testimonial-topics.webp)

3. Close the box and click **Add testimonial**. Fill **Customer name (shown)**, the **Quote** and, if you have one, a **Photo** (a screenshot or picture, up to 5 MB). **Title (only you see it)** helps you find it later.
4. Under **Topics**, click the topic it belongs to. A testimonial without a topic shows **No topic: never sent**. You can also set a **Rating** and a **Product (optional)**.
5. Keep **The agent may send this testimonial** ticked and click **Save**.
6. When the library is ready, go to **Settings**, find **Testimonials**, tick **Send testimonials when they fit** and click **Save settings**. You can set **Most testimonials per reply** (1 to 5) and a **Line before the testimonials (optional)**. Sending testimonials uses no extra credits. *(the switch was left off in this guide)*

To rename a topic, change its words or delete it, open **Topics** again. Deleting a topic removes it from every testimonial; a testimonial left with no topic is not sent until you tag it again. An AI assistant connected with **Edit the AI agent** can also add, rename and delete topics for you; it shows you which testimonials a delete affects and waits for your yes.

**Import from sales page reviews** copies reviews from a live sales page into the library without a topic; tag them afterwards. Use only real testimonials: customers read exactly what you write. To use a testimonial inside a workflow instead, see the "Matching testimonial" step in [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md).

## Part 5 · Tools (for businesses with their own system)

A tool lets the agent look up live information in your own system during a chat, such as the status of an order. You need a web address (API) from your developer or system provider.

1. Click **Tools**, then **Add tool**.
2. Fill **Name the AI uses** (lowercase, for example `check_order_status`) and **When should the AI use it, and what does it return?** The agent reads this text to decide when to use the tool.
3. Choose the **Method**, type the **URL** (use `{{parameter}}` for the part that changes, for example `https://api.yourshop.com/orders/{{order_no}}`), add any **Headers** your system needs and describe the **Parameters**. Secret header values are stored encrypted and never shown again.
4. Tick the agent under **Agents that may use it** and click **Add tool**.

   ![The new tool form](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/07-tool-dialog.webp)

5. *(From the documentation, not captured.)* On the saved tool, the test button runs one real request with values you type, free of charge, and shows what the AI would read. Tools you add also appear under **Settings → Tools**, where you tick them per agent. The agent makes at most 10 tool calls per chat per hour.

> No tool was saved in this guide. A **POST** tool can change data in your system, so Wsapme asks you to confirm that, and the agent only calls it after the customer clearly confirms.

## Half 2 · Check and improve

## Part 6 · Tests

A test question is something customers ask, together with the facts a right answer must contain. Run the tests after you change the knowledge base or the settings to see that nothing broke.

1. Click **Tests**, then **Add question**.
2. Type the question under **Customer asks**. Leave **The agent should** on **Answer it**, or choose **Hand over to the team** for questions it must not answer itself.
3. Under **The answer must say (one fact per line)**, type the facts, for example `RM95`. **Must not say** is optional. Click **Save**.
4. **Suggest from knowledge base** lets the AI propose questions from your entries; pick the ones to keep (this uses AI credits). In the Playground, **Save as test question** under a reply adds that question too.
5. Click **Run tests**. The line under the button shows the cost before you click, for example "About 2 credits". No message is sent to any customer.

**What you should see:** a **Score** out of 100 and, for example, "1/1 passed". Each question shows **Passed** or not; click the arrow on a question to read the **AI answer** and see which facts it met.

![A test run with its score](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/08-tests-results.webp)

After later runs the page also shows which answers got worse and which were fixed. Tick **Run the tests automatically after the knowledge base or settings change** to have them run by themselves about 10 minutes after your last change; owners get an email and a WhatsApp message if answers get worse. *(not ticked in this guide)*

## Part 7 · Review

**Review** collects AI replies that deserve a second look: the AI handed over or was unsure, the answer checker blocked the reply, nothing matched in your knowledge base, the customer turned out unhappy, or a random check. The agent has already replied; here you judge the reply afterwards so it answers better next time.

1. Click **Review**. The three lists are **To review**, **Corrected** and **Good**. With nothing waiting, the page says **Nothing to review.**
2. *(From the documentation, not captured: needs real replies.)* For each reply you see the customer's message and the **AI reply**. Click **Good** if it is fine, or **Wrong — correct it**.
3. In the box that opens, type the **Better answer** and choose under **Save it as** how the agent should learn it, for example as a **Knowledge entry**, or **Only in Review** to keep it for your records. Tick **Add to agent tests** to turn the correction into a test question.

The same box opens from **Improve this answer** under an AI reply in the inbox and in **Activity**. To have a share of normal replies checked too, set **Also check this share of other replies at random (%)** under **Settings → Quality checks**.

## Part 8 · Quality, Activity and Usage

1. Click **Quality** for the last **7 days**, **30 days** or **90 days**: **Handed to your team**, **No knowledge found**, **Checked answers right** and your latest **Test score**. **Week by week** should show fewer handovers as your knowledge base grows.

   ![The Quality tab](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/09-quality.webp)

2. Scroll to **Knowledge gaps**: questions the agent could not answer, was unsure about or handed over. Click **Add answer** next to one to write the missing knowledge entry, or **Group into topics** to let the AI sort them first. *(from the documentation, not captured: the demo workspace has no gaps)*
3. Click **Activity** for this month's counts (AI replies, chats handed to your team, credits used, follow-ups sent, replies blocked by the answer checker) and the **Activity log** of every reply, with filters for the kind, the check result, the number and the period. **Chats with your team** lists the chats where the agent is paused.
4. Click **Usage** for **Credits by feature** per month (customer replies, answer checker, tools, team assists, voice notes, playground and tests), the **Token statement** for one month (download it with **Statement (CSV)**) and **Cost per lead**: the AI credits spent on customers who became a lead that month, divided by those leads.

## Part 9 · More settings: memory, follow-ups, a second agent, your own AI key

All of these are on the **Settings** tab. Click **Save settings** after a change. *(Nothing in this part was changed or saved in this guide.)*

1. **Conversation memory** (under **Inbox**): tick **Conversation memory: remember earlier messages (summary + key facts)**. The agent reads only the last 20 messages of a chat; with this on, each chat gets a short summary and key facts that the agent reads before every reply and your team sees in the inbox. It costs about one reply's credits per update and is off until you turn it on.
2. **Customer memory** (under **Handing over to your team**): **Remember customers** keeps a short note per customer (preferred name, usual items, delivery area, past issues) for later chats. It never keeps health, religion, race, ID, payment or bank details, and your team can see, edit or clear the note in the inbox.
3. **Follow-ups**: tick **Follow up when a customer goes quiet**, then choose **Follow up after** (from 1 hour to 2 days without a reply) and **Follow-ups per quiet chat** (1 to 3). The AI reads the chat and sends a short nudge only when the customer asked about prices, products, an order or a booking and did not decide. It stays quiet when the chat ended, the customer said no or your team took over, and it sends only between 9am and 9pm. Each follow-up uses credits like a reply, even when the AI decides not to send one. On an official number, choose an approved template under **Template after the 24-hour window (official numbers)** if follow-ups should also go out after 24 hours. *(no follow-up was sent in this guide)*

   ![The Follow-ups section](https://wsapme.com/guide-media/img/ai-agent-selling-and-quality/10-follow-ups.webp)

4. **A second agent** *(from the documentation, not captured: the demo workspace's plan allows one agent)*: when your plan allows more than one, a row of agents appears at the top of **Settings** with **Add agent**. Give it a name, for example "Support" or "Klang branch"; it starts switched off. Each WhatsApp number is answered by one agent with its own instructions, tone and hours. The knowledge base and products are shared.
5. **Use your own AI key** (at the very bottom): tick **Use my own key for AI replies**, choose the **Provider**, type the **Model** and paste the **API key** from your AI provider, then click **Save key settings** and **Test key**. You then pay your provider directly for replies; voice notes still use Wsapme credits. Treat the key like a password. *(no key was entered in this guide)*

## Common problems

| Problem | What to do |
|---|---|
| The agent quotes a wrong price or says a product is not available | Correct the product on **Products**. Check that **The agent may offer this product** is ticked and that **Stock** is not 0. |
| **Add a payment link to order summaries** cannot be ticked | Connect a payment gateway in **Settings → Payments**, or Stripe on the **Products** tab, first. |
| The Playground never shows **Would save order:** | Check on **Settings → Orders & bookings** that the form is **On**, give every required detail, and confirm the summary. If the agent hands over instead, the request does not fit your knowledge base (for example your opening days). |
| Right after the customer confirms, the agent says it will check with the team | The answer checker may have blocked the confirmation (the Playground shows **Blocked by the answer checker**). Make sure the products, prices and opening days the order uses are in your product list and knowledge base, then try again. Blocked replies also appear in **Review**. |
| An order has no total or no payment link | An item was not in your product list or has no price, or the delivery address could not be placed ("delivery to be confirmed"). Fix it with the customer in the chat. |
| Testimonials are never sent | Each testimonial needs a topic and must be **Active**, and **Send testimonials when they fit** must be ticked in **Settings**. Switching a testimonial on is not enough: without a topic it is never sent. The **Testimonials** and **Playground** tabs show a warning when the setting is on but no topic has an active testimonial. Nothing is sent when no topic matches, the customer already got them all, or they got that topic in the last 24 hours. In the **Playground**, a matching reply shows **Would send … testimonials about …**. |
| The agent hands every order or price question to your team | Look at the **Ready to sell** card at the top of **Settings**. Without products that have a price, the agent cannot quote or price an order; without an order form with an **Items** field, it hands every order over. Click **Fix** next to what is missing. Write your closing steps (for example: ask about the problem, suggest a package, take the order) in **Extra instructions**. |
| A test question fails although the answer looks right | Open the question and read which fact was not met. Write facts short and exact (for example `RM95`), one per line. |
| Test scores dropped after a change | Open the questions marked as worse, read the **AI answer** and fix the knowledge entry or setting you changed. Then run the tests again. |
| Follow-ups are not going out | They only go to chats the AI answered, between 9am and 9pm, and not after your team replied. On an official number, choose a template for after the 24-hour window. |
| A reply in **AI Activity** shows **sent unchecked** | The answer checker could not run (it failed twice, or credits were low), so the reply went out without the check. Read that reply yourself. Filter **Sent unchecked** to see them all. If it happens often, check your credits and the checker settings in **Settings**. |
| The agent asks again for an address or phone number the customer already gave | The agent fills the phone line with the customer's WhatsApp number and uses a shared location pin as the address. If your **Extra instructions** or knowledge hold an order template with empty lines, say on each line what goes there, for example `NO. FON : [customer's WhatsApp number]` and `ALAMAT : [address, or the location they shared]`, so the agent does not copy the empty template. |
| You want to know why the agent answered the way it did | In **AI Activity**, click **Show prompt** on the reply (owners and admins). It shows exactly what the AI was given for that reply, even if you changed your settings since. Prompts are kept for 30 days. |

## Related

- [05 · AI agent and knowledge](https://wsapme.com/guides/ai-agent-and-knowledge.md)
- [04 · Chatbot and workflows](https://wsapme.com/guides/chatbot-workflows.md)
- [17 · WooCommerce](https://wsapme.com/guides/woocommerce.md)
- [20 · Sales pages, bookings, payments and domains](https://wsapme.com/guides/sales-pages-bookings-payments-and-domains.md)
- [02 · Team inbox](https://wsapme.com/guides/team-inbox.md)
