Hoppa till innehållet

Session och kanal

Establishing context: map a domain to a tenant and channel, then open a session. The session response also carries the channel's whole configuration — currency, language, feature flags, branding, navigation and SEO — so a storefront can render its shell from one call.

2 anrop GET Bas-URL https://api.erp.fluit.cloud/ecom

Autentisering, felkoder, rate limits, idempotens och paginering gäller alla anrop och står samlade under Kom igång.

GET /session

Get or create session

Returns a session token and full channel context including branding, features, and analytics. Creates an EcomSession entity on first visit and reuses it on subsequent visits.

Headers

Fält Typ Beskrivning
X-Language string Language for translated content, as an ISO 639-1 code ("sv", "en"). Omitting it answers in the channel's default language, and so does a language the channel does not publish — this never fails the request. The channel decides which languages exist; read them from the session response.

Svar

200 EcomSessionResponse
Fält Typ Beskrivning
cartItemCount integer
channel SessionChannel
customer SessionCustomer
environmentLabel string · nullable
expiresAt string(date-time)
impersonation SessionImpersonation Vem som öppnat den här sessionen som kunden.
isAuthenticated boolean
isTestEnvironment boolean
token string · nullable
429 Rate limit exceeded. Wait the number of seconds given in Retry-After. The body is problem-shaped application/json, not application/problem+json. This API sends no X-RateLimit-* headers — the quota is discovered here.
  • Retry-After — Seconds to wait before retrying.

Standardfel: 404 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/ecom/session" \
  -H "Authorization: Bearer $SESSION_TOKEN" \
  -H "X-Tenant-Id: $FLUIT_TENANT_ID" \
  -H "X-Channel: web" \
  -H "X-Language: …"
Svar 200
{
  "cartItemCount": 42,
  "channel": {
    "analytics": {
      "analyticsEnabled": true,
      "customHeadScript": "string",
      "enhancedConversionsEnabled": true,
      "facebookPixelId": "string",
      "googleAdsConversionId": "string",
      "googleAdsPurchaseLabel": "string",
      "googleAnalyticsId": "string",
      "googleTagManagerId": "string"
    },
    "branding": {
      "accentColor": "string",
      "accentHoverColor": "string",
      "backgroundColor": "string",
      "borderRadius": "string",
      "customCss": "string",
      "faviconUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "fontBody": "string",
      "fontHeading": "string",
      "footerBackgroundColor": "string",
      "footerTextColor": "string",
      "headerBackgroundColor": "string",
      "headerTextColor": "string",
      "logoUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "primaryColor": "string",
      "primaryHoverColor": "string",
      "secondaryColor": "string",
      "storeName": "Fluit",
      "textColor": "string"
    },
    "code": "string",
    "currency": "string",
    "features": {
      "allowBackorderChoice": true,
      "allowBackorders": true,
      "allowCustomerVatToggle": true,
      "allowRequestedDeliveryDate": true,
      "enableAddToCartModal": true,
      "enableChatAssistant": true,
      "guestCheckout": true,
      "minimumOrderValue": "299.00",
      "requireLogin": true,
      "showCrossReferences": true,
      "showLowestPrice30Days": true,
      "showOutOfStockProducts": true,
      "showPricesIncludingVat": true,
      "showPricesWithoutLogin": true,
      "showSku": true,
      "showStock": true,
      "stockAggregation": "string"
    },
    "language": "string",
    "languages": [
      {
        "code": "string",
        "name": "White",
        "nativeName": "White"
      }
    ],
    "name": "Acme AB",
    "navigation": {
      "catalogMenuDepth": 42,
      "catalogMenuMode": "string",
      "catalogRootCategoryId": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
      "footerColumns": [
        {
          "html": "string",
          "links": [
            {}
          ],
          "sortOrder": 42,
          "title": "string"
        }
      ],
      "promiseBar": {
        "isEnabled": true,
        "items": [
          {
            "icon": "string",
            "text": "string"
          }
        ],
        "tone": "string"
      },
      "showCategorySidebar": true,
      "socialLinks": [
        {
          "platform": "string",
          "sortOrder": 42,
          "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg"
        }
      ],
      "topMenuLinks": [
        {
          "label": "string",
          "openInNewTab": true,
          "sortOrder": 42,
          "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg"
        }
      ]
    },
    "policies": {
      "applicableCountry": "string",
      "productFeedEnabled": true,
      "returns": {
        "enabled": true,
        "generateReturnLabel": true,
        "requireReason": true,
        "returnInstructions": "string",
        "returnWindowDays": 42,
        "shippingCost": "string"
      },
      "shipping": {
        "cheapestName": "Parcel, next day",
        "cheapestPrice": "299.00",
        "freeShippingThreshold": "299.00",
        "maxHandlingDays": 42,
        "maxTransitDays": 42,
        "minTransitDays": 42
      }
    },
    "seo": {
      "baseUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "metaDescription": "string",
      "metaTitle": "string",
      "redirectToPrimaryDomain": true,
      "robotsTxtExtra": "string",
      "searchEngineIndexingEnabled": true
    },
    "type": "string"
  },
  "customer": {
    "email": "order@acme.se",
    "id": "string",
    "name": "Acme AB"
  },
  "environmentLabel": "string",
  "expiresAt": "2026-06-11T09:24:13.418",
  "impersonation": {
    "by": "string",
    "startedAt": "2026-06-11T09:24:13.418"
  },
  "isAuthenticated": true,
  "isTestEnvironment": true,
  "token": "string"
}

