Location Type Codes
Standardized location type codes for categorizing different types of locations within supply chain operations.
The ref_location_type_codes Object
Location type codes collection provides standardized categories for different types of physical locations and facilities used in supply chain tracking and management.
| Field Name | Type | Description |
|---|---|---|
code | string | Primary key. Unique identifier code for the location type (e.g., "WAREHOUSE", "RETAIL_STORE"). |
status | string | Record status. Default: "draft". Values: "draft", "published". |
user_created | object | User who created the location type record. Read-only. Links to directus_users. |
date_created | datetime | Timestamp in ISO 8601 when the location type record was created. Read-only. |
user_updated | object | User who last updated the location type record. Read-only. Links to directus_users. |
date_updated | datetime | Timestamp in ISO 8601 when the location type record was last updated. Read-only. |
location_type | string | Human-readable description of the location type. |
background | string | Background color for UI display purposes. |
foreground | string | Foreground color for UI display purposes. |
List Location Type Codes
List existing location type codes.
- REST
- GraphQL
GET /items/ref_location_type_codes
query {
ref_location_type_codes {
code
location_type
status
background
foreground
date_created
date_updated
}
}
Query Parameters
Supports all global query parameters.
Returns
An array of up to limit location type codes objects. If no items are available, data will be an empty array.
Retrieve a Location Type Code
Retrieve a specific location type code by code.
- REST
- GraphQL
GET /items/ref_location_type_codes/:code
query {
ref_location_type_codes_by_id(id: "location_type_code") {
code
location_type
status
background
foreground
user_created {
id
first_name
last_name
}
date_created
user_updated {
id
first_name
last_name
}
date_updated
}
}
Returns
Returns a location type codes object if a valid code was provided.
Create a Location Type Code
Create a new location type code.
- REST
- GraphQL
POST /items/ref_location_type_codes
{
"code": "CUSTOM_FACILITY",
"location_type": "Custom Facility Type",
"status": "draft",
"background": "#E3F2FD",
"foreground": "#1976D2"
}
mutation {
create_ref_location_type_codes_item(data: {
code: "CUSTOM_FACILITY"
location_type: "Custom Facility Type"
status: "draft"
background: "#E3F2FD"
foreground: "#1976D2"
}) {
code
location_type
status
background
foreground
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial location type codes object.
Returns
Returns the location type codes object for the created location type code.
Update a Location Type Code
Update an existing location type code.
- REST
- GraphQL
PATCH /items/ref_location_type_codes/:code
{
"location_type": "Updated Facility Type",
"status": "published"
}
mutation {
update_ref_location_type_codes_item(id: "location_type_code", data: {
location_type: "Updated Facility Type"
status: "published"
}) {
code
location_type
status
}
}
Query Parameters
Supports all global query parameters.
Request Body
A partial location type codes object.
Returns
Returns the location type codes object for the updated location type code.
Delete a Location Type Code
Delete an existing location type code.
- REST
- GraphQL
DELETE /items/ref_location_type_codes/:code
mutation {
delete_ref_location_type_codes_item(id: "location_type_code") {
code
}
}
Returns
Empty body.
Sample Data
| Code | Location Type | Status |
|---|---|---|
| ACCOUNTS_DEPARTMENT | Accounts Department | draft |
| AGED_CARE_SERVICE | Aged Care Service | draft |
| AIRCRAFT | Aircraft | draft |
| AIRPORT | Airport | draft |
| AIRPORT_GATE | Airport Gate | draft |