Use casesRecipes

General E-commerce Store Agent

Help shoppers browse products, check stock, place orders, and get post-purchase support — all through WhatsApp or web chat.

DifficultyBeginner
TrackBuilder Track
ChannelsWhatsAppWeb Chat
IntegrationsProduct cataloguePayment gateway (optional)

What you'll build

An agent that handles the full shopper journey: browsing products, checking availability, placing orders, and resolving post-purchase questions across WhatsApp and web chat.

Customer journey

A shopper messages on WhatsApp or opens Web Chat on your store to ask about products, shipping, or order status. The agent recommends items from the catalogue KB, checks order status via your commerce API, and escalates damaged-goods claims.

Loading diagram…

See Deploying and testing channels for connect and test steps per channel.

Prerequisites

  • BimpeAI account with an API key (sk_…)
  • Read Anatomy of a workflow agent first — this recipe skips steps covered there
  • A product catalogue you can paste as text or expose at a URL

Steps

1. Find or create the workflow

Search the public library for an e-commerce workflow.

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

const page = await bimpe.workflows.list({ scope: "public", search: "ecommerce" });
const workflow = page.data[0];
console.log(workflow.id, workflow.name);
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

page = client.workflows.list(scope="public", search="ecommerce")
workflow = page.data[0]
print(workflow.id, workflow.name)

Or build a new workflow from scratch with workflows.create instead of finding one. name and system_prompt are required; it returns the new Workflow whose id you bind the agent to. See Anatomy of a workflow agent for the full set of optional fields like rules and flows.

const workflow = await bimpe.workflows.create({
  name: "Store assistant",
  system_prompt: "You help shoppers browse products, check stock, place orders, and resolve post-purchase questions.",
});
console.log(workflow.id);
workflow = client.workflows.create(
    name="Store assistant",
    system_prompt="You help shoppers browse products, check stock, place orders, and resolve post-purchase questions.",
)
print(workflow.id)

2. Create the agent

const agent = await bimpe.agents.create(
  {
    name: "Store assistant",
    description: "Helps shoppers browse, check stock, place orders, and resolve post-purchase questions.",
    workflow_id: workflow.id,
  },
  { idempotencyKey: "create-store-agent-v1" },
);

console.log(agent.id);
agent = client.agents.create(
    name="Store assistant",
    description="Helps shoppers browse, check stock, place orders, and resolve post-purchase questions.",
    workflow_id=workflow.id,
    idempotency_key="create-store-agent-v1",
)

print(agent.id)

3. Add knowledge bases (optional)

Knowledge bases are optional; an agent whose workflow and integrations already cover everything it needs to say can skip this step. This recipe uses one to ground the agent in the details it must quote accurately.

Add your product catalogue. Use a text source for a static list or a url source if you have a live catalogue endpoint.

// Static catalogue
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Product catalogue",
  content: `
    SKU001 | Blue running shoes | £65 | In stock: 42
    SKU002 | White trainers | £55 | In stock: 18
    SKU003 | Black yoga mat | £30 | In stock: 5
  `,
});

// Or a live endpoint
// await bimpe.agents.knowledgeBases.create(agent.id, {
//   type: "url",
//   name: "Product catalogue",
//   url: "https://yourstore.com/catalogue.json",
// });
# Static catalogue
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Product catalogue",
    "content": (
        "SKU001 | Blue running shoes | £65 | In stock: 42\n"
        "SKU002 | White trainers | £55 | In stock: 18\n"
        "SKU003 | Black yoga mat | £30 | In stock: 5"
    ),
})

# Or a live endpoint
# client.agents.knowledge_bases.create(agent.id, {
#     "type": "url",
#     "name": "Product catalogue",
#     "url": "https://yourstore.com/catalogue.json",
# })

4. Connect channels and integrations (dashboard)

Channels and the payment gateway are connected in the dashboard

The API cannot create channel connections, but integrations can now be configured through it; see Configuring integrations. Connect your messaging channels on the Deploy screen and your payment gateway on the Integrations screen of the Console dashboard. The SDK lists what is active but cannot modify channel connections.

  1. In the Console dashboard, pick your agent from the switcher at the top, then open Deploy.
  2. Under Messaging & Chat, click Connect on the WhatsApp card and follow the prompts to link your WhatsApp Business number.
  3. Under Messaging & Chat, click Connect on the Web Chat Widget card to add the widget to your store.
  4. (Optional) Open Integrations, find your payment gateway (such as Stripe or Paystack), and click Connect so the agent can take payments in conversation.

Connect WhatsApp

Customers message your WhatsApp Business number for support and transactions.

  1. Open the Deploy screen in the Console dashboard and select your agent.
  2. Under Messaging & Chat, click Connect on the WhatsApp card.
  3. Follow the prompts to link your WhatsApp Business number.
  4. Once connected, customers can message your business number and the agent replies within WhatsApp's 24-hour session window.

Full reference: Deploying and testing channels.

Connect Web Chat

Visitors use the chat widget embedded on your website or app.

  1. Open Deploy and select your agent.
  2. Under Messaging & Chat, click Connect on the Web Chat Widget card.
  3. Copy the embed snippet and paste it into your site's HTML before the closing body tag.
  4. Publish your site — the chat bubble appears in the corner and routes messages to this agent.

Full reference: Deploying and testing channels.

Also on Instagram and Messenger: the same Deploy → Connect flow applies. Testers use the Deploy panel links or getTestCode deep links for each network. Instagram · Messenger