Bas-URL https://api.erp.fluit.cloud/ecom. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

GET /session/resolve

Resolve domain to tenant

Maps a domain (e.g., shop.acme.com) to tenant and channel IDs. Returns routing info only — full channel data comes from GET /ecom/session. The answer depends only on the query, so it is cacheable and carries an ETag; follow the Cache-Control header instead of picking your own lifetime for it.

Stödjer ETag

Frågeparametrar

Fält Typ
domain string
channel string

Svar

200 ResolveDomainResponse
Fält Typ
channelCode string · nullable
channelName string · nullable
tenantId string · nullable
304 Not modified — the If-None-Match you sent still matches. No body.
429 Rate limit exceeded. Wait the number of seconds given in Retry-After. The body is problem-shaped application/json, not application/problem+json. This API sends no X-RateLimit-* headers — the quota is discovered here.
  • Retry-After — Seconds to wait before retrying.

Standardfel: 404 Felhantering

Exempel

curl
curl "https://api.erp.fluit.cloud/ecom/session/resolve"
Svar 200
{
  "channelCode": "STD",
  "channelName": "Acme AB",
  "tenantId": "string"
}

Bas-URL https://api.erp.fluit.cloud/ecom. Svarsexemplet är genererat ur schemat: formen stämmer, värdena är påhittade.

Scheman

Objekten som gruppens anrop refererar till. Fälttabellerna ovan går ett steg djupt och länkar hit i stället för att upprepa samma schema på varje endpoint.

ChannelLanguageOption

ChannelLanguageOption
Fält Typ
code string · nullable
name string · nullable
nativeName string · nullable

SessionAnalytics

EcomSessionAnalyticsResponse
Fält Typ
analyticsEnabled boolean
customHeadScript string · nullable
enhancedConversionsEnabled boolean
facebookPixelId string · nullable
googleAdsConversionId string · nullable
googleAdsPurchaseLabel string · nullable
googleAnalyticsId string · nullable
googleTagManagerId string · nullable

SessionBranding

EcomSessionBrandingResponse
Fält Typ
accentColor string · nullable
accentHoverColor string · nullable
backgroundColor string · nullable
borderRadius string · nullable
customCss string · nullable
faviconUrl string · nullable
fontBody string · nullable
fontHeading string · nullable
footerBackgroundColor string · nullable
footerTextColor string · nullable
headerBackgroundColor string · nullable
headerTextColor string · nullable
logoUrl string · nullable
primaryColor string · nullable
primaryHoverColor string · nullable
secondaryColor string · nullable
storeName string · nullable
textColor string · nullable

SessionChannel

EcomSessionChannelResponse
Fält Typ Beskrivning
analytics SessionAnalytics
branding SessionBranding
code string · nullable
currency string · nullable
features SessionFeatures
language string · nullable
languages ChannelLanguageOption[] · nullable
name string · nullable
navigation SessionNavigation
policies SessionPolicies Retur- och fraktvillkor för kanalen. Butiken använder dem för schema.org hasMerchantReturnPolicy/shippingDetails och för produktfeedens g:shipping, så att produktsidan inte behöver ett extra anrop.
seo SessionSeo Kanalens SEO-standardvärden. Används av storefronten som fallback för sidor som saknar egen meta title/description.
type string · nullable

SessionCustomer

