/shoplazza:shoplazza-customersfrom Shoplazza
Manages customer profiles and shipping addresses on a shoplazza store via CLI. Create, search, update customers and manage their addresses.
Ships in Shoplazza. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
CRITICAL — before anything else, use Read on ../shoplazza-common/SKILL.md.
It owns every cross-cutting mechanic: the three access tiers, the output envelope (.data),
--dry-run, --jq (incl. "don't pass -r"), --fields, schema, api rest, auth / profiles,
and the safety protocol. This file covers only the customers domain and never repeats them.
The customers module manages customer (buyer) profiles and their shipping addresses. All
three access tiers apply (tier-selection rule is in shoplazza-common — prefer +shortcut).
Shortcuts are +create, +search and +count. There is no +update / +delete; updates
are the update leaf, and this module has no customer-delete command at all (only addresses
have delete).
Intent → command, highest-fit tier first. The authoritative flags/params live in
shoplazza customers <cmd> --help and shoplazza schema customers.<cmd>, not this table.
| User intent | Command |
|---|---|
| Create a customer | customers +create (--email <e> | --phone <p>) [--first-name --last-name --tags --no-marketing] |
| Find customer by email / phone | customers +search --email <e> / customers +search --phone <p> |
| Total customer count | customers +count (store total; takes no filters) |
| Get one customer by ID | customers get --params '{"customer_id":"<id>"}' |
| List / filter customers (cursor paging, ids, contact) | customers list --params '{…}' |
| Update name / tags / marketing subscription | customers update --params '{"customer_id":"<id>"}' --data '{"customer":{…}}' |
| List a customer's addresses | customers addresses list --params '{"customer_id":"<id>"}' |
| Add an address | customers addresses create --params '{"customer_id":"<id>"}' --data '{"address":{…}}' |
| Get / update / delete one address | customers addresses {get,update,delete} --params '{"customer_id":"<cid>","address_id":"<aid>"}' |
| Set the default shipping address | customers addresses set-default --params '{"customer_id":"<cid>","address_id":"<aid>"}' (no --data) |
"新建客户" / "add a new customer" / "给客户打标签" / "unsubscribe them" is an action, not a question:
AskUserQuestion, never fabricate — above all the contact identifier:
never invent an email address or phone number.--dry-run first only if the user asks (see shoplazza-common → Safety protocol).| User says | Command | How to extract values |
|---|---|---|
| 新建客户 / 建个客户档案 / add a new customer | +create | exactly ONE of --email / --phone; a full name like "Jane Doe" splits into --first-name Jane --last-name Doe |
| 不要订阅营销 / 不订阅邮件 / don't subscribe to marketing | +create … --no-marketing | default subscribes to email and leaves SMS to the store default; the flag turns off both — it MUST be set on explicit opt-out wording; on email-only wording (不订阅邮件) tell the user SMS marketing is off too |
| 按邮箱查客户 / find the customer by email | +search --email <e> | the ask is the customer record, not their orders |
| 按手机号查客户 / look up by phone | +search --phone <p> | do not invent --since/--until time bounds |
| 一共多少客户 / 注册客户数 / how many customers | +count | no flags; extract with --jq '.data.count' |
| 给客户 X 打标签 / tag customer X | update | tags is a WHOLE-ARRAY replace — read-merge-write (see Gotchas) |
| 退订邮件营销 / unsubscribe email marketing | update with {"customer":{"accepts_marketing":false}} | email only — do NOT touch accepts_sms_marketing |
| 退订短信营销 / unsubscribe SMS marketing | update with {"customer":{"accepts_sms_marketing":false}} | SMS only — do NOT touch accepts_marketing |
| 加一个收货地址 / add a shipping address | addresses create | body requires country + country_code |
| 把地址设为默认 / set the default address | addresses set-default | both IDs are path params via --params; no body |
Only no-default values are askable.
| Command | Must ASK if unspecified | Infer if possible | Default silently |
|---|---|---|---|
+create | the contact identifier — exactly one of --email / --phone (if you ask, offer both and explain only ONE is needed) | --first-name/--last-name from a stated name; --no-marketing from opt-out wording; --tags if the user names tags | marketing (default subscribe), --tags (omit), names (optional — never ask) |
+search | which customer — an email or phone to search for, when the user wants a specific person but gave neither | filter flag from what they gave (email vs phone) | --page-limit, --since, --until (all omit) |
update | customer_id; the new value if wording gave none | which field from wording (标签→tags, 邮件营销→accepts_marketing, 短信→accepts_sms_marketing) | every field the user did not mention — never send it |
addresses create | customer_id; country + country_code (required body fields) | other address fields from wording | default and all optional fields (omit) |
addresses set-default | customer_id + address_id | — | — (no body at all) |
Optional or defaulted — never a question: --first-name / --last-name / --tags (+create,
optional) · marketing subscription (+create defaults to subscribe; set --no-marketing only
on explicit opt-out wording, never ask) · --page-limit / --since / --until
(+search; omit — never invent time bounds) · optional address fields incl. default.
Reads like customers, actually belongs elsewhere (and vice versa):
| Sounds like customers | Actually belongs to | Command |
|---|---|---|
| 该客户下过的订单 / order history for [email protected] | shoplazza-orders | an orders search filtered by that customer |
| 按邮箱找到这个客户 / customer profile for an email | this module (not orders) | customers +search --email <e> |
Direction decides: 资料 (profile/record) → customers; 订单 (orders placed) → orders. Resolving a customer ID here as an intermediate step for an orders query is fine — the final answer must come from the owning domain.
Authorization is by domain (the unit of --domain), not per command. Authorization flow is
in shoplazza-common → Authentication.
| Operation | Needs | Grant |
|---|---|---|
read (get / list / count / +search / +count / addresses get|list) | customers read scope | auth login --domain customers |
write (+create / create / update / addresses create|update|delete|set-default) | customers write scope | auth login --domain customers |
Look up exact scope literals with shoplazza auth scopes; --domain customers expands into them.
Domain-specific pitfalls only (generic ones — .data prefix, --jq without -r — are in
shoplazza-common).
| Symptom | Cause | Fix |
|---|---|---|
| Wanted a filtered count (e.g. customers who signed up this month) | +count takes no filters — the count endpoint returns the store total only | Page through +search with the filter (--page-limit 250, then --cursor <.data.cursor> while has_more is true) and count the rows |
+create rejected: "exactly one of --email or --phone is required" | Strict XOR — both given, or neither | Pass exactly one; if the user gave neither, ASK — never fabricate contact info |
Spec-leaf create fails without contact_type | The leaf body requires contact_type; +create fills it automatically (email / phone to match the flag) | Prefer +create; on the leaf, set "contact_type" to match the identifier you send |
| Customer's old tags vanished after tagging | update tags REPLACES the whole array | Read-merge-write: get current tags, append, then update with the merged array |
| Unsubscribed more than the user asked | Email (accepts_marketing) and SMS (accepts_sms_marketing) are separate booleans | On update, change only the one named; leave the other out of the body |
Tried to change email / phone via update | The update body only accepts first_name / last_name / accepts_marketing / accepts_sms_marketing / tags | Not expressible via update — check schema customers.update |
Leaf list rejects a phone param (exit 2, unknown_param) | list takes email and contact query params, not phone | Prefer +search --phone (it sends contact); on the leaf use "contact" (matches the customer's primary contact — email or phone) |
unknown flag: --fields on customers +search | The customers list endpoint documents no fields param, so the flag was removed rather than left as a silent no-op | Project with --jq |
| Wanted to delete a customer | No customer-delete command exists in this module (only addresses delete) | Not expressible at tiers 1–2; confirm an endpoint exists before reaching for api rest |
Set default via addresses update with "default":true | A dedicated endpoint owns this | addresses set-default --params '{"customer_id":…,"address_id":…}' — path params only, no --data |
+search --since/--until returns "wrong" customers | They map to created_at_min/created_at_max — bounds on the customer's CREATION time | Only pass them when the user asks for a signup-time window |
invalid --since / --until (exit 2) | Accepted: now, today, yesterday, -7d / +12h, 2026-09-01, 2026-09-01 08:00, RFC3339, unix seconds; no offset = UTC | Rewrite the value in one of those forms; for a store-local day give a time and the store's offset (2026-09-01T00:00:00+08:00) — a bare date takes no offset |
# 1. New customer with email, opted out of email and SMS marketing
customers +create --email [email protected] --first-name Jane --last-name Doe --no-marketing
# 2. Find a customer by phone (project with --jq; +search has no --fields)
customers +search --phone 13800138000 --jq '.data.customers[] | {id, name, email, phone}'
# 3. Total registered customers
customers +count --jq '.data.count'
# 4. Tag customer 424242 as VIP without clobbering existing tags (read-merge-write)
customers get --params '{"customer_id":"424242"}' --jq '.data.customer.tags'
# → e.g. ["wholesale"]; append and write the MERGED array back:
customers update --params '{"customer_id":"424242"}' --data '{"customer":{"tags":["wholesale","VIP"]}}'
# 5. Unsubscribe email marketing only (SMS untouched)
customers update --params '{"customer_id":"887766"}' --data '{"customer":{"accepts_marketing":false}}'
# 6. Set the default shipping address
customers addresses set-default --params '{"customer_id":"335577","address_id":"ADDR99"}'
# 7. List a customer's address book
customers addresses list --params '{"customer_id":"335577"}' --jq '.data.addresses[] | {id, name, address1, default}'
shoplazza customers <cmd> --helpshoplazza schema customers.<cmd> (addresses: schema customers.addresses.<cmd>)--dry-run / --jq / safety): ../shoplazza-common/SKILL.mdshortcuts/customers/*.goWhat SKILL.md sets; muted values are Claude Code's defaults
10 skills in this plugin
/shoplazza-billingUse when an app developer needs to bill a Shoplazza merchant for app usage through the CLI — one-time application charges, recurring (subscription) charges, metered usage charges, and app-charge transaction records. Triggers include 应用收费 / 订阅费 / 一次性收费 / 用量费 / 计费 / app billing / recurring / one-time / usage charge. NOT buyer order payments or refunds (那是 shoplazza-orders 的 transactions / +refund)./shoplazza-commonShared foundation for the shoplazza CLI: installing the CLI (安装 CLI / command not found), authentication (auth login — account-level and store-level; 登录 / 授权), auth status/scopes/logout, store switching (auth store use; 切换店铺 / 换店), multi-store profiles (add/list/use/rename/remove/info), the three access tiers (+shortcut / spec leaf / api rest), the output envelope ({ok,data} / .data), --dry-run / --jq / --fields / --format, schema introspection, api rest fallback, update notice, the safety protocol, and how to trust a filtered list read (pagination / has_more / cursor, silently-dropped filters, the exact-match precision ladder). Read this FIRST on first use of the shoplazza CLI, when the CLI is missing, when logging in / authorizing / switching store or profile, on permission errors, when a search or filter looks like it returned too much, and before using any domain skill. Platform developer-docs questions (an app's OAuth, webhook HMAC, Liquid, changelog) → shoplazza-docs.npx claudepluginhub shoplazza/shoplazza-cli --plugin shoplazzaOther plugins' skills for the same job