---
title: "Build an AI customer support agent with order lookups"
description: "Build an AI customer support agent that reads order questions in Gmail, looks up each order in Shopify or WooCommerce and drafts the reply, on AIsa Connect."
canonical: "https://aisa.one/solutions/ai-customer-support-agent"
---

# Build a support agent that answers where-is-my-order emails

> Build an AI customer support agent that reads order questions in Gmail, looks up each order in Shopify or WooCommerce and drafts the reply, on AIsa Connect.

Merchants connect Gmail and their store once, your agent finds order questions in the inbox, looks up each order in Shopify or WooCommerce, and drafts the reply for a person to send.

- Web page: https://aisa.one/solutions/ai-customer-support-agent
- Who it suits: Agent builders and Enterprise teams
- Data domain: AIsa Connect
- Runs on AIsa Connect: [AIsa Connect](https://aisa.one/products/connect)

## Four requests from inbox to drafted reply

Each request runs from your server for one merchant, so Gmail, Shopify and WooCommerce answer with that merchant's data only.

### 1. The merchant connects Gmail

Start a connect session for the merchant and open its connectUrl. Google's consent screen runs from AIsa's hosted page, and you poll the session until it completes. The store connects with credentials, as on the Shopify agent page.

```
curl "https://api.aisa.one/apis/v1/connector/connect/gmail?externalUserId=store_8812" \
  -H "Authorization: Bearer $AISA_API_KEY"
```

### 2. Find order questions in the inbox

gmail.search_threads takes a Gmail search query and returns the matching threads. gmail.fetch_message_by_thread_id then reads the whole conversation.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "gmail.search_threads",
    "externalUserId": "store_8812",
    "input": {
      "query": "newer_than:1d (order OR delivery OR refund)",
      "maxResults": 20
    }
  }'
```

### 3. Look up the order in the store

Search by the sender's email address: shopify.list_orders takes an email: query, and woocommerce.list_orders takes a search term.

Shopify:

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "shopify.list_orders",
    "externalUserId": "store_8812",
    "input": {
      "first": 5,
      "query": "email:jane@example.com"
    }
  }'
```

WooCommerce:

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "woocommerce.list_orders",
    "externalUserId": "store_8812",
    "input": {
      "search": "jane@example.com",
      "perPage": 5
    }
  }'
```

### 4. Record the answer on the order

Your agent drafts the reply in your product for a person to send. woocommerce.add_order_note then leaves a private note on the order, a write the merchant approves first.

```
curl -X POST "https://api.aisa.one/apis/v1/connector/actions/run" \
  -H "Authorization: Bearer $AISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "actionKey": "woocommerce.add_order_note",
    "externalUserId": "store_8812",
    "input": {
      "orderId": 1043,
      "note": "Customer asked where the order is. Reply drafted with the tracking link.",
      "customerNote": false
    }
  }'
```

## Let your coding agent build it

Paste this into Claude Code, Codex or Cursor in your helpdesk's repository, and keep your AIsa key in the server's environment.

```text
Add order lookups to our support inbox with AIsa Connect (https://aisa.one/docs/resources/aisa-connect).

Read the guide first. Call AIsa only from the server with AISA_API_KEY from the environment.

1. Let a merchant connect Gmail: call GET /connect/gmail with their ID as externalUserId, open the complete connectUrl and poll the connect session until it completes.
2. Let them connect Shopify (POST /connect/shopify/credentials) or WooCommerce (POST /connect/woocommerce/credentials) with the fields each app lists.
3. Every 15 minutes, run gmail.search_threads for new order questions and read each thread with gmail.fetch_message_by_thread_id.
4. Look up the sender's orders with shopify.list_orders (an email: query) or woocommerce.list_orders (search).
5. Draft a reply in our app with the order status for a support agent to review and send. Do not send email.

Read each action's inputSchema before writing the calls, and show me the plan first.
```

Your coding agent shows a plan before it writes code. Gmail connects with read access, so replies go out from your product or the merchant's own mail client.

## Questions about building an AI customer support agent

### What does an AI customer support agent do?

An AI customer support agent reads incoming customer messages, finds the facts it needs in your systems and drafts or sends an answer. Built on AIsa Connect, it reads a merchant's Gmail and looks up orders in their Shopify or WooCommerce store.

### Can it answer where-is-my-order questions?

Yes. It matches the sender's email address to their orders and reads each order's fulfillment status, so the draft can say whether the order is waiting, partly shipped or shipped.

### Can the agent send the reply from Gmail?

Not today. Gmail connects with read access, so the agent drafts the reply in your product and a person sends it from there or from Gmail.

### Which inboxes and stores can a merchant connect?

Gmail for the inbox, and Shopify or WooCommerce for orders, all verified in production. The Connectors tab lists other helpdesk and store apps with their actions.

### Can one merchant's agent see another merchant's emails?

No. Every connection belongs to one externalUserId, the merchant's ID in your system, and a run uses only that merchant's connections.

### What does a support agent cost to run?

Each successful run costs $0.0003, so searching the inbox, reading a thread and looking up an order costs about $0.0009 per question. Connecting accounts is free.

## Related tasks

- [Build a Shopify AI agent](https://aisa.one/solutions/shopify-ai-agent.md): Merchants connect their store once, and your agent reads orders and stock and tags orders through AIsa Connect. For Agent builders and Cross-border sellers
- [Automate ecommerce reports](https://aisa.one/solutions/ecommerce-reporting.md): Pull each merchant's orders and email campaigns every week and write the report to their Notion. For Agent builders and Marketing agencies
