/shoplazza:shoplazza-billingfrom Shoplazza
Bills Shoplazza merchants for app usage via CLI: one-time, recurring subscription, and metered usage charges. Includes transaction records and two-phase approval flow.
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: access tiers, the output envelope (.data), --dry-run,
--jq, schema, api rest, auth / profiles, and the safety protocol. This file covers only
the billing domain and never repeats them.
The billing module lets an app developer charge a merchant for app usage: one-time fees,
recurring subscriptions, and metered usage charges (plus transaction records). It is
spec-leaf only — there are no +shortcuts. Every charge moves real money, so
--dry-run first and restate the charge to the user before executing (shoplazza-common → Safety).
Charges are two-phase: create alone moves no money — the charge sits pending until the
merchant opens the approval URL the response returns (confirm_url for one-time,
confirmation_url for recurring) and approves it in the Shoplazza admin, after which they land
on your return_url. Usage charges skip approval — they bill under an already-approved
recurring charge.
Intent → command. Authoritative params/body live in shoplazza schema billing.<group>.<cmd>.
| User intent | Command |
|---|---|
Create a one-time charge (money → --dry-run first) | billing one-time create --data '{"application_charge":{"name":"…","price":"<amt>","return_url":"…"}}' --dry-run |
| Get / list one-time charges | billing one-time get --params '{"charge_id":"<id>"}' · billing one-time list |
| One-time charge transactions | billing one-time transactions --params '{"charge_id":"<id>"}' |
Create a recurring (subscription) charge (money → --dry-run first) | billing recurring create --data '{"recurring_application_charge":{"name":"…","price":<amt>,"return_url":"…"}}' --dry-run (optional trial_days, capped_amount, terms) |
| Get / list recurring charges | billing recurring get --params '{"charge_id":"<id>"}' · billing recurring list |
| Update a recurring charge's capped amount | billing recurring update --params '{"charge_id":"<id>"}' --data '{"capped_amount":<amt>}' |
Cancel a recurring charge (--dry-run first) | billing recurring cancel --params '{"charge_id":"<id>"}' --dry-run |
| Recurring charge transactions | billing recurring transactions --params '{"charge_id":"<id>"}' |
Record a usage charge under a recurring charge (money → --dry-run first) | billing usage create --params '{"charge_id":"<id>"}' --data '{"usage_charge":{"description":"…","price":<amt>}}' --dry-run |
| Get / list usage charges | billing usage get --params '{…}' · billing usage list --params '{"charge_id":"<id>"}' |
| Get one app-charge transaction | billing transactions get --params '{"transaction_id":"<id>"}' |
Billing writes move real money. Before any create / cancel:
AskUserQuestion if missing, never fabricate an amount:
create: name, price, return_urlcreate: name, price, return_urlcreate: charge_id (the parent recurring charge), description, pricecancel: charge_id--dry-run first, restate ("charge merchant $X — one-time / $X per month subscription / $X usage under CHG…, returns to ; pending until the merchant approves via the returned confirm link"), stop and wait for the user's go-ahead, then execute.
For cancel, restate what is being cancelled, not a bare id echo: recurring get first
(name / price / status — also catches an already-cancelled charge) in the same reply as the
cancel --dry-run preview.create succeeds, hand the approval URL to the user —
--jq '.data.application_charge | {id, status, confirm_url}' (one-time) /
--jq '.data.recurring_application_charge | {id, status, confirmation_url}' (recurring) —
and say plainly: no money is charged until the merchant opens it and approves.Reads like billing, actually belongs elsewhere:
| Sounds like billing | Actually belongs to | Command |
|---|---|---|
| 交易记录 = 买家给店铺付的钱 / order payment transactions | shoplazza-orders | orders transactions |
| 订单退款 / refund a buyer | shoplazza-orders | orders +refund |
billing transactions = the app's charges to the merchant; a buyer's payment for an order is
orders transactions. (Serves the app-charge-transactions / order-payment-transactions
routing collisions.)
Billing needs no store scope. auth login --domain billing expands to zero scopes —
that is correct, not a bug: app-charge endpoints are authorized by the app installation itself,
not by a store OAuth grant. Verified live — on a profile holding neither read_finance nor
write_finance, recurring list returned ok:true and recurring create reached business
validation (400 / 422), never 401/403.
So do not run auth login --domain billing. Authorization replaces the grant server-side,
so a 0-scope login can revoke the scopes other domains rely on. A 401/403 here means the
account login is missing or expired — check auth status, don't chase scopes.
Domain-specific only (generic .data / --dry-run / --jq rules are in shoplazza-common).
| Symptom | Cause | Fix |
|---|---|---|
Charge rejected on price type | price type differs by charge: one-time = string ("99.99"), recurring & usage = number (29, 0.05) | Match the type — quote it for one-time, bare number for recurring/usage |
create succeeded but the merchant is never billed | Charges are two-phase: create returns a pending charge; nothing activates until the merchant approves it via the returned approval URL | Hand the URL to the user and say no money moves until the merchant approves — a create ok:true is NOT "charged" |
jq for the approval URL returns null | The field name differs by charge: one-time = confirm_url, recurring = confirmation_url (usage has neither — no approval step) | Match the field to the charge type |
usage create fails without a charge | charge_id (the parent recurring charge) is a required path param | --params '{"charge_id":"<recurring charge id>"}' |
| Created a real charge without preview | Charges are real money | --dry-run first, restate to the user, wait for their go-ahead, then run |
recurring create → 422 The price configuration in the plan does not match with the listing, please check | The platform only accepts a price matching a pricing plan configured in the app's listing (partner backend); arbitrary amounts are refused. Not fixable from the CLI — this module has no listing/plan endpoint (schema billing confirms) | Tell the user to add/adjust that plan in the app listing, then re-run the same command unchanged. Do NOT try other prices |
recurring create → bare 400 Bad Request, no field info, body matches schema | Adding capped_amount makes the backend return a specific 422 instead (verified live: identical body + capped_amount → the listing 422 above). Whether the 400 shares that root cause, or is its own capped_amount check, is unconfirmed — schema marks the field optional | Don't hunt for a malformed field — re-send once with capped_amount to surface the real message, then act on it. It is a diagnostic, not a fix: never retry with other prices, and don't assume the charge will go through once it's set |
# 1. One-time $99.99 setup fee (price is a STRING)
billing one-time create --data '{"application_charge":{"name":"Setup Fee","price":"99.99","return_url":"https://app.example.com/billing/done"}}' --dry-run
# real run: add --jq '.data.application_charge | {id, status, confirm_url}' and hand the URL over
# 2. Recurring $29/mo subscription, 7-day free trial (price is a NUMBER)
billing recurring create --data '{"recurring_application_charge":{"name":"Pro Plan","price":29,"return_url":"https://app.example.com/billing/ok","trial_days":7}}' --dry-run
# real run: add --jq '.data.recurring_application_charge | {id, status, confirmation_url}'
# 3. Usage charge $0.05 under recurring charge CHG7788 (price NUMBER)
billing usage create --params '{"charge_id":"CHG7788"}' --data '{"usage_charge":{"description":"API calls overage","price":0.05}}' --dry-run
# 4. Cancel a recurring charge: look up what it is, preview, then STOP for the user's go-ahead
billing recurring get --params '{"charge_id":"CHG5566"}' --jq '.data.recurring_application_charge | {name, price, status}'
billing recurring cancel --params '{"charge_id":"CHG5566"}' --dry-run
shoplazza billing <group> <cmd> --helpshoplazza schema billing.<group>.<cmd>--dry-run / safety): ../shoplazza-common/SKILL.mdWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub shoplazza/shoplazza-cli --plugin shoplazza10 skills in this plugin
/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./shoplazza-customersUse when the user wants to manage customers (buyers) on a shoplazza store through the CLI — create a customer profile, find a customer by email or phone, get customer details or the total customer count, update names / tags / email or SMS marketing subscription, or manage a customer's shipping addresses including the default checkout address. Triggers include 客户 / 买家 / 顾客 / 客户资料 / 新建客户 / 按邮箱查客户 / 按手机号查客户 / 给客户打标签 / 退订营销 / 收货地址 / 默认地址 / customer profile / new customer / find customer by email or phone / customer count / tag a customer / unsubscribe marketing / shipping address / default address. Finding the customer RECORD by email (按邮箱找客户资料) belongs HERE (customers +search); that customer's ORDER HISTORY (该客户下过的订单 / orders placed by this email) belongs to shoplazza-orders./shoplazza-discountsUse when the user wants to manage discount activities on a shoplazza store through the CLI — promotional campaigns, coupon codes, flash sales, buy-X-get-Y offers, rebates / tiered satisfy-N-get-M discounts, free-shipping codes, M-for-N (Nth-item-off) discounts, discount stacking / combination rules, or coupon (voucher) campaigns. Triggers include 满减 / 折扣码 / 优惠码 / 闪购 / 满X减Y. NOT gift cards (redeemable store credit → shoplazza-products `gift-cards`). NOT showing a sale inside a theme card / 首页促销卡片 (→ shoplazza-themes)./shoplazza-docsSearch and read the Shoplazza developer docs on shoplazza.dev (开发者文档 / 查文档) with `shoplazza docs search --query --locale` / `docs get --url`; no login needed. Use when the user asks how the Shoplazza platform works or what it allows: app development (应用开发), OAuth and access scopes for their own app (应用授权 / 权限范围), verifying webhook HMAC signatures (webhook 验签), app proxy (应用代理), checkout / theme / function extensions (结账扩展 / 主题扩展), theme development and the Liquid reference (主题开发 / Liquid 语法 / 对象 / 过滤器); before writing code that calls the Shoplazza API or Liquid; on an unfamiliar API error or field (报错 / 字段含义); when upgrading API versions (版本升级 / changelog). Prefer it over WebFetch or web search for shoplazza.dev. NOT store data (→ domain skills); NOT a CLI command's params / body / response (→ `shoplazza schema` / `--help`); NOT logging the CLI in (→ shoplazza-common); NOT webhook subscriptions (→ shoplazza-webhook); NOT editing the store's theme or AI cards (→ shoplazza-themes)./shoplazza-ordersUse when the user wants to manage a shoplazza store's orders through the CLI — searching / counting / viewing orders (查订单 / 找订单 / 订单列表 / 订单详情 / 新订单 / order search), shipping and fulfillment (发货 / 标记发货 / 物流 / 运单号 / 改运单号 / ship an order / update tracking), refunding a buyer (退款 / 给顾客退钱 / 退钱给买家 / refund an order — buyer refunds live HERE, not in discounts and not in billing), cancelling / creating / updating / marking orders paid (取消订单 / 代客下单 / 标记支付), an order's payment transactions (订单支付流水 / 支付交易记录 / buyer payment transactions — app-charge transactions → shoplazza-billing), fraud risk records (欺诈 / 风控 / 高风险订单 / order risk), after-sales records (售后 / post-sales), shipping zones and rates (运费区域 / 邮费 / 运费方案 / shipping zones — real-time rate carriers → shoplazza-shop carrier-services), and tracking-carrier lookup (快递承运商 / 运单号识别承运商). A customer's orders by email (按邮箱查某客户的订单) are searched HERE; the customer record itself → shoplazza-customers. NOT product stock / 库存 / 补货 (→ shoplazza-products)./shoplazza-productsUse when the user wants to manage a shoplazza store's product catalog through the CLI — creating / publishing / unpublishing products (建品 / 新建商品 / 上新 / 上架 / 下架), searching or counting the catalog (搜商品 / 找商品 / 商品数量 / how many products I sell), changing prices (改价 / 调价 / set price), adjusting stock (库存 / 补货 / 加库存 / 减库存 / inventory), product tags (标签), variants / SKUs (变体 / 规格), collections and collects (商品合集 / 商品分组), product images (商品图片 / 主图), gift cards (礼品卡 / 储值卡 — gift cards live HERE, not in discounts), customer product reviews (买家评价 / 评论 / product reviews), warehouse locations (仓库 / 库位), suppliers and procurement (供应商 / 采购单 / 进货). NOT discount codes / coupons / 优惠码 / 折扣码 / 满减 (→ shoplazza-discounts); NOT the store media library / file uploads / 媒体库文件 and NOT metafields / 元字段 (→ shoplazza-shop); NOT order fulfillment / 发货 (→ orders domain); NOT theme card images / 装修配图 / 商品详情页模板 (→ shoplazza-themes).Other plugins' skills for the same job