qmai-cli-public 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +18 -1
  2. package/package.json +2 -1
  3. package/skills/qmai-delivery/SKILL.md +52 -0
  4. package/skills/qmai-delivery/references/qmai-delivery-order.md +23 -0
  5. package/skills/qmai-delivery/references/qmai-delivery-status.md +19 -0
  6. package/skills/qmai-finance/SKILL.md +53 -0
  7. package/skills/qmai-finance/references/qmai-finance-statement.md +22 -0
  8. package/skills/qmai-finance/references/qmai-finance-stats.md +22 -0
  9. package/skills/qmai-inventory/SKILL.md +72 -0
  10. package/skills/qmai-inventory/references/qmai-inventory-master.md +29 -0
  11. package/skills/qmai-inventory/references/qmai-inventory-sales.md +25 -0
  12. package/skills/qmai-inventory/references/qmai-inventory-stock.md +29 -0
  13. package/skills/qmai-marketing/SKILL.md +80 -0
  14. package/skills/qmai-marketing/references/qmai-marketing-card-pricing.md +29 -0
  15. package/skills/qmai-marketing/references/qmai-marketing-coupon.md +27 -0
  16. package/skills/qmai-member/SKILL.md +175 -0
  17. package/skills/qmai-member/references/qmai-member-asset.md +35 -0
  18. package/skills/qmai-member/references/qmai-member-profile-tag.md +51 -0
  19. package/skills/qmai-order/SKILL.md +64 -0
  20. package/skills/qmai-order/references/qmai-order-query.md +26 -0
  21. package/skills/qmai-order/references/qmai-order-write.md +21 -0
  22. package/skills/qmai-product/SKILL.md +183 -0
  23. package/skills/qmai-product/references/qmai-product-advanced.md +92 -0
  24. package/skills/qmai-product/references/qmai-product-batch.md +113 -0
  25. package/skills/qmai-product/references/qmai-product-category.md +67 -0
  26. package/skills/qmai-product/references/qmai-product-crud.md +126 -0
  27. package/skills/qmai-queue/SKILL.md +38 -0
  28. package/skills/qmai-queue/references/qmai-queue-read.md +21 -0
  29. package/skills/qmai-shared/SKILL.md +155 -0
  30. package/skills/qmai-shared/references/qmai-shared-auth.md +54 -0
  31. package/skills/qmai-shared/references/qmai-shared-config.md +69 -0
  32. package/skills/qmai-store/SKILL.md +90 -0
  33. package/skills/qmai-store/references/qmai-store-read.md +45 -0
  34. package/skills/qmai-store/references/qmai-store-write.md +44 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  企迈开放平台命令行工具,面向商品、门店组织、会员、营销、订单、财务、聚合配送、进销存和排队等业务场景,提供统一的命令行调用入口,并支持通过 npm 全局安装。
4
4
 
5
- 为什么选 qmai-cli? · 工具能力项 · 安装与快速开始 · 常用命令 · 认证与配置 · 安全与声明
5
+ 为什么选 qmai-cli? · 工具能力项 · 安装与快速开始 · Agent Skills · 常用命令 · 认证与配置 · 安全与声明
6
6
 
7
7
  ## 为什么选 qmai-cli?
8
8
 
@@ -80,6 +80,23 @@
80
80
  - 环境诊断
81
81
  - shell 自动补全
82
82
 
83
+ ### Agent Skills(AI 助手)
84
+
85
+ 本仓库在 `skills/` 下提供与业务域对应的 Agent Skills(如 `qmai-product`、`qmai-order` 等),便于在 Cursor、Codex 等支持 Agent Skills 的环境中复用 `qmai` 子命令与参数说明。安装 CLI 后,可用 [Skills CLI](https://github.com/vercel-labs/skills) 从本仓库拉取技能包:
86
+
87
+ ```bash
88
+ # 安装本仓库中的全部技能(需 Node.js 18+)
89
+ npx skills add feixiao629/qmai-cli-public
90
+
91
+ # 仅安装某一技能
92
+ npx skills add feixiao629/qmai-cli-public --skill qmai-product
93
+
94
+ # 使用完整 Git URL 亦可
95
+ npx skills add https://github.com/feixiao629/qmai-cli-public
96
+ ```
97
+
98
+ 全局安装到当前用户目录时可按需加 CLI 支持的参数(例如部分环境为 `-g`)。技能安装位置取决于所用工具(常见为项目或用户下的 `.cursor/skills/`、`.agents/skills/` 等),请以 Skills CLI 与编辑器文档为准。
99
+
83
100
  ## 安装与快速开始
84
101
 
85
102
  ### 环境要求
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qmai-cli-public",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "qmai-cli npm installer package",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -15,6 +15,7 @@
15
15
  "README.md",
16
16
  "LICENSE",
17
17
  "npm",
18
+ "skills",
18
19
  ".goreleaser.yml"
19
20
  ],
