Skip to main content
POST
/
graphql#ListStorageUnits
List storage units
curl --request POST \
  --url 'https://clarus-api.com/graphql#ListStorageUnits' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "query": "query($filter: StorageUnitFilterType) { storage_units { all(filter: $filter) { edges { node { id reference active dispatched dispatched_at created_at storage_unit_type { id code name } warehouse { id code name } } } } } }"
}
'
{
  "data": {
    "storage_units": {
      "all": {
        "edges": [
          {
            "node": {
              "id": "1",
              "reference": "PLT-001",
              "active": true,
              "dispatched": false,
              "dispatched_at": null,
              "created_at": "2026-03-10T08:00:00Z",
              "storage_unit_type": {
                "id": "1",
                "code": "PLT",
                "name": "Pallet"
              },
              "warehouse": {
                "id": "1",
                "code": "WH1",
                "name": "Main Warehouse"
              }
            }
          }
        ]
      }
    }
  }
}

Query Structure

query($filter: StorageUnitFilterType) {
  storage_units {
    all(filter: $filter) {
      edges {
        node {
          id
          reference
          active
          dispatched
          dispatched_at
          created_at
          storage_unit_type {
            id
            code
            name
          }
          warehouse {
            id
            code
            name
          }
        }
      }
    }
  }
}

Filter Argument

All filters are passed inside the filter argument. Each filter field accepts an input object with operators:
{
  "filter": {
    "reference": {
      "ilike": "PLT-001"
    }
  }
}

Available Filters

FilterInput TypeOperatorsDescription
referenceStringInputTypeeq, ilike, like, in, betweenStorage unit reference/barcode
activeBooleanInputTypeeqFilter by active status
dispatchedBooleanInputTypeeqFilter dispatched/undispatched units
storage_unit_type_codeStringInputTypeeq, ilike, like, in, betweenStorage unit type code
warehouse_idIdInputTypeeq, gt, gteq, lt, lteq, in, filledFilter by warehouse ID

Filter Operators

Input TypeOperators
StringInputTypeeq (exact), ilike (case-insensitive partial), like (case-sensitive partial), in (array match), between (range)
IntegerInputTypeeq, gt, gteq, lt, lteq, between
DatetimeInputTypeeq, from, to, between
BooleanInputTypeeq (required)
IdInputTypeeq, gt, gteq, lt, lteq, in, filled
More fields and filters available via GraphQL introspection.

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
query
string<textarea>
required

GraphQL query string

Example:

"query($filter: StorageUnitFilterType) { storage_units { all(filter: $filter) { edges { node { id reference active dispatched dispatched_at created_at storage_unit_type { id code name } warehouse { id code name } } } } } }"

variables
object

Query variables including the filter object

Example:
{
"filter": { "reference": { "ilike": "PLT-001" } }
}

Response

Successful GraphQL response

data
object

Query result data

errors
object[]

GraphQL errors, if any