b2c-cip
B2C CIP Skill
Use b2c cip commands to query B2C Commerce Intelligence (CIP), also known as Commerce Cloud Analytics (CCAC).
Tip: If
b2cis not installed globally, usenpx @salesforce/b2c-cli.
Command Structure
cip
├── tables - list metadata catalog tables
├── describe <table> - describe table columns
├── query - raw SQL execution
└── report - curated report topic
├── sales-analytics
├── sales-summary
├── ocapi-requests
├── top-selling-products
├── product-co-purchase-analysis
├── promotion-discount-analysis
├── search-query-performance
├── payment-method-performance
├── customer-registration-trends
└── top-referrers
Configuration
Values like tenantId, clientId, and clientSecret resolve from dw.json / SFCC_* env vars / the active instance. Examples below show minimal usage; add flags only to override configured values. If a required value is missing, the CLI emits an actionable error pointing at the flag, env var, and config key. See the b2c-config skill for precedence details.
Relevant overrides:
--tenant-id(alias--tenant) /SFCC_TENANT_ID/tenantId--client-id/SFCC_CLIENT_ID/clientId--client-secret/SFCC_CLIENT_SECRET/clientSecret--cip-host/SFCC_CIP_HOSTto override the default host--staging/SFCC_CIP_STAGINGto force staging analytics host
Requirements
- OAuth client credentials (CIP supports client credentials only;
--user-authis not supported) - API client has
Salesforce Commerce APIrole with tenant filter for your instance
::: warning Availability
This feature is typically used with production analytics tenants (for example abcd_prd).
Starting with release 26.1, reports and dashboards data can also be enabled for non-production instances (ODS/dev/staging and designated test realms) using the Enable Reports & Dashboards Data Tracking feature switch.
Reports & Dashboards non-production URL: https://ccac.stg.analytics.commercecloud.salesforce.com
:::
Quick Workflow
- Discover available tables (
b2c cip tables) or curated reports (b2c cip report --help). - Use
b2c cip describe <table>or report--describeto inspect structure/parameters. - Use report
--sqlto preview generated SQL. - Pipe SQL into
cip querywhen you need custom execution/output handling.
Metadata Discovery Examples
# List warehouse tables (uses configured tenant)
b2c cip tables
# Filter table names
b2c cip tables --pattern "ccdw_aggr_%"
# Describe table columns
b2c cip describe ccdw_aggr_ocapi_request
# Target a different tenant than the active config
b2c cip tables --tenant-id abcd_prd
Known Tables
For an efficient table catalog grouped by aggregate/dimension/fact families, use:
references/KNOWN_TABLES.md
For a general-purpose starter query pack with ready-to-run SQL patterns, use:
references/STARTER_QUERIES.md
The list is derived from official JDBC documentation and intended as a quick discovery aid.
Curated Report Examples
# Show report commands
b2c cip report --help
# Run a report (tenant resolves from config)
b2c cip report sales-analytics \
--site-id Sites-RefArch-Site \
--from 2025-01-01 \
--to 2025-01-31
# Show report parameter contract
b2c cip report top-referrers --describe
# Print generated SQL and stop
b2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --sql
# Force staging analytics host
b2c cip report top-referrers --site-id Sites-RefArch-Site --limit 25 --staging --sql
SQL Pipeline Pattern
b2c cip report sales-analytics --site-id Sites-RefArch-Site --sql \
| b2c cip query
Raw SQL Query Examples
b2c cip query "SELECT * FROM ccdw_aggr_sales_summary LIMIT 10"
You can also use:
--file ./query.sql- pipe query text from standard input (for example
cat query.sql | b2c cip query ...)
Date Placeholders
b2c cip query supports placeholder replacement:
<FROM>with--from YYYY-MM-DD<TO>with--to YYYY-MM-DD--fromdefaults to first day of current month--todefaults to today
If you provide --site-id, the common CIP format is Sites-{siteId}-Site. The command warns when siteId does not match that pattern but still runs with your input.
Output Formats
Both raw query and report commands support:
--format table(default)--format csv--format json--json(global JSON mode)
Service Limits and Best Practices
The underlying JDBC analytics service has strict limits. Keep requests scoped:
- avoid broad
SELECT *queries - use narrow date ranges and incremental windows
- prefer aggregate tables when possible
- use report commands for common KPI workflows
Limits can change over time. Use the official JDBC access guide for current NFR limits:
Troubleshooting
tenant-id is required: set--tenant-id(orSFCC_TENANT_ID)- Auth method error: CIP supports client credentials only; remove
--user-auth - 403/unauthorized: verify API client role and tenant filter include target instance
- Rate/timeout failures: reduce date window, select fewer columns, query aggregate tables
For full command reference, use b2c cip --help and CLI docs.
More from salesforcecommercecloud/b2c-developer-tooling
b2c-docs
Search and read B2C Commerce Script API documentation and XSD schemas using the b2c CLI. Use this skill whenever the user needs to look up class methods, understand API signatures, find available properties on commerce objects (baskets, orders, products, customers), or check XML schema formats for imports. Also use when writing server-side scripts and needing API reference — even if they just say "what methods does Basket have" or "what fields can I import for products".
116b2c-webdav
List, upload, download, and manage files on B2C Commerce instances via WebDAV. Use this skill whenever the user needs to upload files to IMPEX directories, download exports from an instance, list remote files, create or delete directories, or zip/unzip files on the server. Also use when managing file transfers to sandboxes or browsing instance file systems -- even if they just say 'upload a file to the instance' or 'check what's in the IMPEX folder'.
103b2c-slas-auth-patterns
Implement SLAS authentication patterns in B2C Commerce including passwordless login (email OTP, SMS OTP, passkeys), session bridging between PWA Kit/Storefront Next and SFRA, hybrid authentication (B2C 25.3+), token refresh flows, trusted system on behalf of (TSOB), and JWT validation. Use this skill whenever the user asks about shopper authentication beyond basic login, token exchange flows, passwordless or biometric auth, keeping sessions alive across storefronts, handling 409 Conflict errors on token endpoints, refreshing shopper tokens, or validating JWTs — even if they don't mention SLAS by name.
90b2c-config
Inspect and debug CLI configuration, instance connections, and authentication. Use this skill whenever the user needs to check which dw.json or credentials are active, manage multiple instance profiles, retrieve OAuth tokens for scripting, troubleshoot authentication failures or connection errors, or integrate with VS Code or other editors. Also use when environment variables override config or the wrong sandbox is being targeted -- even if they just say 'why is it connecting to the wrong instance' or 'get me an access token'.
90b2c-controllers
Create storefront controllers using SFRA or classic patterns with server.get/post, middleware chains, and res.render/json. Use this skill whenever the user needs to build a page route, handle form submissions, create AJAX endpoints, extend or override existing controllers, or add middleware to a request pipeline. Also use when debugging route registration or response rendering -- even if they just say 'new page endpoint' or 'handle a POST request'.
86b2c-scapi-schemas
Browse and retrieve SCAPI OpenAPI schema specifications. Use this skill whenever the user needs to list available SCAPI APIs, inspect endpoint paths or request/response shapes, explore data models for products or orders, check which fields an API returns, or understand SCAPI versioning. Also use when looking up API details before building an integration -- even if they just say 'what fields does the product API return' or 'show me the SCAPI endpoints'.
84