5. Test your agent

Before going live, exercise the agent on a test channel. Fetch the test code (created on first request), then test on WhatsApp — share the deep link or start message with a human tester, or inject a message from your server.

Test WhatsApp

Human tester: fetch the test code with agents.getTestCode (or use the Deploy panel). Share the deep link or start <code> message with a tester.

SDK injection: call conversations.send with is_test_channel: true and the matching channel_type.

Full reference: Deploying and testing channels.

Test Web Chat

Playground: open Playground → Chat in the dashboard for a quick sanity check.

SDK injection: call conversations.send with channel_type: "webchat" and a stable channel_user_id, or set is_test_channel: true before go-live.

Full reference: Deploying and testing channels.

const { channels } = await bimpe.agents.getTestCode(agent.id);
// A tester opens channels.whatsapp.url, or sends channels.whatsapp.start_message
// to channels.whatsapp.phone_number, to open a 24-hour test window.
console.log(channels.whatsapp.start_message, channels.whatsapp.url);

// Or inject a test message yourself:
await bimpe.conversations.send(agent.id, {
  message: "Do you have the blue running shoes in a size 9?",
  channel_type: "whatsapp",
  channel_user_id: "<tester-whatsapp-number>",
  is_test_channel: true,
});
test_code = client.agents.get_test_code(agent.id)
# A tester opens .url, or sends .start_message to .phone_number, to open a 24-hour window.
print(test_code.channels.whatsapp.start_message, test_code.channels.whatsapp.url)

# Or inject a test message yourself:
client.conversations.send(
    agent.id,
    message="Do you have the blue running shoes in a size 9?",
    channel_type="whatsapp",
    channel_user_id="<tester-whatsapp-number>",
    is_test_channel=True,
)

See Test your agent for the other test channels and the pause-AI rule.

6. Go live

Once channels are connected, conversations arrive automatically. Verify what is active:

const channels = await bimpe.agents.channels.list(agent.id);
console.log("Active channels:", channels.map((c) => c.type));
channels = client.agents.channels.list(agent.id)
print("Active channels:", [c.type for c in channels])

Full example

import { BimpeAI } from "@bimpeai/sdk";

const bimpe = new BimpeAI({ apiKey: process.env.BIMPEAI_API_KEY! });

// 1. Find workflow
const page = await bimpe.workflows.list({ scope: "public", search: "ecommerce" });
const workflow = page.data[0];

// 2. Create agent
const agent = await bimpe.agents.create(
  {
    name: "Store assistant",
    description: "Helps shoppers browse, check stock, place orders, and resolve post-purchase questions.",
    workflow_id: workflow.id,
  },
  { idempotencyKey: "create-store-agent-v1" },
);

// 3. Add product catalogue
await bimpe.agents.knowledgeBases.create(agent.id, {
  type: "text",
  name: "Product catalogue",
  content: `
    SKU001 | Blue running shoes | £65 | In stock: 42
    SKU002 | White trainers | £55 | In stock: 18
    SKU003 | Black yoga mat | £30 | In stock: 5
  `,
});

// 4. Verify connected channels (configured in the dashboard)
const channels = await bimpe.agents.channels.list(agent.id);
console.log("Channels:", channels.map((c) => c.type));

console.log("Agent ready:", agent.id);
import os
from bimpeai import BimpeAI

client = BimpeAI(api_key=os.environ["BIMPEAI_API_KEY"])

# 1. Find workflow
page = client.workflows.list(scope="public", search="ecommerce")
workflow = page.data[0]

# 2. Create agent
agent = client.agents.create(
    name="Store assistant",
    description="Helps shoppers browse, check stock, place orders, and resolve post-purchase questions.",
    workflow_id=workflow.id,
    idempotency_key="create-store-agent-v1",
)

# 3. Add product catalogue
client.agents.knowledge_bases.create(agent.id, {
    "type": "text",
    "name": "Product catalogue",
    "content": (
        "SKU001 | Blue running shoes | £65 | In stock: 42\n"
        "SKU002 | White trainers | £55 | In stock: 18\n"
        "SKU003 | Black yoga mat | £30 | In stock: 5"
    ),
})

# 4. Verify connected channels (configured in the dashboard)
channels = client.agents.channels.list(agent.id)
print("Channels:", [c.type for c in channels])

print("Agent ready:", agent.id)

Deploy and go live

Go-live checklist

  • Store your API key in BIMPEAI_API_KEY (server-side only).
  • Confirm E-commerce platform API appears in integrations.list or is connected in the dashboard.
  • Verify WhatsApp is connected on the Deploy screen (agents.channels.list shows it enabled).
  • Verify Web Chat is connected on the Deploy screen (agents.channels.list shows it enabled).
  • Set Escalation Email under Settings → Agent if humans must take over.
  • Switch the agent to live with updateLiveStatus / update_live_status.
  • Monitor the Conversations screen (or stream via SDK) after launch.

After go-live

Use a stable idempotencyKey to prevent duplicate agents on redeploy. Monitor volume with conversations.list by channel.

Variations

  • Add a returns policy knowledge base entry so the agent can answer refund questions without escalation.
  • Connect a payment gateway on the Integrations screen of the Console dashboard to enable in-conversation checkout.
  • Scope the agent to a single product category by narrowing the catalogue content and adding a category constraint to the workflow's system_prompt.

On this page