Get Single Warehouse
Retrieves the details of a single warehouse, including its address, shipping zones and stock levels.
HTTP Request
- URL:
/wareHouse/{id} - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_WAREHOUSEorREAD_WRITE_WAREHOUSE
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | The ID of the warehouse to retrieve. |
cURL Example
curl --location '<BASE_URL>/wareHouse/6650c4b2e8a1f93d7c2b5e40' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The warehouse was returned successfully.
- 400 Bad Request: The access token is missing or invalid, does not have the required scope, or the warehouse ID is not valid.
Sample JSON Response
{
"success": true,
"data": {
"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": []
},
{
"_id": "6650c4b2e8a1f93d7c2b5e42",
"productId": "66b4a01249e6ce3d41c428fa",
"stock": 0,
"minStock": 0,
"variants": [
{
"_id": "6650c4b2e8a1f93d7c2b5e43",
"variantId": "66d5a286fcb786834cebb16a",
"stock": 500,
"minStock": 50
}
]
}
],
"metaFields": [],
"createdAt": "2024-05-24T16:47:14.302Z",
"updatedAt": "2024-10-28T09:12:45.118Z"
}
}
Response Details
Warehouse Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the warehouse. |
name | String | Name of the warehouse. |
country | Object | Country of the warehouse, with code and name. |
active | Boolean | Whether the warehouse is active. Default is true. |
default | Boolean | Whether this is your store's default warehouse. Default is false. |
address | Object | Address of the warehouse. See below. |
shippingZones | Array | IDs of the shipping zones this warehouse serves. |
inventory | Array | Stock levels per product. See below. |
metaFields | Array | Custom field values. See Metafields. |
createdAt | String | Date and time the warehouse was created (ISO 8601). |
updatedAt | String | Date and time the warehouse was last updated (ISO 8601). |
Address Object
| Field | Type | Description |
|---|---|---|
firstName | String | First name of the contact person. |
lastName | String | Last name of the contact person. |
phoneNumber | String | Phone number of the contact person, if set. |
address1 | String | Street address. |
address2 | String | Additional address line. |
city | String | City. |
state | Object | State or province, with code and name. |
country | Object | Country, with code and name. |
zipcode | String | Postal code. |
Inventory Object
| Field | Type | Description |
|---|---|---|
_id | String | Unique identifier of the inventory entry. |
productId | String | ID of the product. |
stock | Number | Units in stock. Default is 0. |
minStock | Number | Low-stock level. Default is 0. |
variants | Array | Stock per variant, each with variantId, stock and minStock. |
Notes
- If no warehouse matches the ID,
datais an empty object.