For AI agents: fetch the complete documentation index at /llms.txt, the full documentation corpus at /llms-full.txt, the agent skill at /skill.md, or this page as Markdown at /zh-tw/docs/mobile/commerce.md (or send Accept: text/markdown).
移動端電商
為工作區管理商店商品與訂單。
商品
/api/mobile/commerce/products 上的 GET 與 POST 用於列出和建立商品 —— 僅所有者與管理員。新商品以草稿起步;價格以字串錄入、以分為單位按兩位小數精度儲存,庫存跟蹤可選。商品永不真正刪除:archived 即移除狀態,PATCH 同時更新欄位與狀態 —— draft、active、archived。
訂單隻能向前流轉
GET /api/mobile/commerce/orders 列出訂單;訂單由商店結賬建立,應用本身永不建立。PATCH 只允許狀態向前推進 —— pending 到 paid 到 fulfilled —— 付款前可轉 cancelled,付款後可轉 refunded。取消會在同一事務中回補被跟蹤的庫存;非法流轉是靜默的空操作,而不是需要使用者去消除的錯誤。
驗證與排障
通過公開結賬完成一筆銷售,在移動端推進訂單,並確認取消 pending 訂單時庫存回補。低於 admin 的成員完全無法進入該介面 —— 驗證他們看到的是“不可用”而不是空白。