跳到主要内容

配方

组合多条命令完成常见任务的即拷即用片段。均依赖默认 JSON 输出与 --jq 过滤。

导出所有商品 ID

shell
shoplazza products list --jq '.data.products[].id'

链式:逐个取商品详情

stdout 可安全管道,因此可把 ID 喂给下一条命令:

shell
shoplazza products list --jq '.data.products[].id' \
| xargs -I {} shoplazza products get --id {}

统计未处理订单

shell
shoplazza orders +count --jq '.data.count'

创建批量折扣前先预览

shell
shoplazza discounts +rebate --target order --tiers "200:20,500:50,1000:120" --dry-run

建客户并捕获新 ID

shell
shoplazza customers +create --email [email protected] --jq '.data.id'

用表格视图快速浏览搜索结果

shell
shoplazza orders +search --fields "id,status,total_price" --format table

在 CI 中非交互运行

shell
export SHOPLAZZA_UAT=your-token
export SHOPLAZZA_STORE=my-store.myshoplazza.com
shoplazza products +search --keyword "shirt" --jq '.data.products | length'

参见