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.

3 anrop GET POST 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.
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"
      },
      "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.
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"
  },
  "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.
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"
  },
  "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.

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.