Skip to main content

Warehouses

5 API calls in this section.

List Warehouses

Warehousing / Warehouses
GET/warehousing/warehouses?page=1&limit=10&status=&code=&search=&sort_by=&sort_order=desc&column_filters=&total_capacity_order=&available_capacity_order=&customer_id=&carrier_code=&tenant_id=&language=en

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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/warehousing/warehouses?page=1&limit=10&status=&code=&search=&sort_by=&sort_order=desc&column_filters=&total_capacity_order=&available_capacity_order=&customer_id=&carrier_code=&tenant_id=&language=en" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number (default: 1)

limitOptional
query string

10

Items per page (default: 10)

statusOptional
query string

Legacy: filter by status (active|inactive|maintenance|full)

codeOptional
query string

Legacy: exact code filter

searchOptional
query string

Search by name or code (ILIKE)

sort_byOptional
query string

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

sort_orderOptional
query string

desc

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

column_filtersOptional
query string

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_orderOptional
query string

Legacy sort: asc|desc (takes precedence over sort_by)

available_capacity_orderOptional
query string

Legacy sort: asc|desc (takes precedence over sort_by)

customer_idOptional
query string

Filter by customer access mapping (business user_id). Applied implicitly for customer-role users.

carrier_codeOptional
query string

When provided, returns carrier_config_present + external_integration per warehouse

tenant_idOptional
query string

Tenant ID (optional if in auth token)

languageOptional
query string

en

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Responses

Success Response200OK
Error - Tenant Not Found404
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}
Error - Server Error500
Response body
json
1{2  "success": false,3  "message": "Internal server error"4}

Create Warehouse

Warehousing / Warehouses
POST/warehousing/warehouses?tenant_id={{tenant_id}}
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request POST "$ONDI_BASE_URL/warehousing/warehouses?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": "Main Distribution Center",7  "code": "WH001",8  "address_id": "{{address_id}}",9  "status": "active",10  "total_capacity": 10000,11  "available_capacity": 7500,12  "features": {13    "climate_control": true,14    "security_level": "high",15    "dock_doors": 12,16    "hazardous_materials": false,17    "refrigeration": true,18    "cross_docking": true19  },20  "access_mode": "all_users",21  "user_ids": []22}'
Request body
json
1{2  "name": "Main Distribution Center",3  "code": "WH001",4  "address_id": "{{address_id}}",5  "status": "active",6  "total_capacity": 10000,7  "available_capacity": 7500,8  "features": {9    "climate_control": true,10    "security_level": "high",11    "dock_doors": 12,12    "hazardous_materials": false,13    "refrigeration": true,14    "cross_docking": true15  },16  "access_mode": "all_users",17  "user_ids": []18}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Request body fields

nameExample
string

Example field from the request body.

codeExample
string

Example field from the request body.

address_idExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

total_capacityExample
number

Example field from the request body.

available_capacityExample
number

Example field from the request body.

featuresExample
object

Example field from the request body.

features.climate_controlExample
boolean

Example field from the request body.

features.security_levelExample
string

Example field from the request body.

features.dock_doorsExample
number

Example field from the request body.

features.hazardous_materialsExample
boolean

Example field from the request body.

features.refrigerationExample
boolean

Example field from the request body.

features.cross_dockingExample
boolean

Example field from the request body.

access_modeExample
string

Example field from the request body.

user_idsExample
array

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201
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}
Error - Invalid Access Mode400
Response body
json
1{2  "success": false,3  "message": "Invalid access mode"4}
Error - Customer IDs Required For Selected Mode400
Response body
json
1{2  "success": false,3  "message": "Customer IDs required for selected access mode"4}
Error - Invalid Customer IDs400
Response body
json
1{2  "success": false,3  "message": "Invalid customer IDs",4  "invalid_customer_ids": [5    "user-uuid-not-in-tenant"6  ]7}
Error - Missing Required Field400
Response body
json
1{2  "success": false,3  "message": "Field required: name"4}
Error - Code Already Exists400
Response body
json
1{2  "success": false,3  "message": "Warehouse code already exists"4}
Error - Invalid Feature Field400
Response body
json
1{2  "success": false,3  "message": "Invalid feature field: invalid_feature"4}
Error - Address Not Found404
Response body
json
1{2  "success": false,3  "message": "Address not found"4}
Error - Tenant Not Found404
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}
Error - Server Error500
Response body
json
1{2  "success": false,3  "message": "Internal server error"4}

Get Warehouse

Warehousing / Warehouses
GET/warehousing/warehouses/:id?tenant_id={{tenant_id}}
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/warehousing/warehouses/:id?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json"

Path parameters

idRequired
path string

