1.0.1
API Overview
The Metrics API provides programmatic access to time-series operational metrics for Salesforce Commerce Cloud organizations. It exposes the same metrics available in the LogCenter UI, organized by functional category, so that data can be ingested into third-party BI and monitoring tools (such as Tableau or Grafana) and into agentic-observability workflows.
This is an Admin API: it is intended for operators, SRE teams, and machine clients (BI tools, monitoring agents) acting on behalf of a customer organization, not for storefront shoppers.
Note: The Metrics API is currently in a closed beta. To request access, contact your account manager.
Endpoints
The API exposes nine pre-aggregated metric categories, each accessible through its own typed path:
/metrics/overall— Overall application performance metrics/metrics/sales— Sales and commerce metrics/metrics/ecdn— eCDN performance and caching metrics/metrics/third-party— Third-party service integration metrics/metrics/scapi— SCAPI request and performance metrics/metrics/scapi-hooks— SCAPI hooks execution metrics/metrics/mrt— Managed Runtime metrics/metrics/controller— Controller and pipeline metrics/metrics/ocapi— OCAPI request and performance metrics
Each request returns a single time-series document for the requested category, organization, and time window.
Key Features
- Time-series data retrieval with Unix epoch time-range parameters (in seconds)
- Multiple metric categories covering all aspects of Commerce Cloud performance
- Organization-scoped access with proper authentication and authorization
- Filtering capabilities for specific APIs, services, and OCAPI sub-categories
- Standardized response format with comprehensive metadata
Authentication & Authorization
This API uses standard SCAPI authentication mechanisms:
- OAuth 2.0 (
AmOAuth2) with the SCAPI gateway - Organization-scoped access — callers can only retrieve metrics for organizations they are authorized to access
Required OAuth scope:
sfcc.metrics— read access to metrics
Time-Range Constraints
Two backend-enforced constraints bound every request:
- Maximum lookback:
frommust not resolve to a time more than 30 days ago. This matches the configured retention of the underlying metrics store; older data is not retained. - Maximum window:
to - frommust not exceed 1 day. Requests that exceed this return400 Bad Request.
Use Cases
Overall application monitoring
Monitor total platform requests, sessions, and response times.
GET /organizations/{orgId}/metrics/overall?from=1672531200&to=1672534800
Sales performance tracking
Track order creation and basket activity.
GET /organizations/{orgId}/metrics/sales?from=1672488000&to=1672531200
eCDN performance analysis
Monitor CDN performance, cache hit rates, and bandwidth usage.
GET /organizations/{orgId}/metrics/ecdn?from=1672509600&to=1672531200
SCAPI performance monitoring
Monitor SCAPI request latency and response counts, optionally filtered by API family and / or API name.
GET /organizations/{orgId}/metrics/scapi?from=1672527600&to=1672531200&apiFamily=shopper&apiName=products
Third-party service monitoring
Track third-party service call performance and error rates, optionally filtered to a single named service.
GET /organizations/{orgId}/metrics/third-party?from=1672488000&to=1672531200&thirdPartyServiceId=apple-pay-gateway.apple.com
SCAPI Hooks performance monitoring
Track SCAPI hook execution time and error rates.
GET /organizations/{orgId}/metrics/scapi-hooks?from=1672527600&to=1672531200
Managed Runtime monitoring
Monitor MRT request volume, cache hit rates, error rates, and Lambda invocations.
GET /organizations/{orgId}/metrics/mrt?from=1672488000&to=1672531200
Controller performance monitoring
Track controller invocation volume and processing duration.
GET /organizations/{orgId}/metrics/controller?from=1672527600&to=1672531200
OCAPI performance monitoring
Monitor OCAPI metrics, optionally filtered by OCAPI category and / or OCAPI API endpoint.
GET /organizations/{orgId}/metrics/ocapi?from=1672527600&to=1672531200&ocapiCategory=shop&ocapiApi=baskets
Metric Categories
Overall Application
- Total Platform Requests — Overall request volume
- Storefront Requests — Customer-facing request volume
- Sessions — Active user sessions
- Response Time — Average response latency
- Emails Sent — Email delivery volume
- System Workload — Overall system utilization
Sales
- Orders — Order creation rate
- Basket Creations — Shopping basket creation rate
- Basket Updates — Basket modification rate
eCDN
- Success and Errors — Request success / failure rates
- Cache Hit Percentage — CDN cache effectiveness
- Total Requests — Overall CDN request volume
- Total Bandwidth — Data-transfer volume
- Total Pageviews — Page view metrics
- Unique Visitors — Unique visitor tracking
Third-Party Services
- Call Counts — API call volume to external services
- Call Duration p95 — 95th-percentile response times
- Remote Exceptions — Error rates from external services
SCAPI
- Request Latency — API response times
- Response Count — SCAPI response volume by API family and HTTP status class (2xx/3xx/4xx/5xx)
- Cache Hit Statistics — API-level caching metrics
SCAPI Hooks
- Hook Execution Times — Hook processing duration
- Hook Errors — Hook execution error rates
Managed Runtime
- Request Count — MRT request volume
- Cache Hit Rates — MRT caching performance
- Error Rates — MRT error percentages
- Lambda Invocations — Serverless function executions
- Request Times — MRT processing duration
Controller
- Total Calls — Controller invocation count
- Average Duration — Controller processing time
OCAPI
- Total Calls — OCAPI request volume
- Average Duration — OCAPI response times
- Total Errors — OCAPI error counts
Let us know so we can improve!