Skip to main content

Warehouses

5 API calls in this section.

APIs for managing warehouses in the system

List Warehouses​

Warehousing / Warehouses
GET/warehousing/warehouses

Retrieves a list of warehouses with optional filtering and pagination. Returns warehouses with their address information.

  • User must have 'view:tenant' or 'manage:operations:tenant' permission

Response

  • Returns a paginated list of warehouses

  • Includes address information for each warehouse

  • Provides pagination information (total count, current page, limit)

List warehouses with pagination, sorting, column filters and stats.

Query parameters

ParameterTypeDescription
pageOptionalstring

Page number (default: 1) Page number for pagination (default: 1)

Example: 1

limitOptionalstring

Items per page (default: 10) Number of items per page (default: 10)

Example: 10

statusOptionalstring

Legacy: filter by status (active|inactive|maintenance|full) Filter by warehouse status (e.g., active, inactive, maintenance)

codeOptionalstring

Legacy: exact code filter Filter by warehouse code

searchOptionalstring

Search by name or code (ILIKE) Search warehouses by name or code

sort_bystring

Sort column: name | code | status | total_capacity | available_capacity | created_at (default)

sort_orderstring

asc or desc (default: desc). Overridden by total_capacity_order/available_capacity_order if set.

Example: desc

column_filtersstring

JSON object. Keys: name (ILIKE), code (ILIKE), status (exact), access_mode (exact: all_users|exclude_users|select_users), total_capacity (number or {min?,max?}), available_capacity (number or {min?,max?}), created_at ({from?,to?}). Example: {"status":"active","total_capacity":{"min":100}}

total_capacity_orderOptionalstring

Legacy sort: asc|desc (takes precedence over sort_by) Sort by total_capacity. Values: asc | desc

available_capacity_orderOptionalstring

Legacy sort: asc|desc (takes precedence over sort_by) Sort by available_capacity. Values: asc | desc

customer_idOptionalstring

Filter by customer access mapping (business user_id). Applied implicitly for customer-role users. Apply customer-based access filter (user_id as customer_id). If the current user is a business customer or has no role, filtering is applied implicitly.

carrier_codestring

When provided, returns carrier_config_present + external_integration per warehouse

tenant_idstring

Tenant ID (optional if in auth token) (required if not in auth): UUID of the tenant

languagestring

Example: en

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/warehousing/warehouses?page=1&limit=10&status=&code=&search=&sort_by=&sort_order=desc&column_filters=&total_capacity_order=&available_capacity_order=&customer_id=&tenant_id=&language=en" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}"

Response examples

200OK
Response body
json
1{2  "success": true,3  "message": "warehouses_retrieved_successfully",4  "warehouses": [5    {6      "id": "uuid",7      "tenant_id": "uuid",8      "name": "Main Distribution Center",9      "code": "WH001",10      "status": "active",11      "access_mode": "all_users",12      "total_capacity": 10000,13      "available_capacity": 7500,14      "created_at": "2025-01-15T08:00:00Z",15      "address": {16        "id": "uuid",17        "full_address": "123 Warehouse Blvd",18        "city": "Metropolis",19        "country": "US",20        "latitude": 40.7128,21        "longitude": -74.00622      }23    }24  ],25  "page": 1,26  "limit": 10,27  "total": 42,28  "stats": {29    "totalWarehouses": 50,30    "activeCount": 35,31    "maintenanceCount": 5,32    "inactiveCount": 10,33    "totalCapacity": 500000,34    "availableCapacity": 32000035  }36}

Create Warehouse​

Warehousing / Warehouses
POST/warehousing/warehouses

Creates a new warehouse with specified details including address, capacity, access control, and special features.

  • User must have 'manage:operations:tenant' permission

Business Rules

  • Warehouse code must be unique within a tenant

  • Address must exist and belong to the specified tenant

  • If total_capacity is provided but available_capacity is not, available_capacity will default to total_capacity

  • If features are provided, they must only contain valid feature keys

  • When access_mode is select_users, only mapped user_ids can access; when exclude_users, all except provided user_ids can access

  • user_ids must belong to business users of the tenant; otherwise request fails with invalid_customer_ids

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
namestring—
codestring—
address_idstring—
statusstring—
total_capacitynumber—
available_capacitynumber—
featuresobject—
features.climate_controlboolean—
features.security_levelstring—
features.dock_doorsnumber—
features.hazardous_materialsboolean—
features.refrigerationboolean—
Show 3 more body fields

