Hoppa till innehållet

Categories

Item categories — the catalogue tree items are filed under. Addressed by code; parentCode nests a category under another, so a tree is loaded parents-first.

4 anrop GET POST PATCH Bas-URL https://api.fluit.cloud/preview

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

GET /categories

List item categories

Returns categories ordered by code. `search` matches code and name, case-insensitively and on any part of the value.

Visa hela beskrivningen

The response is a paged envelope: `{ items, totalCount, page, pageSize, totalPages, hasPreviousPage, hasNextPage }`. `pageSize` defaults to 50 and is capped at 200. `parentCode` on each row is how the tree is read back — a root category has null.

categories:read

Frågeparametrar

Fält Typ Beskrivning
search string Case-insensitive partial match on code and name.
page integer
pageSize integer

Svar

200 PagedResult_PublicCategoryResponse

Paginerat svar: raderna nedan ligger i items[], omgivna av totalCount, page, pageSize, totalPages, hasPreviousPage och hasNextPage. Paginerad

Fält Typ Beskrivning
code Krävs string · nullable Business key. Stable, and what item rows reference.
createdDate string(date-time)
description string · nullable
isActive boolean
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
metaDescription string · nullable Description of the category page in search results. Null = the web shop uses the description.
metaTitle string · nullable Title of the category page in search results. Null = the web shop builds it from the name.
name Krävs string · nullable
parentCode string · nullable Code of the parent category, or null for a root category.
slug string · nullable URL segment used by the web shop.
sortOrder integer · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/categories"
Svar 200
{
  "hasNextPage": true,
  "hasPreviousPage": true,
  "items": [
    {
      "code": "string",
      "createdDate": "2026-06-11T09:24:13.418",
      "description": "string",
      "isActive": true,
      "links": {
        "self": "string"
      },
      "metaDescription": "string",
      "metaTitle": "string",
      "name": "Hand tools",
      "parentCode": "STD",
      "slug": "string",
      "sortOrder": 42
    }
  ],
  "page": 1,
  "pageSize": 50,
  "totalCount": 137,
  "totalPages": 3
}

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

POST /categories

Create an item category

Creates a category that items can be filed under. `code` is the business key: it is what `categoryCode` on an item row references, so it should be stable. `parentCode` nests the category under an existing one.

Visa hela beskrivningen

Load a tree parents-first — a parent that does not exist yet is rejected with 400 naming the field, not created implicitly. Known error codes: `ItemCategory.CodeNotUnique`, `categoryCode` (unknown parent).

categories:write Kräver Idempotency-Key

Body krävs

Fält Typ Beskrivning
code Krävs string Business key. Item rows reference this, so pick something stable.
description string · nullable Longer description, e.g. for a web shop category page.
name Krävs string Display name.
parentCode string · nullable Code of an existing category to nest this one under. Omit for a root category. Load a tree parents-first — a code that does not exist yet is rejected with 400.
slug string · nullable URL segment for the web shop. Defaults to the code.
sortOrder integer · nullable Sort order among its siblings.

Svar

201 PublicCategoryResponse
  • Location — URL of the newly created resource.
Fält Typ Beskrivning
code Krävs string · nullable Business key. Stable, and what item rows reference.
createdDate string(date-time)
description string · nullable
isActive boolean
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
metaDescription string · nullable Description of the category page in search results. Null = the web shop uses the description.
metaTitle string · nullable Title of the category page in search results. Null = the web shop builds it from the name.
name Krävs string · nullable
parentCode string · nullable Code of the parent category, or null for a root category.
slug string · nullable URL segment used by the web shop.
sortOrder integer · nullable
400 ProblemDetails The code is already taken, or parentCode does not exist.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X POST "https://api.fluit.cloud/preview/categories" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @body.json
Nested category
{
  "code": "FLOORSTANDING",
  "description": "Full-range speakers that stand on the floor.",
  "name": "Floorstanding speakers",
  "parentCode": "SPEAKERS",
  "slug": "floorstanding-speakers",
  "sortOrder": 10
}
Root category
{
  "code": "SPEAKERS",
  "name": "Speakers"
}
Svar 201
{
  "code": "string",
  "createdDate": "2026-06-11T09:24:13.418",
  "description": "string",
  "isActive": true,
  "links": {
    "self": "string"
  },
  "metaDescription": "string",
  "metaTitle": "string",
  "name": "Hand tools",
  "parentCode": "STD",
  "slug": "string",
  "sortOrder": 42
}

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

