Android Order Skill (点餐)
This skill uses the paired Android device (OpenClaw SMS Demo app with order capability) to manage an in-app menu and cart: get menu, add/remove items, view cart, submit order. Inspired by EdgeOSToolService (MEOW PAY); implementation is in-memory on the device (demo, no real POS backend).
When to use this skill
- - User asks to order food/drinks, view menu, add to cart, or submit an order on the paired Android device: use the
order.* commands below.
Commands overview
| Command | Description |
|---|
| INLINECODE2 | Return menu (id, name, priceCents, price). |
| INLINECODE3 |
Return current cart with quantities and subtotals. |
|
order.addGoods | Add by
id or
name (and optional
quantity). |
|
order.removeGoods | Remove by
id or
name (and optional
quantity). |
|
order.clearGoods | Clear cart. |
|
order.submitOrder | Submit cart as order; returns summary (demo only). |
|
order.batchAddGoods | Add multiple items:
list =
[{"id":"1","quantity":2},...]. |
How to call the underlying commands
Invoke via the OpenClaw gateway node invoke API:
- - command: one of
order.getGoods, order.getSelectedGoods, order.addGoods, order.removeGoods, order.clearGoods, order.submitOrder, order.batchAddGoods. - paramsJSON: JSON object string, or
null for no-param commands.
order.getGoods
- -
command: INLINECODE26 - INLINECODE27 :
null or INLINECODE29 - Success: payload is a JSON array of
{ "id", "name", "priceCents", "price" }.
order.getSelectedGoods
- -
command: INLINECODE32 - INLINECODE33 :
null or INLINECODE35 - Success: payload is a JSON array of cart items with
id, name, quantity, priceCents, subtotalCents.
order.addGoods
- -
command: INLINECODE42 - INLINECODE43 : provide id or name (or both); optional quantity (default 1).
CODEBLOCK0
or
CODEBLOCK1
- - Success: payload includes
success: true and message (e.g. "已添加 拿铁 x1").
order.removeGoods
- -
command: INLINECODE47 - INLINECODE48 : same shape as addGoods (
id or name, optional quantity).
order.clearGoods
- -
command: INLINECODE53 - INLINECODE54 :
null or "{}".
order.submitOrder
- -
command: INLINECODE58 - INLINECODE59 :
null or "{}". - Success: payload includes
success, message, totalCents, items. Cart is cleared after submit. - Error:
CART_EMPTY if cart is empty.
order.batchAddGoods
- -
command: INLINECODE68 - INLINECODE69 : INLINECODE70
- Success: payload includes
success and message (e.g. "已批量添加 2 项").
Error handling
- - GOODSNOTFOUND: No menu item matched the given id or name. Suggest calling
order.getGoods to see the menu. - NOTINCART: Item not in cart when removing.
- CARTEMPTY: Cannot submit when cart is empty.
- INVALIDREQUEST: Missing or malformed params (e.g. empty
list for batchAddGoods).
Demo menu (default on device)
The in-app menu includes items such as: 拿铁, 美式, 卡布奇诺, 三明治, 沙拉, 蛋糕 (with ids "1"–"6"). Use order.getGoods to get the current list and prices.
Safety notes
- - This is a demo flow: submit order does not charge or send to a real POS. Do not expose as real payment.
- Prefer confirming with the user before submitting an order (e.g. read back cart and total).
Android Order Skill (点餐)
该技能利用配对的安卓设备(具备点餐功能的OpenClaw SMS Demo应用)管理应用内菜单和购物车:获取菜单、添加/移除商品、查看购物车、提交订单。灵感来源于EdgeOSToolService(MEOW PAY);实现方式为设备内存存储(演示用途,无真实POS后端)。
何时使用此技能
- - 当用户要求在配对的安卓设备上点餐/饮品、查看菜单、添加到购物车或提交订单时:使用下方order.*命令。
命令概览
| 命令 | 描述 |
|---|
| order.getGoods | 返回菜单(id、名称、价格分、价格)。 |
| order.getSelectedGoods |
返回当前购物车,包含数量和小计。 |
| order.addGoods | 通过id或name添加(可选quantity)。 |
| order.removeGoods | 通过id或name移除(可选quantity)。 |
| order.clearGoods | 清空购物车。 |
| order.submitOrder | 将购物车作为订单提交;返回摘要(仅演示)。 |
| order.batchAddGoods | 批量添加多个商品:list = [{id:1,quantity:2},...]。 |
如何调用底层命令
通过OpenClaw网关节点调用API进行调用:
- - command:order.getGoods、order.getSelectedGoods、order.addGoods、order.removeGoods、order.clearGoods、order.submitOrder、order.batchAddGoods之一。
- paramsJSON:JSON对象字符串,无参数命令为null。
order.getGoods
- - command:order.getGoods
- paramsJSON:null或{}
- 成功:payload为{ id, name, priceCents, price }的JSON数组。
order.getSelectedGoods
- - command:order.getSelectedGoods
- paramsJSON:null或{}
- 成功:payload为购物车商品JSON数组,包含id、name、quantity、priceCents、subtotalCents。
order.addGoods
- - command:order.addGoods
- paramsJSON:提供id或name(或两者);可选quantity(默认1)。
json
{ id: 1, quantity: 2 }
或
json
{ name: 拿铁, quantity: 1 }
- - 成功:payload包含success: true和message(例如已添加 拿铁 x1)。
order.removeGoods
- - command:order.removeGoods
- paramsJSON:与addGoods格式相同(id或name,可选quantity)。
order.clearGoods
- - command:order.clearGoods
- paramsJSON:null或{}。
order.submitOrder
- - command:order.submitOrder
- paramsJSON:null或{}。
- 成功:payload包含success、message、totalCents、items。提交后购物车被清空。
- 错误:购物车为空时返回CART_EMPTY。
order.batchAddGoods
- - command:order.batchAddGoods
- paramsJSON:{ list: [{\id\:\1\,\quantity\:2},{\id\:\2\,\quantity\:1}] }
- 成功:payload包含success和message(例如已批量添加 2 项)。
错误处理
- - GOODSNOTFOUND:未找到匹配给定id或名称的菜单项。建议调用order.getGoods查看菜单。
- NOTINCART:移除时商品不在购物车中。
- CARTEMPTY:购物车为空时无法提交。
- INVALIDREQUEST:参数缺失或格式错误(例如batchAddGoods的list为空)。
演示菜单(设备默认)
应用内菜单包含以下商品:拿铁、美式、卡布奇诺、三明治、沙拉、蛋糕(id为1–6)。使用order.getGoods获取当前列表和价格。
安全注意事项
- - 此为演示流程:提交订单不会产生实际扣款或发送至真实POS。请勿将其暴露为真实支付功能。
- 建议在提交订单前与用户确认(例如复述购物车内容和总价)。