Additional body parameters

ParameterTypeDescription
features.cross_dockingboolean—
access_modestring—
user_idsarray—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/warehousing/warehouses?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "name": "Main Distribution Center",6  "code": "WH001",7  "address_id": "{{address_id}}",8  "status": "active",9  "total_capacity": 10000,10  "available_capacity": 7500,11  "features": {12    "climate_control": true,13    "security_level": "high",14    "dock_doors": 12,15    "hazardous_materials": false,16    "refrigeration": true,17    "cross_docking": true18  },19  "access_mode": "all_users",20  "user_ids": []21}'

Replace {{placeholders}} with your own values before sending.

Other request examples (1)
Request example 1
text
1{2  "name": "string", // required - name of the warehouse3  "code": "string", // required - unique identifier code4  "address_id": "uuid", // required - reference to an existing address5  "status": "string", // optional - defaults to "active"6  "total_capacity": number, // optional - total storage capacity7  "available_capacity": number, // optional - available storage capacity8  "features": { // optional - special warehouse features9    "climate_control": boolean,10    "security_level": string,11    "dock_doors": number,12    "hazardous_materials": boolean,13    "refrigeration": boolean,14    "cross_docking": boolean15  },16  "access_mode": "all_users|select_users|exclude_users", // optional - defaults to all_users17  "user_ids": ["uuid", ...] // required when access_mode is select_users or exclude_users (business users only)18}

Response examples

201Success Response
Response body
json
1{2  "success": true,3  "message": "Warehouse created successfully",4  "warehouse": {5    "id": "warehouse-uuid",6    "tenant_id": "tenant-uuid",7    "name": "Main Distribution Center",8    "code": "WH001",9    "address_id": "address-uuid",10    "status": "active",11    "total_capacity": 10000,12    "available_capacity": 7500,13    "features": {14      "climate_control": true,15      "security_level": "high",16      "dock_doors": 12,17      "hazardous_materials": false,18      "refrigeration": true,19      "cross_docking": true20    },21    "created_at": "2023-06-01T10:00:00Z",22    "updated_at": "2023-06-01T10:00:00Z",23    "deleted_at": null24  }25}

Get Warehouse​

Warehousing / Warehouses
GET/warehousing/warehouses/:id

Retrieves detailed information about a specific warehouse, including its address information.

  • User must have 'view:tenant' or 'manage:operations:tenant' permission

Response

  • Returns detailed warehouse information

  • Includes warehouse.address.title as the stored localized title object, alongside the existing address fields

  • Contains feature specifications and capacity information

Frontend integration contract

  • Read the address label from warehouse.address.title using the frontend's existing localized-object handling. No request fields, actions, IDs, navigation behavior, or error handling changed.

Path parameters

ParameterTypeDescription
idRequiredstring

UUID of the warehouse to retrieve (required)

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/warehousing/warehouses/${ID}?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

200Success Response
Response body
json
1{2  "success": true,3  "message": "Warehouse retrieved successfully",4  "warehouse": {5    "id": "warehouse-uuid",6    "tenant_id": "tenant-uuid",7    "name": "Main Distribution Center",8    "code": "WH001",9    "address_id": "address-uuid",10    "status": "active",11    "total_capacity": 10000,12    "available_capacity": 7500,13    "features": {14      "climate_control": true,15      "security_level": "high",16      "dock_doors": 12,17      "hazardous_materials": false,18      "refrigeration": true,19      "cross_docking": true20    },21    "created_at": "2023-06-01T10:00:00Z",22    "updated_at": "2023-06-01T10:00:00Z",23    "deleted_at": null,24    "address": {25      "id": "address-uuid",26      "title": {27        "en": "Main Distribution Center"28      },29      "full_address": "123 Warehouse Blvd, Industrial District",30      "city": "Metropolis",31      "country": "US",32      "latitude": 40.7128,33      "longitude": -74.00634    }35  }36}

Update Warehouse​

Warehousing / Warehouses
PUT/warehousing/warehouses/:id

Updates an existing warehouse with new information. Only the fields included in the request will be updated.

  • User must have 'manage:operations:tenant' permission

Business Rules

  • Warehouse must exist and belong to the specified tenant

  • Address ID cannot be null or empty

  • If a new address ID is provided, it must exist and belong to the tenant

  • If code is provided, it must be unique within the tenant (not used by another warehouse)

  • Only valid feature fields are allowed in the features object

  • If access_mode is select/exclude, user_ids are required and must refer to business users in the tenant

  • Updated timestamp is automatically set to current time

Path parameters

ParameterTypeDescription
idRequiredstring

UUID of the warehouse to update (required)

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
namestring—
codestring—
address_idstring—
statusstring—
total_capacitynumber—
available_capacitynumber—
featuresobject—
features.climate_controlboolean—
features.security_levelstring—
features.dock_doorsnumber—
features.hazardous_materialsboolean—
features.refrigerationboolean—
Show 3 more body fields

Additional body parameters

ParameterTypeDescription
features.cross_dockingboolean—
access_modestring—
user_idsarray<string>—
Staging
Request
curl
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/warehousing/warehouses/${ID}?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "name": "Updated Distribution Center",6  "code": "WH001-UPDATED",7  "address_id": "{{new_address_id}}",8  "status": "maintenance",9  "total_capacity": 12000,10  "available_capacity": 9000,11  "features": {12    "climate_control": true,13    "security_level": "maximum",14    "dock_doors": 15,15    "hazardous_materials": true,16    "refrigeration": true,17    "cross_docking": true18  },19  "access_mode": "select_users",20  "user_ids": [21    "{{customer_id_1}}",22    "{{customer_id_2}}"23  ]24}'

