Every request you send resolves against real state: the domain picks a store and storefront, your headers attach a visitor session and maybe a customer, and the platform resolves the locale, country, and display currency your buyer will actually see. runtimeContext is the one query that shows you ALL of that resolution — the same answers a hosted theme gets, because there is only one storefront runtime.
Use it at the boot of a headless app to confirm your wiring, and any time something looks wrong: "why is this price in EUR", "why is my customer not recognized", "why is the German locale active" — the answer is in this response, usually in a resolvedBy field.
The query#
query RuntimeContext {
runtimeContext {
store { id name currency timezone primaryDomain }
storefront { id name kind locale domain currentDomain }
request { host }
session { present source expiresAt }
customer { authenticated id authSurface }
consent {
required
given
categories
timestamp
country
banner {
enabled
showTo
countries
categories { analytics marketing personalization }
}
}
localization { locale baselineLocale country resolvedBy }
currency { code name symbol taxIncluded resolvedBy }
b2b {
state
companyId
companyLocationId
contactId
catalogId
catalogSource
role
canPlaceOrders
}
}
}
What each object tells you#
Object |
What it answers |
|---|---|
store |
Which store your domain resolved to: name, base currency, timezone, primary domain. |
storefront |
Which storefront on that store, its kind (storefront / b2b), its default locale, and the domain you actually hit (currentDomain). |
request |
The host the platform saw — useful when a proxy or CDN sits in front of your app. |
session |
Whether your X-Tringify-Session-Token was accepted (present), where the session came from (source), and when it expires — refresh with visitorSessionCreate before expiresAt. |
customer |
Whether your X-Customer-Access-Token authenticated (authenticated: true means the token was accepted, not just sent), and the customer id if so. |
consent |
The visitor's consent state plus the store's banner configuration — everything you need to render your own consent banner and call consentGive / consentWithdraw. |
localization |
The active locale, the store's baseline locale, and the resolved shopping country. resolvedBy tells you WHY: the domain, a header, or the default. |
currency |
The display currency your prices arrive in — code, symbol, and whether prices include tax. Prices arrive already converted; conversion mechanics are the platform's job, not yours. |
b2b |
B2B buyer state. Headless requests always see it inactive: B2B storefronts are hosted-only (see Hosted B2B only). |
Scope and what is deliberately NOT here#
runtimeContext requires the read:settings scope, and it is deliberately narrow: everything in the response is state a rendered storefront page would reveal anyway — your own session's expiry, your own customer id, public display configuration. Merchant policy internals (session durations, provider configuration, backend behaviors) are never exposed here or anywhere else on this API.