UUID of the warehouse to retrieve (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
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      "full_address": "123 Warehouse Blvd, Industrial District",27      "city": "Metropolis",28      "country": "US",29      "latitude": 40.7128,30      "longitude": -74.00631    }32  }33}
Error - Warehouse Not Found404
Response body
json
1{2  "success": false,3  "message": "Warehouse not found"4}
Error - Tenant Not Found404
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}

Update Warehouse

Warehousing / Warehouses
PUT/warehousing/warehouses/:id?tenant_id={{tenant_id}}
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request PUT "$ONDI_BASE_URL/warehousing/warehouses/:id?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json" \4  --header "Content-Type: application/json" \5  --data '{6  "name": "Updated Distribution Center",7  "code": "WH001-UPDATED",8  "address_id": "{{new_address_id}}",9  "status": "maintenance",10  "total_capacity": 12000,11  "available_capacity": 9000,12  "features": {13    "climate_control": true,14    "security_level": "maximum",15    "dock_doors": 15,16    "hazardous_materials": true,17    "refrigeration": true,18    "cross_docking": true19  },20  "access_mode": "select_users",21  "user_ids": [22    "{{customer_id_1}}",23    "{{customer_id_2}}"24  ]25}'
Request body
json
1{2  "name": "Updated Distribution Center",3  "code": "WH001-UPDATED",4  "address_id": "{{new_address_id}}",5  "status": "maintenance",6  "total_capacity": 12000,7  "available_capacity": 9000,8  "features": {9    "climate_control": true,10    "security_level": "maximum",11    "dock_doors": 15,12    "hazardous_materials": true,13    "refrigeration": true,14    "cross_docking": true15  },16  "access_mode": "select_users",17  "user_ids": [18    "{{customer_id_1}}",19    "{{customer_id_2}}"20  ]21}

Path parameters

idRequired
path string

UUID of the warehouse to update (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Request body fields

nameExample
string

Example field from the request body.

codeExample
string

Example field from the request body.

address_idExample
string

Example field from the request body.

statusExample
string

Example field from the request body.

total_capacityExample
number

Example field from the request body.

available_capacityExample
number

Example field from the request body.

featuresExample
object

Example field from the request body.

features.climate_controlExample
boolean

Example field from the request body.

features.security_levelExample
string

Example field from the request body.

features.dock_doorsExample
number

Example field from the request body.

features.hazardous_materialsExample
boolean

Example field from the request body.

features.refrigerationExample
boolean

Example field from the request body.

features.cross_dockingExample
boolean

Example field from the request body.

access_modeExample
string

Example field from the request body.

user_idsExample
array<string>

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
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}
Error - Invalid Access Mode400
Response body
json
1{2  "success": false,3  "message": "Invalid access mode"4}
Error - Customer IDs Required For Selected Mode400
Response body
json
1{2  "success": false,3  "message": "Customer IDs required for selected access mode"4}
Error - Invalid Customer IDs400
Response body
json
1{2  "success": false,3  "message": "Invalid customer IDs",4  "invalid_customer_ids": [5    "user-uuid-not-in-tenant"6  ]7}
Error - Address ID Cannot Be Null400
Response body
json
1{2  "success": false,3  "message": "Address ID cannot be null"4}
Error - Code Already Exists400
Response body
json
1{2  "success": false,3  "message": "Warehouse code already exists"4}
Error - Invalid Feature Field400
Response body
json
1{2  "success": false,3  "message": "Invalid feature field: invalid_feature"4}
Error - Warehouse Not Found404
Response body
json
1{2  "success": false,3  "message": "Warehouse not found"4}
Error - Address Not Found404
Response body
json
1{2  "success": false,3  "message": "Address not found"4}
Error - Tenant Not Found404
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}
Error - Server Error500
Response body
json
1{2  "success": false,3  "message": "Internal server error"4}

Delete Warehouse

Warehousing / Warehouses
DELETE/warehousing/warehouses/:id?tenant_id={{tenant_id}}
Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request DELETE "$ONDI_BASE_URL/warehousing/warehouses/:id?tenant_id={{tenant_id}}" \2  --header "Authorization: Bearer {{access_token}}" \3  --header "Content-Type: application/json"

Path parameters

idRequired
path string

UUID of the warehouse to delete (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
Response body
json
1{2  "success": true,3  "message": "Warehouse deleted successfully"4}
Error - Warehouse Has Inventory400
Response body
json
1{2  "success": false,3  "message": "Warehouse has inventory"4}
Error - Warehouse Not Found404
Response body
json
1{2  "success": false,3  "message": "Warehouse not found"4}
Error - Tenant Not Found404
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}
Error - Server Error500
Response body
json
1{2  "success": false,3  "message": "Internal server error"4}