Skip to content
SarvexDocs
Esc
↑↓navigate↵open⌘Jpreview

Agentic revenue vs. the merchant's web-channel baseline

The baseline is sourced from the connector’s own order/analytics data (never Sarvex’s own traffic — Sarvex never sees web sessions). Revenue and AOV are comparable between the two channels; agent sessions and web sessions are never compared here (different definitions, different measurement) — this response carries no session-count field. Each metric reports available: false with a reason when the baseline’s confidence for any day in range is short of connector_reported — never a substituted estimate. agentic_share_of_total divides by the connector’s own reported total (which already includes agentic orders placed directly in the merchant’s store), never by agentic+baseline, which would double-count them. Max range 92 days.

GET/channel/comparison
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT issued by the external IdP via the OAuth 2.0 authorization-code flow (Kinde in production; a simulator in test). The client obtains it and sends it as a Bearer token on every authenticated call. Sarvex's services verify it — issuer, audience, signature (IdP JWKS), expiry — and read identity and tenant from its claims. Sarvex does not issue or revoke these tokens. merchant_id/store_id are read from the verified claims (and the merchant→store mapping), never from the URL. The operator scope is required for /operator/*. Operators acting on a specific merchant pass the X-Operate-As header, which is recorded in the audit log.

Query parameters
fromstring<date>

yyyy-MM-dd, inclusive. Defaults to 29 days before to. Range with to is capped at 92 days.

tostring<date>

yyyy-MM-dd, inclusive. Defaults to today (UTC). Range with from is capped at 92 days.

store_idstring
Responses
200

Agentic vs. web-baseline comparison for the range.

fromstring<date>
tostring<date>
agenticobject
Show properties
revenue_minorinteger
checkouts_completedinteger
aov_minorinteger
currencystring | null
currency_mixedboolean
web_baselineobject

Mirrors agentic's shape so both sides of the comparison render symmetrically.

Show properties
ordersinteger
revenue_minorinteger
aov_minorinteger
currencystring | null
currency_mixedboolean
confidencechannel_baseline_confidence

R11's tri-state confidence indicator, rolled up across every day in the requested range. connector_reported means every day was fully reported; partial means at least one day was incomplete or missing but real data exists for at least one day (the returned figures are computed from that real, if incomplete, data — never an estimate for the gap); unavailable means no usable data exists for any day in range.

Allowed:connector_reportedpartialunavailable
revenuechannel_metric_comparison

A single metric's agentic-vs-baseline comparison. available=false only when confidence=unavailable (zero usable baseline days) — a partial range still returns available=true with confidence=partial and a reason, never a substituted estimate.

Show properties
availableboolean
confidencechannel_baseline_confidence

R11's tri-state confidence indicator, rolled up across every day in the requested range. connector_reported means every day was fully reported; partial means at least one day was incomplete or missing but real data exists for at least one day (the returned figures are computed from that real, if incomplete, data — never an estimate for the gap); unavailable means no usable data exists for any day in range.

Allowed:connector_reportedpartialunavailable
reasonstring

Present when available=false, or when confidence=partial to explain what is incomplete.

agentic_minorinteger
baseline_minorinteger
delta_minorinteger

agentic_minor minus baseline_minor.

aovchannel_metric_comparison

A single metric's agentic-vs-baseline comparison. available=false only when confidence=unavailable (zero usable baseline days) — a partial range still returns available=true with confidence=partial and a reason, never a substituted estimate.

Show properties
availableboolean
confidencechannel_baseline_confidence

R11's tri-state confidence indicator, rolled up across every day in the requested range. connector_reported means every day was fully reported; partial means at least one day was incomplete or missing but real data exists for at least one day (the returned figures are computed from that real, if incomplete, data — never an estimate for the gap); unavailable means no usable data exists for any day in range.

Allowed:connector_reportedpartialunavailable
reasonstring

Present when available=false, or when confidence=partial to explain what is incomplete.

agentic_minorinteger
baseline_minorinteger
delta_minorinteger

agentic_minor minus baseline_minor.

agentic_share_of_totalchannel_share_comparison
Show properties
availableboolean
confidencechannel_baseline_confidence

R11's tri-state confidence indicator, rolled up across every day in the requested range. connector_reported means every day was fully reported; partial means at least one day was incomplete or missing but real data exists for at least one day (the returned figures are computed from that real, if incomplete, data — never an estimate for the gap); unavailable means no usable data exists for any day in range.

Allowed:connector_reportedpartialunavailable
reasonstring

Present when available=false, or when confidence=partial to explain what is incomplete.

sharenumber<double>

agentic_revenue_minor divided by the connector's own reported total revenue for the range (which already includes agentic orders placed directly in the merchant's store) — never agentic/(agentic+baseline), which would double-count them.

403

Authenticated but not permitted (e.g. non-operator on an operator route).

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
detailsobject | null
422

Request body failed validation.

errorobjectrequired
Show properties
codestringrequired
messagestringrequired
detailsobject | null
Try it
Server
Authorization
Parameters
Request
curl -X GET "https://api.sarvex.example.com/v1/channel/comparison" \
  -H "Authorization: Bearer YOUR_TOKEN"
Response
{
  "from": "2019-08-24",
  "to": "2019-08-24",
  "agentic": {
    "revenue_minor": 0,
    "checkouts_completed": 0,
    "aov_minor": 0,
    "currency": "string",
    "currency_mixed": true
  },
  "web_baseline": {
    "orders": 0,
    "revenue_minor": 0,
    "aov_minor": 0,
    "currency": "string",
    "currency_mixed": true,
    "confidence": "connector_reported"
  },
  "revenue": {
    "available": true,
    "confidence": "connector_reported",
    "reason": "string",
    "agentic_minor": 0,
    "baseline_minor": 0,
    "delta_minor": 0
  },
  "aov": {
    "available": true,
    "confidence": "connector_reported",
    "reason": "string",
    "agentic_minor": 0,
    "baseline_minor": 0,
    "delta_minor": 0
  },
  "agentic_share_of_total": {
    "available": true,
    "confidence": "connector_reported",
    "reason": "string",
    "share": 0.1
  }
}