Replace {{placeholders}} with your own values before sending.

Other request examples (1)
Request example 1
text
1{2  // All fields are optional for updates except address_id3  "name": "string",4  "code": "string",5  "address_id": "uuid", // Cannot be set to null6  "status": "string",7  "total_capacity": number,8  "available_capacity": number,9  "features": {10    "climate_control": boolean,11    "security_level": string,12    "dock_doors": number,13    "hazardous_materials": boolean,14    "refrigeration": boolean,15    "cross_docking": boolean16  },17  "access_mode": "all_users|select_users|exclude_users", // optional - if provided, validated against enum18  "user_ids": ["uuid", ...] // required when effective access_mode is select_users or exclude_users19}

Response examples

200Success Response
Response body
json
1{2  "success": true,3  "message": "Warehouse updated successfully",4  "warehouse": {5    "id": "warehouse-uuid",6    "tenant_id": "tenant-uuid",7    "name": "Updated Distribution Center",8    "code": "WH001-UPDATED",9    "address_id": "new-address-uuid",10    "status": "maintenance",11    "total_capacity": 12000,12    "available_capacity": 9000,13    "features": {14      "climate_control": true,15      "security_level": "maximum",16      "dock_doors": 15,17      "hazardous_materials": true,18      "refrigeration": true,19      "cross_docking": true20    },21    "created_at": "2023-06-01T10:00:00Z",22    "updated_at": "2023-06-02T10:00:00Z",23    "deleted_at": null24  }25}

Delete Warehouse​

Warehousing / Warehouses
DELETE/warehousing/warehouses/:id

Performs a soft delete of a warehouse by setting the deleted_at timestamp. This maintains referential integrity by not physically removing the record.

  • User must have 'manage:operations:tenant' permission

Business Rules

  • Warehouse must exist and belong to the specified tenant

  • Warehouse cannot be deleted if it has active inventory

  • Operation performs a soft delete by setting the deleted_at timestamp

  • No physical deletion of records occurs

Path parameters

ParameterTypeDescription
idRequiredstring

UUID of the warehouse to delete (required)

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
1curl --globoff --request DELETE "https://staging-api.ondi.io/functions/v1/warehousing/warehouses/${ID}?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

200Success Response
Response body
json
1{2  "success": true,3  "message": "Warehouse deleted successfully"4}