Get All Warehouses
Retrieves a list of warehouses, including each warehouse's address and stock levels. Use the query parameters to page through the results.
HTTP Request
- URL:
/wareHouse/all - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_WAREHOUSEorREAD_WRITE_WAREHOUSE
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of warehouses per page. Default is 10. |
cURL Example
curl --location '<BASE_URL>/wareHouse/all?page=1&limit=10' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The list of warehouses was returned successfully.
- 400 Bad Request: The access token is missing or invalid, or does not have the required scope.
Sample JSON Response
{
"success": true,
"data": [
{
"_id": "6650c4b2e8a1f93d7c2b5e40",
"id": "6650c4b2e8a1f93d7c2b5e40",
"name": "Chicago Distribution Center",
"country": {
"code": "US",
"name": "United States"
},
"active": true,
"default": true,
"address": {
"firstName": "Marcus",
"lastName": "Reyes",
"address1": "2400 S Western Ave",
"address2": "Dock 4",
"city": "Chicago",
"state": {
"code": "IL",
"name": "Illinois"
},
"country": {
"code": "US",
"name": "United States"
},
"zipcode": "60608"
},
"shippingZones": ["66d36af6d1fc2890ebc32e0b"],
"inventory": [
{
"_id": "6650c4b2e8a1f93d7c2b5e41",
"productId": "65b88ef5045a7d009e79974b",
"stock": 240,
"minStock": 25,
"variants": []
}
],
"metaFields": [],
"createdAt": "2024-05-24T16:47:14.302Z",
"updatedAt": "2024-10-28T09:12:45.118Z"
}
],
"pagination": {
"page": 1,
"total": 1,
"count": 1
}
}
Response Details
| Field | Type | Description |
|---|---|---|
success | Boolean | Whether the request was successful. |
data | Array | List of warehouses. |
pagination | Object | Pagination details. See below. |
Warehouse Data
Each warehouse has the same fields as described in Get Single Warehouse.
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Integer | Current page number. |
total | Integer | Total number of warehouses. |
count | Integer | Number of warehouses returned on this page. |