Skip to content
← Back to Index

inventories

Inventories are defined in the registry and represent physical or logical stock locations. Each inventory has a unique key and a display label.

Each inventory key can only contain a-z, 0-9, and _. The first character must be non-numeric.

Properties

PropertyTypeDescription
labelstring or objectDisplay label for the inventory. Can be a simple string or a localized object with locale keys (e.g., default, sv).
addressobjectOptional postal address for the inventory location. Uses the conventional Address shape. All sub-fields are optional and partial addresses are allowed. Useful for shipping labels, customs documentation, and carrier integrations.

Additional properties may be added by installed apps. By convention, apps prefix their fields with their app name to avoid collisions (e.g., nshift_warehouseId).

Inventories automatically provide enum values for inventoryKey fields on deliveries and stock positions. The label is used as the dropdown display text. Custom graph fields may reference inventories by specifying values: "inventories".

Address

The optional address field follows the conventional Hantera Address shape. All fields are strings and all are optional:

FieldDescription
nameRecipient or location name (e.g. "Hantera Logistics AB")
careOf"C/O" line
addressLine1Primary street address
addressLine2Secondary street address
postalCodePostal or ZIP code
cityCity
stateState or region (where applicable)
countryCodeISO 3166-1 alpha-2 country code (uppercase)
emailContact email for this location
phoneContact phone for this location

Partial addresses are allowed — only set the fields that are known. If every field is empty, omit address entirely rather than storing an empty object.

Example

yaml
uri: /registry/inventories/wh_stockholm
spec:
  value:
    label: Warehouse Stockholm

With localization:

yaml
uri: /registry/inventories/wh_stockholm
spec:
  value:
    label:
      default: Warehouse Stockholm
      sv: Lager Stockholm

With address:

yaml
uri: /registry/inventories/wh_stockholm
spec:
  value:
    label: Warehouse Stockholm
    address:
      name: Hantera Logistics AB
      addressLine1: Storgatan 1
      postalCode: '111 22'
      city: Stockholm
      countryCode: SE
      email: [email protected]
      phone: '+46 8 123 45 67'

© 2024 Hantera AB. All rights reserved.