Skip to main content

Get All Warehouses

This API endpoint retrieves a list of warehouses from the server. The results can be paginated using query parameters.

HTTP Request

  • URL: /wareHouse/all
  • Method: GET
  • Headers:
    • accessToken: Required. This is your access token for authenticating the request.

Query Parameters

To effectively navigate through the warehouses data, you can include the following query parameters:

ParameterTypeDescription
pageIntegerThe page number to retrieve; defaults to 1 if not specified.
limitIntegerThe number of items to retrieve per page; defaults to 10.

cURL Example

Below is a sample cURL command that demonstrates how to make a request to the API endpoint:

curl --location '<BASE_URL>/wareHouse/all?page=1&limit=10' \
--header 'accessToken: <ACCESS_TOKEN>'

Response

  • 200 OK: The request was successful, and the server returned a list of warehouses.
  • 4XX: Client errors indicating issues such as an invalid access token or missing parameters.
  • 5XX: Server errors indicating that something went wrong on the server's end.

Sample JSON Response

Below is an example of the JSON response you might receive from making a request to this endpoint:

{
"success": true,
"data": [
{
"_id": "663a0aff4587085935a4fb8e",
"name": "Main Warehouse",
"country": {
"code": "US",
"name": "United States"
},
"active": true,
"default": false,
"shippingZones": ["663a0afe4587085935a4fb84", "66a6df8bf4200635117ec817"],
"inventory": [
{
"productId": "6661781b047d8a81d984d938",
"stock": 100,
"minStock": 10,
"variants": [],
"_id": "66a66e3d7d6c18df2d9eb19b"
}
// Additional inventory omitted for brevity...
],
"metaFields": [],
"createdAt": "2024-05-07T11:05:35.114Z",
"updatedAt": "2024-08-30T09:01:16.534Z",
"__v": 0,
"address": {
"firstName": "Main",
"lastName": "Warehouse",
"address1": "188 W Museum Dr",
"address2": null,
"city": "Dickinson",
"state": {
"code": "NV",
"name": "Nevada"
},
"country": {
"code": "US",
"name": "United States"
},
"zipcode": "33155"
},
"id": "663a0aff4587085935a4fb8e"
},
{
"_id": "66c7847bc9dfe3bd5e222a37",
"name": "Ohio Warehouse",
"country": {
"code": "US",
"name": "United States"
},
"active": true,
"default": false,
"address": {
"firstName": "Marlee",
"lastName": "Mitchell",
"address1": "224 E Main St",
"address2": "",
"city": "Fairborn",
"state": {
"code": "OH",
"name": "Ohio"
},
"country": {
"code": "US",
"name": "United States"
},
"zipcode": "45324"
},
"shippingZones": [],
"inventory": [],
"metaFields": [],
"createdAt": "2024-08-22T18:33:31.682Z",
"updatedAt": "2024-08-31T18:50:05.325Z",
"__v": 0,
"id": "66c7847bc9dfe3bd5e222a37"
}
],
"pagination": {
"page": 1,
"total": 6,
"count": 2
}
}

Response Details

KeyTypeDescription
successBooleanIndicates if the request was successful.
dataArray of ObjectsList of warehouses.
paginationObjectProvides pagination details.

Warehouse Data

FieldTypeDescription
_idStringUnique identifier for the warehouse.
nameStringName of the warehouse.
countryObjectCountry information including code and name.
activeBooleanIndicates if the warehouse is active.
defaultBooleanIndicates if this is the default warehouse.
shippingZonesArray of StringsList of shipping zone IDs associated with the warehouse.
inventoryArray of ObjectsList of inventory details for each product.
metaFieldsArray of ObjectsAdditional metadata fields related to the warehouse.
createdAtStringDate and time the warehouse was created (ISO 8601 format).
updatedAtStringDate and time the warehouse was last updated (ISO 8601 format).
addressObjectAddress information including city, state, and zipcode.
idStringAlias for unique identifier of the warehouse.

Pagination Details

KeyTypeDescription
pageIntegerCurrent page number.
totalIntegerTotal number of items available.
countIntegerNumber of items returned in this response.

Notes

  • Ensure that the accessToken provided is valid and has not expired.
  • The query parameters can help paginate the list of warehouses effectively.