20
21
  "scripts": {
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: qmai-delivery
3
+ version: 1.0.0
4
+ description: "聚合配送:创建、取消、查询配送订单与同步配送状态"
5
+ metadata:
6
+ bins: [qmai]
7
+ help: "qmai delivery --help"
8
+ ---
9
+
10
+ > 前置条件: 请先阅读 ../qmai-shared/SKILL.md 了解认证和配置
11
+
12
+ ## 核心概念
13
+
14
+ - **order**: 创建配送单、取消配送单、查详情、查骑手位置、取消全部配送单
15
+ - **status**: 同步商家自配送状态
16
+ - **create-and-update**: 聚合接口,一次提交配送单创建和状态更新
17
+
18
+ ## 命令概览
19
+
20
+ ### 配送订单
21
+ ```bash
22
+ qmai delivery order create --from-json delivery-create.json --dry-run
23
+ qmai delivery order cancel --multi-mark S001 --order-source 1 --origin-order-no O20260407001 --dry-run
24
+ qmai delivery order detail --order-source 1 --origin-order-no O20260407001
25
+ qmai delivery order rider-location --order-source 1 --origin-order-no O20260407001
26
+ qmai delivery order cancel-all --order-source 1 --origin-order-no O20260407001 --dry-run
27
+ qmai delivery order create-and-update --from-json delivery-update.json --dry-run
28
+ ```
29
+
30
+ ### 状态同步
31
+ ```bash
32
+ qmai delivery status update --origin-order-no O20260407001 --order-status 5 --dry-run
33
+ ```
34
+
35
+ ## 开放平台 API 端点
36
+
37
+ | 操作 | 端点 |
38
+ | --- | --- |
39
+ | 创建配送订单 | POST /v3/delivery/createDeliveryOrder |
40
+ | 取消配送订单 | POST /v3/delivery/cancelDeliveryOrder |
41
+ | 查询配送单详情 | POST /v3/delivery/getDeliveryOrderInfo |
42
+ | 查询骑手当前位置 | POST /v3/delivery/getRiderLocation |
43
+ | 更新订单配送状态 | POST /v3/delivery/updateSelfOrderStatus |
44
+ | 取消全部配送单 | POST /v3/delivery/cancelAllDeliveryOrder |
45
+ | 创建配送单并更新配送状态 | POST /v3/delivery/updateDeliveryStatus |
46
+
47
+ ## 注意事项(Agent 必读)
48
+
49
+ - `create` 和 `create-and-update` 请求体很大,统一用 `--from-json`
50
+ - `cancel`、`cancel-all`、`status update` 都支持 `--dry-run`
51
+ - `create-and-update` 官方文档明确说明不能和 `create + updateSelfOrderStatus` 混用
52
+ - `order-source` 和 `order-status` 都是平台枚举值,传值前要先按企迈文档核实
@@ -0,0 +1,23 @@
1
+ # qmai-delivery 配送订单参考
2
+
3
+ ## 适用场景
4
+
5
+ - 新建聚合配送单
6
+ - 查询配送详情和骑手位置
7
+ - 取消单笔或全部配送单
8
+
9
+ ## 推荐命令
10
+
11
+ ```bash
12
+ qmai delivery order create --from-json delivery-create.json --dry-run
13
+ qmai delivery order detail --order-source 1 --origin-order-no O20260407001
14
+ qmai delivery order rider-location --order-source 1 --origin-order-no O20260407001
15
+ qmai delivery order cancel --multi-mark S001 --order-source 1 --origin-order-no O20260407001 --dry-run
16
+ qmai delivery order cancel-all --order-source 1 --origin-order-no O20260407001 --dry-run
17
+ ```
18
+
19
+ ## 排查建议
20
+
21
+ - 创建配送单前先保留原始 JSON,请求失败时便于比对字段缺失
22
+ - `detail` 和 `rider-location` 都依赖 `order-source + origin-order-no`
23
+ - 如果同一笔单存在主单/补发单/拆单,补 `--order-flag`
@@ -0,0 +1,19 @@
1
+ # qmai-delivery 状态同步参考
2
+
3
+ ## 适用场景
4
+
5
+ - 商家自配送状态回传
6
+ - 三方配送聚合接口简化对接
7
+
8
+ ## 推荐命令
9
+
10
+ ```bash
11
+ qmai delivery status update --origin-order-no O20260407001 --order-status 5 --dry-run
12
+ qmai delivery order create-and-update --from-json delivery-update.json --dry-run
13
+ ```
14
+
15
+ ## 排查建议
16
+
17
+ - `status update` 适用于商家自配送状态同步
18
+ - `create-and-update` 是独立聚合接口,不应与普通创建接口混合使用
19
+ - 当状态为取消或异常重发时,先确认企迈要求的状态推进顺序
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: qmai-finance
3
+ version: 1.0.0
4
+ description: "财务服务:分账明细、支付账单、营业统计、商品销售汇总"
5
+ metadata:
6
+ bins: [qmai]
7
+ help: "qmai finance --help"
8
+ ---
9
+
10
+ > 前置条件: 请先阅读 ../qmai-shared/SKILL.md 了解认证和配置
11
+
12
+ ## 核心概念
13
+
14
+ - **statement**: 分账明细、微信账单、支付宝账单、微信账单下载地址
15
+ - **stats**: 营业统计、订单渠道、结账方式、商品销售汇总
16
+
17
+ ## 命令概览
18
+
19
+ ### 对账与账单
20
+ ```bash
21
+ qmai finance statement split-flows --created-at-start "2026-04-01 00:00:00" --created-at-end "2026-04-07 23:59:59" --page 1 --page-size 20
22
+ qmai finance statement wechat-bills --bill-date 2026-04-07 --page 1 --page-size 20
23
+ qmai finance statement alipay-bills --bill-date 2026-04-07 --page 1 --page-size 20
24
+ qmai finance statement wechat-bill-url --bill-date 2026-04-07 --shop-code S001
25
+ ```
26
+
27
+ ### 统计与字典
28
+ ```bash
29
+ qmai finance stats business-summary --shop-code S001 --start-date 2026-04-01 --end-date 2026-04-07
30
+ qmai finance stats order-types
31
+ qmai finance stats settle-scenes
32
+ qmai finance stats item-turnover --shop-code S001 --start-date 2026-04-01 --page 1 --page-size 20
33
+ ```
34
+
35
+ ## 开放平台 API 端点
36
+
37
+ | 操作 | 端点 |
38
+ | --- | --- |
39
+ | 查询分账明细 | POST /v3/payCenter/split/orderFlow |
40
+ | 查询微信支付账单 | POST /v3/payCenter/custom/wechatBill |
41
+ | 查询支付宝支付账单 | POST /v3/payCenter/offlinePayments/pullAlipayBillData |
42
+ | 查询营业统计数据 | POST /v3/dataone/finance/summary/businessRecord |
43
+ | 查询订单渠道 | POST /v3/dataone/finance/detail/orderType |
44
+ | 查询订单结账方式 | POST /v3/dataone/finance/detail/settleScene |
45
+ | 查询微信支付账单URL | POST /v3/pay/getWechatMerchantBillUrl |
46
+ | 查询门店商品销售汇总 | POST /v3/dataone/item/store/turnover |
47
+
48
+ ## 注意事项(Agent 必读)
49
+
50
+ - `alipay-bills` 的官方文档没有给出明确业务字段明细,CLI 先保留原始记录列;需要完整结构时优先用 `--format json`
51
+ - `split-flows`、`wechat-bills`、`business-summary`、`item-turnover` 当前都是显式分页,不会自动拉全量
52
+ - `item-turnover` 的 `page-size` 官方最大支持 200
53
+ - `7.2 交易支付` 和 `7.3 门店账户` 在官方文档仍标记待上线,当前只保留在覆盖矩阵,不进入正式命令面
@@ -0,0 +1,22 @@
1
+ # qmai-finance 对账参考
2
+
3
+ ## 适用场景
4
+
5
+ - 查询分账明细
6
+ - 查询微信或支付宝支付账单
7
+ - 获取微信账单下载地址
8
+
9
+ ## 推荐命令
10
+
11
+ ```bash
12
+ qmai finance statement split-flows --created-at-start "2026-04-01 00:00:00" --created-at-end "2026-04-07 23:59:59" --page 1 --page-size 20
13
+ qmai finance statement wechat-bills --bill-date 2026-04-07 --page 1 --page-size 20
14
+ qmai finance statement alipay-bills --bill-date 2026-04-07 --page 1 --page-size 20
15
+ qmai finance statement wechat-bill-url --bill-date 2026-04-07 --shop-code S001
16
+ ```
17
+
18
+ ## 排查建议
19
+
20
+ - 对账时间格式要严格按接口要求填写,`split-flows` 用完整时间,账单接口用日期
21
+ - 微信账单查询支持多门店编码列表;需要跨店汇总时优先用 `--shop-codes`
22
+ - 支付宝账单字段文档不完整,默认表格只回显原始记录
@@ -0,0 +1,22 @@
1
+ # qmai-finance 统计参考
2
+
3
+ ## 适用场景
4
+
5
+ - 查询单店营业统计
6
+ - 查询订单渠道和结账方式字典
7
+ - 查询门店商品销售汇总
8
+
9
+ ## 推荐命令
10
+
11
+ ```bash
12
+ qmai finance stats business-summary --shop-code S001 --start-date 2026-04-01 --end-date 2026-04-07
13
+ qmai finance stats order-types
14
+ qmai finance stats settle-scenes
15
+ qmai finance stats item-turnover --shop-code S001 --start-date 2026-04-01 --page 1 --page-size 20
16
+ ```
17
+
18
+ ## 排查建议
19
+
20
+ - `business-summary` 必须带 `shop-code` 和日期范围
21
+ - `item-turnover` 需要 `shop-code` 或 `shop-id` 二选一
22
+ - 若要保留完整财务字段,优先用 `--format json`
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: qmai-inventory
3
+ version: 1.0.0
4
+ description: "进销存:订货、调拨、退货、入出库与库存查询"
5
+ metadata:
6
+ bins: [qmai]
7
+ help: "qmai inventory --help"
8
+ ---
9
+
10
+ > 前置条件: 请先阅读 ../qmai-shared/SKILL.md 了解认证和配置
11
+
12
+ ## 核心概念
13
+
14
+ - **sales**: 报货单、订货单、调拨单、退货单
15
+ - **stock**: 入库单、出库单、门店库存台账、实时库存
16
+ - **master**: 盘点调整、物品、分类、单位、供应商、品项下发
17
+
18
+ ## 命令概览
19
+
20
+ ### 销售管理
21
+ ```bash
22
+ qmai inventory sales declare-receive --from-json declare-receive.json --dry-run
23
+ qmai inventory sales declare-detail --declare-no BH20260407001
24
+ qmai inventory sales require-update --from-json require-update.json --dry-run
25
+ qmai inventory sales require-deliver --from-json require-deliver.json --dry-run
26
+ qmai inventory sales return-cancel --from-json return-cancel.json --dry-run
27
+ qmai inventory sales return-examine --from-json return-examine.json --dry-run
28
+ qmai inventory sales return-receipt --from-json return-receipt.json --dry-run
29
+ qmai inventory sales delivery-arrive --from-json delivery-arrive.json --dry-run
30
+ qmai inventory sales require-list --page 1 --page-size 10
31
+ qmai inventory sales require-create --from-json require-create.json --dry-run
32
+ qmai inventory sales require-detail-update --from-json require-detail-update.json --dry-run
33
+ qmai inventory sales transfer-list --page 1 --page-size 10
34
+ qmai inventory sales transfer-detail --transfer-no DB20260407001
35
+ qmai inventory sales return-list --page 1 --page-size 10
36
+ ```
37
+
38
+ ### 库存管理
39
+ ```bash
40
+ qmai inventory stock inbound-create --from-json inbound-create.json --dry-run
41
+ qmai inventory stock inbound-list --created-start-at "2026-04-01 00:00:00" --created-end-at "2026-04-07 23:59:59"
42
+ qmai inventory stock inbound-update --from-json inbound-update.json --dry-run
43
+ qmai inventory stock inbound-finish --from-json inbound-finish.json --dry-run
44
+ qmai inventory stock outbound-create --from-json outbound-create.json --dry-run
45
+ qmai inventory stock outbound-list --created-start-at "2026-04-01 00:00:00" --created-end-at "2026-04-07 23:59:59"
46
+ qmai inventory stock outbound-update --from-json outbound-update.json --dry-run
47
+ qmai inventory stock occupy --from-json stock-occupy.json --dry-run
48
+ qmai inventory stock release --from-json stock-release.json --dry-run
49
+ qmai inventory stock store-ledger --start-date 2026-04-01 --end-date 2026-04-07 --page 1 --page-size 10
50
+ qmai inventory stock realtime-list --warehouse-nos CK001 --page 1 --page-size 20
51
+ ```
52
+
53
+ ### 基础资料管理
54
+ ```bash
55
+ qmai inventory master inventory-adjust --from-json inventory-adjust.json --dry-run
56
+ qmai inventory master transfer-audit --from-json transfer-audit.json --dry-run
57
+ qmai inventory master product-create --from-json product-create.json --dry-run
58
+ qmai inventory master category-create --from-json category-create.json --dry-run
59
+ qmai inventory master unit-create --from-json unit-create.json --dry-run
60
+ qmai inventory master product-update --from-json product-update.json --dry-run
61
+ qmai inventory master supplier-create --from-json supplier-create.json --dry-run
62
+ qmai inventory master product-distribute --from-json product-distribute.json --dry-run
63
+ qmai inventory master supplier-update --from-json supplier-update.json --dry-run
64
+ qmai inventory master machining-card-batch-create --from-json machining-card-batch-create.json --dry-run
65
+ ```
66
+
67
+ ## 注意事项(Agent 必读)
68
+
69
+ - `declare-receive`、`require-update`、`require-deliver`、`return-cancel`、`return-examine`、`return-receipt`、`delivery-arrive`、`require-create` 以及库存/基础资料写接口都统一使用 `--from-json`
70
+ - 订货、调拨、退货、库存日志目前仍是显式分页,不会自动拉全量
71
+ - 半成品成本卡批量创建已经进入正式命令面,更新/套件/转化卡等待上线接口仍未暴露
72
+ - 文档中部分历史 ID 已失效或漂移,新增接口前应先重新核实文档地址和更新时间
@@ -0,0 +1,29 @@
1
+ # qmai-inventory 基础资料参考
2
+
3
+ ## 适用场景
4
+
5
+ - 创建盘点调整单
6
+ - 审核调拨申请单
7
+ - 新增或修改物品、分类、单位
8
+ - 新增或修改供应商
9
+ - 批量下发品项
10
+
11
+ ## 推荐命令
12
+
13
+ ```bash
14
+ qmai inventory master inventory-adjust --from-json inventory-adjust.json --dry-run
15
+ qmai inventory master transfer-audit --from-json transfer-audit.json --dry-run
16
+ qmai inventory master product-create --from-json product-create.json --dry-run
17
+ qmai inventory master category-create --from-json category-create.json --dry-run
18
+ qmai inventory master unit-create --from-json unit-create.json --dry-run
19
+ qmai inventory master supplier-create --from-json supplier-create.json --dry-run
20
+ qmai inventory master product-distribute --from-json product-distribute.json --dry-run
21
+ qmai inventory master machining-card-batch-create --from-json machining-card-batch-create.json --dry-run
22
+ ```
23
+
24
+ ## 排查建议
25
+
26
+ - 物品和供应商接口字段很多,优先维护可复用 JSON 模板
27
+ - `unit-create` 返回的是 `unitCode`,不是业务 id
28
+ - `changeProduct` 与 `update` 字段结构相近,但新增与修改的必填项不同
29
+ - 半成品成本卡的 `list` 为批量结构,单次最多内容较多时优先先跑 `--dry-run`
@@ -0,0 +1,25 @@
1
+ # qmai-inventory 销售管理参考
2
+
3
+ ## 适用场景
4
+
5
+ - 报货单接单或拒单
6
+ - 查询订货单、调拨单、退货单
7
+ - 创建、完成、发货订货单
8
+
9
+ ## 推荐命令
10
+
11
+ ```bash
12
+ qmai inventory sales declare-detail --declare-no BH20260407001
13
+ qmai inventory sales require-list --page 1 --page-size 10
14
+ qmai inventory sales transfer-list --page 1 --page-size 10
15
+ qmai inventory sales return-list --page 1 --page-size 10
16
+ qmai inventory sales return-examine --from-json return-examine.json --dry-run
17
+ qmai inventory sales return-receipt --from-json return-receipt.json --dry-run
18
+ qmai inventory sales require-create --from-json require-create.json --dry-run
19
+ ```
20
+
21
+ ## 排查建议
22
+
23
+ - 高副作用动作优先保留 JSON 请求体,便于审计和重试
24
+ - `require-list`、`return-list`、`transfer-list` 默认只查单页
25
+ - 调拨详情需使用 `transfer-no`,不是内部 id
@@ -0,0 +1,29 @@
1
+ # qmai-inventory 库存管理参考
2
+
3
+ ## 适用场景
4
+
5
+ - 批量查询入库单和出库单
6
+ - 查询门店库存台账
7
+ - 查询仓库实时库存
8
+
9
+ ## 推荐命令
10
+
11
+ ```bash
12
+ qmai inventory stock inbound-create --from-json inbound-create.json --dry-run
13
+ qmai inventory stock inbound-list --created-start-at "2026-04-01 00:00:00" --created-end-at "2026-04-07 23:59:59"
14
+ qmai inventory stock inbound-update --from-json inbound-update.json --dry-run
15
+ qmai inventory stock inbound-finish --from-json inbound-finish.json --dry-run
16
+ qmai inventory stock outbound-create --from-json outbound-create.json --dry-run
17
+ qmai inventory stock outbound-list --created-start-at "2026-04-01 00:00:00" --created-end-at "2026-04-07 23:59:59"
18
+ qmai inventory stock outbound-update --from-json outbound-update.json --dry-run
19
+ qmai inventory stock occupy --from-json stock-occupy.json --dry-run
20
+ qmai inventory stock release --from-json stock-release.json --dry-run
21
+ qmai inventory stock store-ledger --start-date 2026-04-01 --end-date 2026-04-07 --page 1 --page-size 10
22
+ qmai inventory stock realtime-list --warehouse-nos CK001 --page 1 --page-size 20
23
+ ```
24
+
25
+ ## 排查建议
26
+
27
+ - 入库单和出库单查询都要求创建时间范围
28
+ - `realtime-list` 的 `page-size` 受官方接口限制,最大 100
29
+ - 如果库存类数据需要完整字段,优先加 `--format json`
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: qmai-marketing
3
+ version: 1.1.0
4
+ description: "营销服务:券查询与发券、活动查询与撤销、礼品卡查询与写入、结算页算价"
5
+ metadata:
6
+ bins: [qmai]
7
+ help: "qmai marketing --help"
8
+ ---
9
+
10
+ > 前置条件: 请先阅读 ../qmai-shared/SKILL.md 了解认证和配置
11
+
12
+ ## 核心概念
13
+
14
+ - **coupon**: 券状态、券详情、券模板、不记名券、筛券、发券和模板启用
15
+ - **campaign**: 发券活动、撤销发券、兑换码下发/作废、兑换码状态、任务活动参与记录和任务领取
16
+ - **gift-card**: 卡信息、消费明细、卡模板、会员卡列表,以及单卡/批量余额扣减、冲正和发放
17
+ - **pricing**: 门店促销活动查询与结算页算价
18
+
19
+ ## 命令概览
20
+
21
+ ### 券管理
22
+ ```bash
23
+ qmai marketing coupon status --id CPN001
24
+ qmai marketing coupon detail --user-coupon-code CPN001
25
+ qmai marketing coupon template --id 1001
26
+ qmai marketing coupon template-enable --id 1001 --dry-run
27
+ qmai marketing coupon template-batch --ids 1001,1002
28
+ qmai marketing coupon anonymous --code ANON001
29
+ qmai marketing coupon template-by-third-code --seller-type 2 --third-biz-code EXT001
30
+ qmai marketing coupon choose --from-json choose-coupon.json
31
+ qmai marketing coupon grant-activity --from-json grant-activity.json --dry-run
32
+ qmai marketing coupon grant-activity-async --from-json grant-activity-async.json --dry-run
33
+ qmai marketing coupon grant-template --from-json grant-template.json --dry-run
34
+ ```
35
+
36
+ ### 活动管理
37
+ ```bash
38
+ qmai marketing campaign list --channel-id 1 --page 1 --page-size 20
39
+ qmai marketing campaign revoke-grant --from-json revoke-grant.json --dry-run
40
+ qmai marketing campaign exchange-dispatch --from-json exchange-dispatch.json --dry-run
41
+ qmai marketing campaign exchange-disable --from-json exchange-disable.json --dry-run
42
+ qmai marketing campaign exchange-status --code EXCHANGE001
43
+ qmai marketing campaign task-records --activity-ids 1001,1002 --customer-id 2001
44
+ qmai marketing campaign task-claim --from-json task-claim.json --dry-run
45
+ qmai marketing campaign recycle-coupons --from-json recycle-coupons.json --dry-run
46
+ ```
47
+
48
+ ### 卡管理
49
+ ```bash
50
+ qmai marketing gift-card info --card-no CARD001 --take-card-template 1
51
+ qmai marketing gift-card flow --card-no CARD001 --page 1 --page-size 20
52
+ qmai marketing gift-card template --id 3001
53
+ qmai marketing gift-card template-batch --ids 3001,3002
54
+ qmai marketing gift-card list --customer-id 2001 --shop-code S001
55
+ qmai marketing gift-card consume --from-json gift-card-consume.json --dry-run
56
+ qmai marketing gift-card consume-batch --from-json gift-card-consume-batch.json --dry-run
57
+ qmai marketing gift-card reverse --from-json gift-card-reverse.json --dry-run
58
+ qmai marketing gift-card reverse-batch --from-json gift-card-reverse-batch.json --dry-run
59
+ qmai marketing gift-card part-reverse --from-json gift-card-part-reverse.json --dry-run
60
+ qmai marketing gift-card issue --from-json gift-card-issue.json --dry-run
61
+ qmai marketing gift-card report-loss --from-json gift-card-report-loss.json --dry-run
62
+ qmai marketing gift-card relieve-loss --from-json gift-card-relieve-loss.json --dry-run
63
+ qmai marketing gift-card recycle --from-json gift-card-recycle.json --dry-run
64
+ qmai marketing gift-card exchange --from-json gift-card-exchange.json --dry-run
65
+ qmai marketing gift-card grant-template --from-json gift-card-grant-template.json --dry-run
66
+ ```
67
+
68
+ ### 营销计算
69
+ ```bash
70
+ qmai marketing pricing activities --from-json promotion-activities.json
71
+ qmai marketing pricing confirm --from-json confirm.json
72
+ ```
73
+
74
+ ## 注意事项(Agent 必读)
75
+
76
+ - `coupon choose`、发券命令和 `pricing activities/confirm` 入参复杂,统一用 `--from-json`
77
+ - `pricing confirm` 目前默认表格只展示价格摘要,若要看完整算价结果请加 `--format json`
78
+ - 活动实时发券、异步发券、模板发券、模板启用、撤销发券、兑换码下发/作废、任务领取、回收券,以及礼品卡扣减/冲正/挂失/回收/兑换/发放已经进入正式命令面
79
+ - 礼品卡写接口同样统一用 `--from-json`,建议先 `--dry-run`;其中 `part-reverse` 只能冲正统一消费接口,不能和全额冲正混用
80
+ - `campaign list`、`gift-card flow` 是显式分页,不会自动拉全量
@@ -0,0 +1,29 @@
1
+ # qmai-marketing card/pricing 参考
2
+
3
+ ```bash
4
+ qmai marketing campaign list --channel-id 1
5
+ qmai marketing campaign task-records --activity-ids 1001,1002 --customer-id 2001
6
+ qmai marketing gift-card info --card-no CARD001
7
+ qmai marketing gift-card flow --card-no CARD001 --page 1 --page-size 20
8
+ qmai marketing gift-card list --customer-id 2001 --shop-code S001
9
+ qmai marketing gift-card consume --from-json gift-card-consume.json --dry-run
10
+ qmai marketing gift-card consume-batch --from-json gift-card-consume-batch.json --dry-run
11
+ qmai marketing gift-card reverse --from-json gift-card-reverse.json --dry-run
12
+ qmai marketing gift-card reverse-batch --from-json gift-card-reverse-batch.json --dry-run
13
+ qmai marketing gift-card part-reverse --from-json gift-card-part-reverse.json --dry-run
14
+ qmai marketing gift-card issue --from-json gift-card-issue.json --dry-run
15
+ qmai marketing gift-card report-loss --from-json gift-card-report-loss.json --dry-run
16
+ qmai marketing gift-card relieve-loss --from-json gift-card-relieve-loss.json --dry-run
17
+ qmai marketing gift-card recycle --from-json gift-card-recycle.json --dry-run
18
+ qmai marketing gift-card exchange --from-json gift-card-exchange.json --dry-run
19
+ qmai marketing gift-card grant-template --from-json gift-card-grant-template.json --dry-run
20
+ qmai marketing pricing activities --from-json promotion-activities.json
21
+ qmai marketing pricing confirm --from-json confirm.json --format json
22
+ ```
23
+
24
+ ## 说明
25
+
26
+ - `pricing` 相关接口字段很多,建议先保留一份请求 JSON 模板
27
+ - `pricing confirm` 用表格模式看摘要,用 `json` 看完整算价细节
28
+ - 礼品卡冲正分为全额冲正和部分冲正两种,部分冲正要额外提供 `subBizId`
29
+ - 礼品卡挂失/取消挂失一次最多处理数量以开放平台文档为准,CLI 不放宽上限
@@ -0,0 +1,27 @@
1
+ # qmai-marketing coupon 参考
2
+
3
+ ```bash
4
+ qmai marketing coupon status --id CPN001
5
+ qmai marketing coupon detail --user-coupon-code CPN001
6
+ qmai marketing coupon template --id 1001
7
+ qmai marketing coupon template-enable --id 1001 --dry-run
8
+ qmai marketing coupon template-batch --ids 1001,1002
9
+ qmai marketing coupon anonymous --code ANON001
10
+ qmai marketing coupon template-by-third-code --seller-type 2 --third-biz-code EXT001
11
+ qmai marketing coupon choose --from-json choose-coupon.json
12
+ qmai marketing coupon grant-activity --from-json grant-activity.json --dry-run
13
+ qmai marketing coupon grant-activity-async --from-json grant-activity-async.json --dry-run
14
+ qmai marketing coupon grant-template --from-json grant-template.json --dry-run
15
+ qmai marketing campaign revoke-grant --from-json revoke-grant.json --dry-run
16
+ qmai marketing campaign exchange-dispatch --from-json exchange-dispatch.json --dry-run
17
+ qmai marketing campaign exchange-disable --from-json exchange-disable.json --dry-run
18
+ qmai marketing campaign task-claim --from-json task-claim.json --dry-run
19
+ qmai marketing campaign recycle-coupons --from-json recycle-coupons.json --dry-run
20
+ ```
21
+
22
+ ## 说明
23
+
24
+ - `choose-coupon.json` 直接按企迈文档请求结构组织
25
+ - 若只是查券模板,优先用 `template` / `template-batch`
26
+ - 发券与撤销发券都建议先 `--dry-run`,确认 `activityId`、`channelId`、`orderNo` 和会员标识结构
27
+ - 兑换码下发与作废一次最多处理的数量要按企迈文档约束,CLI 不额外放宽