Talk2Stock
OpenClaw plugin for Talk2Stock inventory and order management
Install
openclaw plugins install clawhub:@banyawat/talk2stock-openclaw-pluginTalk2Stock OpenClaw Plugin
OpenClaw plugin that lets AI agents manage your Talk2Stock inventory and orders through the Talk2Stock REST API.
Workflow: draft-first, human approval required
Talk2Stock is designed for merchant-in-the-loop order management. The agent can prepare orders and supply orders, but it should never finalize them without explicit merchant approval.
- Create a draft —
create_order_draft/create_order_draft_by_name/create_supply_order_draft - Show the draft and stop — the agent presents the draft number, items, customer/supplier, and total.
- Wait for explicit approval — the merchant must type something like "confirm" or "approve" in the chat.
- Confirm with approval flag — the agent calls the confirm/ship/receive tool with
merchant_approved=true.
State-changing tools (confirm_order_draft, confirm_supply_order_draft, ship_order, ship_order_by_name, receive_supply_order, mark_in_transit_supply_order) each require a merchant_approved parameter. If the merchant has not explicitly approved, the tool returns a preview and asks for confirmation instead of executing.
Build
cd extensions/talk2stock-openclaw
pnpm install
pnpm build
Install from ClawHub
openclaw install clawhub:@banyawat/talk2stock-openclaw-plugin
Configure
After installation, set the API base URL and your Talk2Stock API key:
openclaw config set plugins.entries.talk2stock.config.apiBaseUrl "https://api.talk2stock.co"
openclaw config set plugins.entries.talk2stock.config.apiKey "your-api-key-here"
Then restart your OpenClaw gateway so the plugin picks up the new config.
Local Development Install
For in-repo bundled plugin work, OpenClaw discovers source-checkout plugin packages from the extensions/* workspace. Link or copy this directory to your OpenClaw extensions path:
mkdir -p ~/.openclaw/extensions
ln -s "$(pwd)" ~/.openclaw/extensions/talk2stock
Then enable it and set your API key in ~/.openclaw/openclaw.json:
{
"plugins": {
"enabled": true,
"entries": {
"talk2stock": {
"enabled": true,
"config": {
"apiBaseUrl": "https://api.talk2stock.co",
"apiKey": "tsk_your_api_key_here"
}
}
}
}
}
Getting an API Key
- Open the Talk2Stock webapp
- Go to Settings > API Keys
- Generate a new key
- Copy the key (starts with
tsk_) into the plugin config
Naming Strategy
Important: The plugin parameter names are intentionally generic/worldwide-friendly, while the underlying API field names remain Thailand-specific for backward compatibility.
Example: the plugin uses
domestic_shipping(generic), but the API receivesthai_shipping(Thailand-specific). When we eventually migrate the API to worldwide-friendly names, only the mapping layer inclient.tsneeds to change — the plugin tool schemas stay the same.Always follow this pattern: plugin parameters = generic names, API payload = legacy names with mapping in the client layer.
Tools
The plugin registers the following tools for OpenClaw agents. Order creation is draft-first: the agent creates a draft, the merchant reviews it, and then the agent confirms it. No order is created or stock moved until confirmation.
Inventory
talk2stock_list_inventory— List products and stock levelstalk2stock_search_inventory— Search products by name/SKUtalk2stock_get_product— Get product details by SKUtalk2stock_list_stock_batches— View stock batch historytalk2stock_get_inventory_movements— View inventory movementstalk2stock_create_product— Create a new product/SKU
Sales orders (draft-first)
talk2stock_create_order_draft— Create a draft sales order from SKUstalk2stock_create_order_draft_by_name— Create a draft sales order from product namestalk2stock_calculate_order— Preview order totals before saving (SKUs)talk2stock_calculate_order_by_name— Preview an order from product namestalk2stock_get_order_draft— Get a pending sales order drafttalk2stock_update_order_draft— Update a pending sales order drafttalk2stock_confirm_order_draft— Confirm a draft and convert it to a real ordertalk2stock_discard_order_draft— Discard a pending sales order drafttalk2stock_list_orders— List recent orderstalk2stock_list_order_drafts— List pending sales order draftstalk2stock_get_order— Get order details by order numbertalk2stock_ship_order— Ship an order with a tracking numbertalk2stock_ship_order_by_name— Ship an order by customer name and tracking number
Supply orders (draft-first)
talk2stock_create_supply_order_draft— Create a draft supply ordertalk2stock_calculate_supply_order— Preview supply order before savingtalk2stock_get_supply_order_draft— Get a pending supply-order drafttalk2stock_update_supply_order_draft— Update a pending supply-order drafttalk2stock_confirm_supply_order_draft— Confirm a draft and convert it to a real supply ordertalk2stock_discard_supply_order_draft— Discard a pending supply-order drafttalk2stock_list_supply_orders— List supply orderstalk2stock_list_supply_order_drafts— List pending supply-order draftstalk2stock_get_supply_order— Get supply order detailstalk2stock_mark_in_transit_supply_order— Mark supply order as in-transittalk2stock_receive_supply_order— Receive supply order into inventory
Customers & reports
talk2stock_create_customer— Create a customertalk2stock_list_customers— List customerstalk2stock_get_customer— Get customer detailstalk2stock_track_shipment— Track a shipmenttalk2stock_get_shipment— Get shipment detailstalk2stock_list_shipments— List shipmentstalk2stock_get_report— Get a date-range reporttalk2stock_get_daily_report— Get today's sales summarytalk2stock_list_ad_campaigns— List ad campaignstalk2stock_create_ad_campaign— Create an ad campaigntalk2stock_update_ad_spend— Update actual spend for an ad campaigntalk2stock_get_help— List available tools
Example Usage
After installation, ask OpenClaw:
"How much stock do I have for SKU LW0001?"
Order creation (two-turn draft → confirm):
"Create a draft order for Somchai, phone 081-234-5678, 2x LW0001 at 1500 each." "Confirm"
Editing a draft:
"Update Somchai's draft to 3x LW0001."
Shipping after explicit approval:
"Ship Somchai's order with tracking SP1234567890." "Confirm ship"
Supply order creation (two-turn draft → confirm):
"Create a draft supply order from Supplier A, PO-123, 50x LW0001 at 800 each." "Confirm"
License
MIT
