SuperAPI AI 工具集

shopify-admin-b2b-company-overview

办公与效率

查看项目

更新于 10-15 10:44

技能介绍

用途

查询所有 B2B 公司账户及其关联的门店位置、价格清单和付款条款,为运营和销售团队提供批发账户组合的汇总视图。该技能为只读,不执行任何变更操作。需要 Shopify B2B(仅 Shopify Plus 提供)。

前置条件

已认证的 Shopify CLI 会话:shopify store auth --store <domain> --scopes read_customers

API 权限范围:read_customers

商店必须为 Shopify Plus 且已启用 B2B

参数

store:字符串,必填,无默认值,商店域名(例如 mystore.myshopify.com)

format:字符串,可选,默认 human,输出格式:human 或 json

安全性

只读技能,不执行任何变更操作,可随时安全运行。

工作流程

操作 companies(查询):输入 first: 250,选择 name、locations、contacts、createdAt、分页游标;预期输出所有 B2B 公司账户,分页直到 hasNextPage: false。

操作 companyLocations(查询):输入每个公司 first: 250,选择 name、buyerExperienceConfiguration { paymentTermsTemplate, checkoutToDraft }、catalogsCount;预期输出公司位置及其付款和目录配置。

GraphQL 操作

companies:query(已针对 api_version 2025-01 验证):

query B2BCompanies($after: String) { companies(first: 250, after: $after) { edges { node { id name note createdAt updatedAt locationsCount { count } contactsCount { count } orders(first: 1, sortKey: CREATED_AT, reverse: true) { edges { node { createdAt totalPriceSet { shopMoney { amount currencyCode } } } } } } } pageInfo { hasNextPage endCursor } } }

companyLocations:query(已针对 api_version 2025-01 验证):

query CompanyLocationsDetail($companyId: ID!) { company(id: $companyId) { id name locations(first: 50) { edges { node { id name shippingAddress { countryCode city } buyerExperienceConfiguration { paymentTermsTemplate { name dueInDays } checkoutToDraft } catalogsCount { count } } } } } }

会话跟踪

Claude 必须在每个阶段输出以下内容,此为强制要求。

开始时输出:

╔══════════════════════════════════════════════╗ ║ SKILL: B2B Company Overview ║ ║ Store: <store domain> ║ ║ Started: <YYYY-MM-DD HH:MM UTC> ║ ╚══════════════════════════════════════════════╝

每个步骤后输出:

[N/TOTAL] <QUERY|MUTATION> <OperationName> → Params: <brief summary of key inputs> → Result: <count or outcome>

完成时输出:

format 为 human(默认)时:

══════════════════════════════════════════════ B2B COMPANY OVERVIEW Total companies: <n> Total locations: <n> With net terms: <n> With catalogs: <n>

Company: <name> Locations: <n> | Last order: <date> Payment terms: Net 30 Output: b2b_companies_<date>.csv ══════════════════════════════════════════════

format 为 json 时输出:

{ "skill": "b2b-company-overview", "store": "<domain>", "total_companies": 0, "total_locations": 0, "companies": [], "output_file": "b2b_companies_<date>.csv" }

输出格式

CSV 文件 b2b_companies_<YYYY-MM-DD>.csv,包含列:company_id, company_name, locations_count, contacts_count, last_order_date, last_order_value, currency, payment_terms, has_catalog

错误处理

THROTTLED:API 速率限制超出,等待 2 秒,最多重试 3 次。

公司列表为空:B2B 未配置或无账户,以 0 家公司退出,注明需要 B2B Plus。

companies 查询不可用:商店不在 Shopify Plus 上,返回明确错误:B2B 需要 Shopify Plus。

最佳实践

每月运行一次作为批发账户健康检查——90 天以上无订单的公司可能需要主动联系。

checkoutToDraft: true 表示买家必须先获得订单批准才能付款——有助于了解哪些账户需要人工订单审核。

对于有多个位置但只有一个目录的公司,检查该目录是否正确限定到每个位置。

此技能需要 Shopify B2B(Shopify Plus 功能)——在非 Plus 商店上会返回空结果或错误。