GET /categories/{code}

Get an item category

Returns one category by its code, in the same shape as POST /preview/categories.

categories:read Stödjer ETag

Sökvägsparametrar

Fält Typ Beskrivning
code Krävs string Code of the category.

Svar

200 PublicCategoryResponse
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
Fält Typ Beskrivning
code Krävs string · nullable Business key. Stable, and what item rows reference.
createdDate string(date-time)
description string · nullable
isActive boolean
links Links Hypermedia links for a public API resource. Exposed as a computed `links` property on the public response DTOs so that create and read responses carry the same self-reference — the canonical URL is derived from the business key already present on the DTO and can never drift from the route it points at.
metaDescription string · nullable Description of the category page in search results. Null = the web shop uses the description.
metaTitle string · nullable Title of the category page in search results. Null = the web shop builds it from the name.
name Krävs string · nullable
parentCode string · nullable Code of the parent category, or null for a root category.
slug string · nullable URL segment used by the web shop.
sortOrder integer · nullable
304 Tom body.
  • ETag — Weak validator for this representation. Pass it back in If-None-Match to get 304 Not Modified while the record is unchanged.
404 ProblemDetails No category with that code.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl "https://api.fluit.cloud/preview/categories/{code}"
Svar 200
{
  "code": "string",
  "createdDate": "2026-06-11T09:24:13.418",
  "description": "string",
  "isActive": true,
  "links": {
    "self": "string"
  },
  "metaDescription": "string",
  "metaTitle": "string",
  "name": "Hand tools",
  "parentCode": "STD",
  "slug": "string",
  "sortOrder": 42
}

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

PATCH /categories/{code}

Update an item category

Partially updates a category's name, description, slug, sort order and search-result texts. Only provided fields are updated (JSON Merge Patch semantics). Omitted fields are left unchanged.

Visa hela beskrivningen

Pass null to clear a nullable field. Unknown fields are rejected with 400, naming the field and listing the ones this endpoint accepts. code cannot be changed, because it is the resource's address and what item rows reference. name cannot be set to null. slug is normalized the same way as in the admin (lowercase, diacritics folded, spaces to hyphens). Changing it moves the category page to a new URL and automatically creates a 301 from the old address on every active channel, so incoming links and their ranking survive. Passing null makes the category fall back to its code as URL segment, with the same 301. metaTitle and metaDescription are what the category page shows in search results, translated per language like the name. Search engines cut titles around 60 characters and descriptions around 155; longer text is accepted (up to 200 and 500) but may be cut. Pass null to fall back to the name and description. Read the result back with GET /preview/categories/{code}.

categories:write

Sökvägsparametrar

Fält Typ Beskrivning
code Krävs string Code of the category to update.

Body krävs

Fält Typ Beskrivning
description string · nullable Longer description, e.g. for a web shop category page. Pass `null` to clear.
metaDescription string · nullable Description of the category page in search results. Aim for 155 characters or fewer. Pass `null` to fall back to the description.
metaTitle string · nullable Title of the category page in search results. Aim for 60 characters or fewer. Pass `null` to fall back to the name.
name string · nullable Display name. Cannot be null.
slug string · nullable URL segment for the web shop. Changing it records a 301 from the old address on every active channel. Pass `null` to fall back to the code.
sortOrder integer · nullable Sort order among its siblings. Pass `null` to clear.

Svar

204 Tom body.
400 ProblemDetails The body is not a JSON object, contains a field this endpoint does not have, a field present in it failed validation, name was sent as null, or slug contains no letter or digit.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
404 ProblemDetails No category with that code.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable
409 ProblemDetails ItemCategories.SlugNotUnique — another category already uses that slug.
Fält Typ
detail string · nullable
instance string · nullable
status integer · nullable
title string · nullable
type string · nullable

Standardfel: 401 403 Felhantering

Exempel

curl
curl -X PATCH "https://api.fluit.cloud/preview/categories/{code}" \
  -H "Content-Type: application/json" \
  -d @body.json
Svar 400
{
  "detail": "string",
  "instance": "string",
  "status": 42,
  "title": "string",
  "type": "string"
}

Bas-URL https://api.fluit.cloud/preview. 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.