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",
      "imageBackground": "string",
      "logoUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "primaryColor": "string",
      "primaryHoverColor": "string",
      "secondaryColor": "string",
      "storeName": "Fluit",
      "textColor": "string"
    },
    "businessProfile": {
      "city": "Stockholm",
      "companyName": "Acme AB",
      "countryCode": "SE",
      "email": "order@acme.se",
      "latitude": "299.00",
      "longitude": "299.00",
      "openingHours": [
        {
          "closes": "string",
          "days": [
            "string"
          ],
          "opens": "string"
        }
      ],
      "organizationNumber": "ABC-001",
      "phone": "+46 8 123 45 67",
      "postalCode": "11122",
      "schemaType": "string",
      "showInFooter": true,
      "streetAddress": "string"
    },
    "code": "string",
    "currency": "string",
    "features": {
      "allowBackorderChoice": true,
      "allowBackorders": true,
      "allowCustomerVatToggle": true,
      "allowRequestedDeliveryDate": true,
      "commerceEnabled": true,
      "enableAddToCartModal": true,
      "enableChatAssistant": true,
      "guestCheckout": true,
      "minimumOrderValue": "299.00",
      "requireLogin": true,
      "showCrossReferences": true,
      "showListPriceAndDiscount": 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,
      "catalogMenuLabel": "string",
      "catalogMenuMode": "string",
      "catalogMenuSortOrder": 42,
      "catalogRootCategoryId": "0f8b2c1e-4d3a-4b7e-9f10-2a6c5d8e1b44",
      "chrome": {
        "footerLogoUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
        "footerNewsletter": {
          "isEnabled": true,
          "text": "string",
          "title": "string"
        },
        "headerLayout": "string",
        "logoSize": "string",
        "mobileActionBar": {
          "buttons": [
            {}
          ],
          "isEnabled": true
        },
        "mobileSearch": "string",
        "showLogoInFooter": true
      },
      "footerColumns": [
        {
          "html": "string",
          "links": [
            {}
          ],
          "sortOrder": 42,
          "title": "string"
        }
      ],
      "promiseBar": {
        "isEnabled": true,
        "items": [
          {
            "icon": "string",
            "text": "string"
          }
        ],
        "narrowBehavior": "string",
        "tone": "string"
      },
      "reservedSlugs": [
        "string"
      ],
      "showCategorySidebar": true,
      "socialLinks": [
        {
          "platform": "string",
          "sortOrder": 42,
          "url": "https://cdn.fluit.cloud/assets/widget-a-front.jpg"
        }
      ],
      "topMenuLinks": [
        {
          "children": [
            null
          ],
          "label": "string",
          "openInNewTab": true,
          "showAsButton": 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
      }
    },
    "productCard": {
      "hover": "string",
      "imageFit": "string",
      "imageRatio": "string",
      "keySpecRows": 42,
      "mobileColumns": 42,
      "showAddToCart": true,
      "showBrand": true,
      "showCompare": true,
      "showStock": true,
      "showVatNote": true
    },
    "seo": {
      "baseUrl": "https://cdn.fluit.cloud/assets/widget-a-front.jpg",
      "metaDescription": "string",
      "metaTitle": "string",
      "redirectToPrimaryDomain": true,
      "robotsTxtExtra": "string",
      "searchEngineIndexingEnabled": true
    },
    "type": "string"
  },
  "customer": {
    "canPlaceOrders": true,
    "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

SessionActionButton

EcomSessionActionButtonResponse
Fält Typ
label string · nullable
url 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
imageBackground string · nullable
logoUrl string · nullable
primaryColor string · nullable
primaryHoverColor string · nullable
secondaryColor string · nullable
storeName string · nullable
textColor string · nullable

SessionBusinessProfile

EcomSessionBusinessProfileResponse

Företagsuppgifter att visa för besökare.

Fält Typ Beskrivning
city string · nullable
companyName string · nullable
countryCode string · nullable
email string · nullable
latitude decimal · nullable
longitude decimal · nullable
openingHours SessionOpeningHours[] · nullable
organizationNumber string · nullable
phone string · nullable
postalCode string · nullable
schemaType string · nullable schema.org-typ för strukturerad data, t.ex. `AutoRepair`. Tom ger `LocalBusiness` eller `Organization`.
showInFooter boolean Visa namn, adress och kontaktuppgifter i sidfoten.
streetAddress string · nullable

SessionChannel

EcomSessionChannelResponse
Fält Typ Beskrivning
analytics SessionAnalytics
branding SessionBranding
businessProfile SessionBusinessProfile Företagsuppgifter att visa för besökare.
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.
productCard SessionProductCard
seo SessionSeo Kanalens SEO-standardvärden. Används av storefronten som fallback för sidor som saknar egen meta title/description.
type string · nullable

SessionChrome

EcomSessionChromeResponse
Fält Typ Beskrivning
footerLogoUrl string · nullable Logon i sidfoten. Null ger butikens vanliga logo.
footerNewsletter SessionFooterNewsletter
headerLayout string · nullable "Standard" eller "Inline".
logoSize string · nullable "Small", "Medium" eller "Large".
mobileActionBar SessionMobileActionBar
mobileSearch string · nullable "Row" eller "Icon".
showLogoInFooter boolean

SessionCustomer

EcomSessionCustomerResponse
Fält Typ Beskrivning
canPlaceOrders boolean Falskt när kontaktens portalgrupper eller rollen Läsare inte ger rätt att lägga order.
email string · nullable
id string · nullable
name string · nullable

SessionFeatures

EcomSessionFeaturesResponse
Fält Typ
allowBackorderChoice boolean
allowBackorders boolean
allowCustomerVatToggle boolean
allowRequestedDeliveryDate boolean
commerceEnabled boolean
enableAddToCartModal boolean
enableChatAssistant boolean
guestCheckout boolean
minimumOrderValue decimal · nullable
requireLogin boolean
showCrossReferences boolean
showListPriceAndDiscount 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

SessionFooterNewsletter

EcomSessionFooterNewsletterResponse
Fält Typ
isEnabled boolean
text string · nullable
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 Beskrivning
children SessionMenuLink[] · nullable Undermeny, en nivå. Tom för länkar i en undermeny och i sidfoten.
label string · nullable
openInNewTab boolean
showAsButton boolean Rita länken som en knapp i sidhuvudet. Bara på toppmenyns översta nivå.
sortOrder integer
url string · nullable

SessionMobileActionBar

EcomSessionMobileActionBarResponse
Fält Typ Beskrivning
buttons SessionActionButton[] · nullable
isEnabled boolean Sant bara när raden är påslagen och har minst en knapp.

SessionNavigation

EcomSessionNavigationResponse
Fält Typ Beskrivning
catalogMenuDepth integer
catalogMenuLabel string · nullable
catalogMenuMode string · nullable
catalogMenuSortOrder integer
catalogRootCategoryId string(uuid) · nullable
chrome SessionChrome
footerColumns SessionFooterColumn[] · nullable
promiseBar SessionPromiseBar
reservedSlugs string[] · nullable Första segment som butikens egna routes använder. En innehållssida kan aldrig heta så, så allt annat på roten är en sida (se `GET /ecom/pages/resolve`).
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

SessionOpeningHours

EcomSessionOpeningHoursResponse
Fält Typ Beskrivning
closes string · nullable Stänger, `HH:mm`.
days string[] · nullable Veckodagar på engelska, som schema.org skriver dem (`Monday` …).
opens string · nullable Öppnar, `HH:mm`.

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.

SessionProductCard

EcomSessionProductCardResponse
Fält Typ Beskrivning
hover string · nullable "Zoom", "SecondImage" eller "None".
imageFit string · nullable "Cover" eller "Contain".
imageRatio string · nullable "Landscape" (4:3), "Square" (1:1), "Portrait" (4:5) eller "Wide" (3:2).
keySpecRows integer Antal nyckeldata i rutnätets kort, 0–4.
mobileColumns integer Kort per rad i produktlistor på smal skärm, 1 eller 2.
showAddToCart boolean Av: kortet har ingen köpyta och länkar bara till produktsidan.
showBrand boolean
showCompare boolean
showStock boolean
showVatNote boolean

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.
narrowBehavior string · nullable "Scroll" eller "Rotate".
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