Open Inventory / Docs
EndpunkteInventory structureInventory types

Create an inventory type

Die API läuft auf deiner Anwendungsinstanz. Schemas und Feldnamen stammen unverändert aus der OpenAPI-Spezifikation. Browsergebundene Aufrufe benötigen eine Sitzung auf der Instanz.

POST
/inventory-types

Requires an authenticated administrator browser session. Type keys are stable identifiers used by inventory records.

Authentifizierung

adminSession
cookieauthjs.session-token<token>

Authenticated Auth.js browser session cookie; each operation declares its required permission. Not restricted to administrators. HTTPS deployments use the secure-prefixed cookie variant.

Header-Parameter

X-Organization-ID?string

Organization membership selected for this request. User-bound credentials may select any active membership; standalone tokens may only repeat their pinned organization ID.

Formatuuid

Anfrageinhalt

application/json
  1. body
key*string

Stable key of an administrator-configurable inventory type.

Muster^[a-z][a-z0-9_-]{0,63}$
Länge1 <= length <= 64
label*string
Länge1 <= length <= 120
description?string
Längelength <= 5000
Standard""
color?string
Länge1 <= length <= 32
Standard"#635bff"
icon?string
Länge1 <= length <= 80
Standard"box"
canContain?boolean

Records of this type can be used as parents and structured stock locations.

Standardfalse
spatialContainment?boolean

Automatically derive containment from map polygons. Requires canContain.

Standardfalse
position?integer
Bereich0 <= value <= 100000
Standard0

Antwortinhalt

Inventory type created

application/json
  1. response
type*
Beispielanfrage
curl -X POST 'https://inventory.example.com/api/v1/inventory-types' \  -H 'Content-Type: application/json' \  -d '{  "key": "string",  "label": "string"}'
Beispielantwort
{  "type": {    "key": "string",    "label": "string",    "description": "string",    "color": "string",    "icon": "string",    "canContain": true,    "spatialContainment": true,    "position": 0,    "isSystem": true,    "createdBy": "string",    "updatedBy": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "archivedAt": "2019-08-24T14:15:22Z"  }}