EcomSessionCustomerResponse
Fält Typ
email string · nullable
id string · nullable
name string · nullable

SessionFeatures

EcomSessionFeaturesResponse
Fält Typ
allowBackorderChoice boolean
allowBackorders boolean
allowCustomerVatToggle boolean
allowRequestedDeliveryDate boolean
enableAddToCartModal boolean
enableChatAssistant boolean
guestCheckout boolean
minimumOrderValue decimal · nullable
requireLogin boolean
showCrossReferences boolean
showLowestPrice30Days boolean
showOutOfStockProducts boolean
showPricesIncludingVat boolean
showPricesWithoutLogin boolean
showSku boolean
showStock boolean
stockAggregation string · nullable

SessionFooterColumn

EcomSessionFooterColumnResponse
Fält Typ Beskrivning
html string · nullable Fritext (HTML) ovanför länkarna — adress, kontaktuppgifter, öppettider. Saneras i storefrontens API-klient innan den renderas.
links SessionMenuLink[] · nullable
sortOrder integer
title string · nullable

SessionImpersonation

EcomSessionImpersonationResponse

Vem som öppnat den här sessionen som kunden.

Fält Typ
by string · nullable
startedAt string(date-time)

SessionMenuLink

EcomSessionMenuLinkResponse
Fält Typ
label string · nullable
openInNewTab boolean
sortOrder integer
url string · nullable

SessionNavigation

EcomSessionNavigationResponse
Fält Typ Beskrivning
catalogMenuDepth integer
catalogMenuMode string · nullable
catalogRootCategoryId string(uuid) · nullable
footerColumns SessionFooterColumn[] · nullable
promiseBar SessionPromiseBar
showCategorySidebar boolean
socialLinks SessionSocialLink[] · nullable Sociala kanaler som ikoner i footern. Ligger under navigation eftersom det är där storefronten läser dem (`+layout.svelte`).
topMenuLinks SessionMenuLink[] · nullable

SessionPolicies

EcomSessionPoliciesResponse

Retur- och fraktvillkor för kanalen. Butiken använder dem för schema.org hasMerchantReturnPolicy/shippingDetails och för produktfeedens g:shipping, så att produktsidan inte behöver ett extra anrop.

Fält Typ Beskrivning
applicableCountry string · nullable
productFeedEnabled boolean
returns SessionReturnPolicy
shipping SessionShippingPolicy Sammanfattning av kanalens billigaste leveranssätt. Leveranssätt som prissätts via fraktprislista saknar fast pris och utesluts — ett gissat fraktpris i feeden är värre än inget alls.

SessionPromiseBar

EcomSessionPromiseBarResponse
Fält Typ Beskrivning
isEnabled boolean Om butiken har slagit på raden.
items SessionPromiseBarItem[] · nullable Löftena i visningsordning. Tom lista när butiken inte fyllt i några — raden ritas då inte alls, oavsett IsEnabled.
tone string · nullable "Ink", "Brand" eller "Accent".

SessionPromiseBarItem

EcomSessionPromiseBarItemResponse
Fält Typ Beskrivning
icon string · nullable Ikonnamn ur butikens kurerade set, eller null.
text string · nullable Löftet som besökaren läser det.

SessionReturnPolicy

EcomSessionReturnPolicyResponse
Fält Typ
enabled boolean
generateReturnLabel boolean
requireReason boolean
returnInstructions string · nullable
returnWindowDays integer
shippingCost string · nullable

SessionSeo

EcomSessionSeoResponse

Kanalens SEO-standardvärden. Används av storefronten som fallback för sidor som saknar egen meta title/description.

Fält Typ
baseUrl string · nullable
metaDescription string · nullable
metaTitle string · nullable
redirectToPrimaryDomain boolean
robotsTxtExtra string · nullable
searchEngineIndexingEnabled boolean

SessionShippingPolicy

EcomSessionShippingPolicyResponse

Sammanfattning av kanalens billigaste leveranssätt. Leveranssätt som prissätts via fraktprislista saknar fast pris och utesluts — ett gissat fraktpris i feeden är värre än inget alls.

Fält Typ
cheapestName string · nullable
cheapestPrice decimal · nullable
freeShippingThreshold decimal · nullable
maxHandlingDays integer
maxTransitDays integer · nullable
minTransitDays integer · nullable

SessionSocialLink

EcomSessionSocialLinkResponse
Fält Typ
platform string · nullable
sortOrder integer
url string · nullable