Endpoint & response reference
POST/api/shop/sessionmint — Bearer secret
DELETE/api/shop/session/:tokenrevoke — Bearer secret
In this demo, minting runs through the proxy at the paths above. In production the session is minted in the ADITUS core — the contract is identical. Both calls are server-to-server: your backend authenticates with your client's mint secret (generated in the ADITUS admin console) as a Bearer token. One mint per login is the normal pattern; the resulting token is all the browser ever sees.
You can try this exact flow with your own credentials in the integration tester — mint, mount, walk the journey.
Mint a session — request
HeaderValueMeaning
AuthorizationBearer <mint-secret>Your client's mint secret, generated in the ADITUS admin console. Server-side only — it must never be shipped to a browser or app bundle.
Content-Typeapplication/jsonThe body is a JSON object.
Body fieldTypeMeaning
publicKeystring · requiredThe publishable key the session is minted FOR. It must be the same key the micro-frontend mounts with — every later shop call is checked against it (403 on mismatch). The Bearer secret must belong to this key's client.
emailstring · optionalThe shop user the session acts as. Take it from YOUR authenticated server session (login/SSO cookie or JWT) — never from the browser request, or a visitor could obtain someone else's session. OMIT it to mint an ANONYMOUS session: the visitor can browse and fill the cart, but the micro-frontend blocks the step past the cart until your onUserRequired callback supplies a user-bound session (see the optional-user flow). A present but malformed email is still rejected (400).
externalUserIdstring · optionalYour own user id, stored with the session as metadata (useful for support and log correlation). Not interpreted by ADITUS.
ttlSecondsnumber · optionalSession lifetime in seconds. Default 20 minutes, capped at 24 hours. When it expires, shop calls return 401 session_expired — mint a fresh token then (e.g. via the onSessionExpired hook).
eventSlugstring · optionalFixes the journey's ENTRY POINT server-side: set, the micro-frontend starts directly on this event's article selection; omitted, it starts on the event overview. Because it is part of the minted session, the browser cannot manipulate it. Invalid characters yield 400 invalid_event_slug; a slug that resolves to no live event falls back to the event overview.
Mint a session — response (200)
FieldTypeMeaning
sessionTokenstringOpaque token (sess_…). Hand it to the browser and pass it to mount() as sessionToken; the micro-frontend sends it as X-Aditus-Session on every shop call. It contains no user data and cannot be decoded.
expiresAtnumberExpiry as a Unix timestamp in milliseconds. Purely informational for your own scheduling — the micro-frontend reacts to the 401 on its own.
Revoke a session
DELETE /api/shop/session/:token with the same Bearer secret — the secret must belong to the client the session was minted for. Call it on logout so the token dies with your own session. Response: { "revoked": true } (or false if the session had already expired). Revoking is idempotent and safe to fire-and-forget.
Errors are explicit
StatusCodeMeaning
503session_not_configuredminting is disabled for this client: no mint secret has been generated in the admin console yet.
401unauthorizedthe mint secret is wrong or missing. Check that the secret belongs to the client of exactly this public key (rotated secrets invalidate the old one immediately).
400invalid_public_keythe public key is malformed or not registered. It must look like pk_… and belong to a configured client.
400invalid_emailthe shop user email is missing or not a valid address.
400invalid_tokenthe session token in the revoke call is malformed. Pass exactly the sessionToken returned by the mint call.
429rate_limitedtoo many mint/revoke calls from your IP. Wait a minute and try again.
403public_key_invalidthe X-Aditus-Public-Key header is malformed. It must look like pk_… exactly as issued during onboarding.
403public_key_unknownthe X-Aditus-Public-Key is well-formed but not registered (or deactivated). Check for typos and that the key's client is active.
403public_key_origin_unresolvedthe request carried a publicKey but no usable Origin/Referer header, so the domain whitelist cannot be checked. Browsers send Origin automatically; server-side calls must not use the publicKey header.
403public_key_domain_not_allowedthe request's origin domain is not on this publicKey's whitelist. Add the domain during onboarding (or in the admin console) before going live on it.
401invalid_sessionthe shop call carried a malformed X-Aditus-Session token — never a silent fall-back to the demo user. Pass exactly the sessionToken (sess_…) returned by the mint call.
401session_expiredthe X-Aditus-Session token is unknown, revoked or expired — never a silent fall-back to the demo user. Mint a fresh session server-to-server.
403session_requires_public_keya session was sent without its X-Aditus-Public-Key header (origin pinning is mandatory once a session is in play).
403session_key_mismatchthe X-Aditus-Public-Key does not match the key the session was minted for.
403anonymous_sessionthe session was minted WITHOUT an email (anonymous) and only allows browsing and the cart. Registration, payment and checkout require a user-bound session — mint one via onUserRequired.