Skip to main content

Warehouse

Use the REST API to interact with the warehouses in the application.

You should take into account when making your request
info

Remember that for some requests, you need to send the authentication token.

Header Parameters

{
"Authorization": "Bearer ...token..."
}

And the query parameters are as follows:

Query Parameters

{
"setting": {
"timezone": "America/Bogota",
"fromAdmin": true,
"appMode": "iadmin",
"authProvider": "local",
"locale": "en"
}
}
Do you want to see the changes made through the API?
info

After using the API to access products, it's important to update the cache to see the changes.

How to do it:

  • Go to the upper-right corner and select the dropdown menu with your username.
  • Click on 'Settings.'
  • In the 'Actions' section, look for the 'Clear Cache' option.
  • Click on 'Clear Cache' to update the information and view the updated products.

Clear cache

Create a Warehouse

Use this endpoint to create a Warehouse.

POST/api/icommerce/v3/warehouses
{
"attributes": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001",
"en": {
"title": "Warehouse"
}
}
}
Response
{
"data": {
"address": "Any Street",
"cityId": "956",
"countryId": "48",
"createdAt": "2024-07-01 15:36:22",
"createdBy": 1,
"default": "0",
"description": null,
"emailsToNotify": ["test@mail.com"],
"id": 3,
"lat": "4.642129714308486",
"lng": "-74.11376953125001",
"options": {
"map": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
},
"polygonId": null,
"provinceId": "786",
"slug": "warehouse-1",
"status": "1",
"title": "warehouse 1",
"updatedAt": "2024-07-01 15:36:22",
"updatedBy": 1,
"usersToNotify": ["1"]
}
}

Modify a Warehouse

Use this endpoint to modify a warehouse. You can send one or multiple values in the request. By default, the accepted value is the ID, but if you want to send another value, you need to include the following in the Query Parameters:

{
"filter": {
"field": "name" // The value by which the search will be conducted
}
}
PUT/api/icommerce/v3/warehouses/{criteria}
{
"attributes": {
"address": "Other Street"
}
}
Response
{
"data": "Item Updated"
}

Get Multiple Warehouses

Use this endpoint to retrieve multiple warehouses. You can filter the warehouses, paginate them, and include additional data. The data that can be included is:

IncludeDescription
countryFetches the countries associated with the warehouse.
provinceFetches provinces data associated with the warehouse.
cityFetches the cities associated with the warehouse.
polygonFetches the polygons associated with the warehouse.
ordersFetches the orders associated with the warehouse.
cartProductsFetches the cart products associated with the warehouse.
profileAddressesFetches the profile addresses associated with the warehouse.

Query Parameters:

GET/api/icommerce/v3/warehouses
{
"filter": {
"order": {
"field":"created_at",
"way":"desc"
}
},
"page": 1, // Page number of warehouse
"take": 1, // Number of warehouse to retrieve
"include": 'country,province,city'
}
Response
{
"data": [
{
"address": "Any Street",
"city": {
"code": "73001000",
"countryId": 48,
"createdAt": "2022-12-21 19:14:35",
"id": 956,
"name": "IBAGUE",
"provinceId": 786,
"updatedAt": "2022-12-21 19:14:35"
},
"cityId": 956,
"country": {
"callingCode": 57,
"countryCode": 170,
"createdAt": "2022-12-21 19:14:18",
"currency": "Colombian peso",
"currencyCode": "COP",
"currencySubUnit": "centavo",
"currencySymbol": "$",
"fullName": "Republic of Colombia",
"id": 48,
"iso2": "CO",
"iso3": "COL",
"name": "Colombia",
"regionCode": "019",
"status": 1,
"subRegionCode": "005",
"updatedAt": "2022-12-21 19:14:18"
},
"countryId": 48,
"createdAt": "2024-07-01 15:36:22",
"createdBy": 1,
"default": 0,
"deletedAt": null,
"deletedBy": null,
"description": null,
"emailsToNotify": [],
"id": 3,
"lat": "4.642129714308486",
"lng": "-74.11376953125001",
"options": {
"map": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
},
"organizationId": null,
"polygonId": null,
"province": {
"countryId": 48,
"createdAt": "2022-12-21 19:14:21",
"id": 786,
"iso2": "CO-TOL",
"name": "Tolima",
"updatedAt": "2022-12-21 19:14:21"
},
"provinceId": 786,
"slug": "test-2",
"status": 1,
"title": "test 2",
"updatedAt": "2024-07-01 15:36:22",
"updatedBy": 1,
"usersToNotify": []
}
],
"meta": {
"page": {
"total": 3,
"lastPage": 3,
"perPage": "1",
"currentPage": 1
}
}
}

Get a Specific Warehouse

Use this endpoint to retrieve a specific warehouse.

GET/api/icommerce/v3/warehouses/{criteria}
{}
Response
{
"data": {
"address": "Any Street",
"city": {
"code": "73001000",
"countryId": 48,
"createdAt": "2022-12-21 19:14:35",
"id": 956,
"name": "IBAGUE",
"provinceId": 786,
"updatedAt": "2022-12-21 19:14:35"
},
"cityId": 956,
"country": {
"callingCode": 57,
"countryCode": 170,
"createdAt": "2022-12-21 19:14:18",
"currency": "Colombian peso",
"currencyCode": "COP",
"currencySubUnit": "centavo",
"currencySymbol": "$",
"fullName": "Republic of Colombia",
"id": 48,
"iso2": "CO",
"iso3": "COL",
"name": "Colombia",
"regionCode": "019",
"status": 1,
"subRegionCode": "005",
"updatedAt": "2022-12-21 19:14:18"
},
"countryId": 48,
"createdAt": "2024-07-01 15:36:22",
"createdBy": 1,
"default": 0,
"deletedAt": null,
"deletedBy": null,
"description": null,
"emailsToNotify": [],
"id": 3,
"lat": "4.642129714308486",
"lng": "-74.11376953125001",
"options": {
"map": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
},
"organizationId": null,
"polygonId": null,
"province": {
"countryId": 48,
"createdAt": "2022-12-21 19:14:21",
"id": 786,
"iso2": "CO-TOL",
"name": "Tolima",
"updatedAt": "2022-12-21 19:14:21"
},
"provinceId": 786,
"slug": "test-2",
"status": 1,
"title": "test 2",
"updatedAt": "2024-07-01 15:36:22",
"updatedBy": 1,
"usersToNotify": []
}
}

Delete a Warehouse

Use this endpoint to delete a specific warehouse by sending the warehouse's ID.

DELETE/api/icommerce/v3/warehouses/{id}
{}
Response
{
"data": "Request successful"
}

Warehouse Fields

NameDescription
titleType:
String
Description:
This field stores the title of the warehouse. It is used to represent the name of the warehouse.
slugType:
String
Description:
This field stores a URL-friendly version of the warehouse title. It is typically used in URLs to identify the warehouse.
descriptionType:
String
Description:
This field stores a description of the warehouse. It provides additional details about the warehouse.
latType:
Number
Description:
This field stores the latitude coordinate of the warehouse. It is used for geographic location.
lngType:
Number
Description:
This field stores the longitude coordinate of the warehouse. It is used for geographic location.
addressType:
String
Description:
This field stores the physical address of the warehouse. It includes street, city, and postal code information.
statusType:
String
Description:
This field stores the current status of the warehouse. Possible values could include "active", "inactive", or other status indicators.
optionsType:
Object
Description:
This field stores additional options related to the warehouse. It can include various settings and configurations.
country_idType:
Number
Description:
This field stores the ID of the country associated with the warehouse. It is a reference to the country entity.
province_idType:
Number
Description:
This field stores the ID of the province associated with the warehouse. It is a reference to the province entity.
city_idType:
Number
Description:
This field stores the ID of the city associated with the warehouse. It is a reference to the city entity.
polygon_idType:
Number
Description:
This field stores the ID of the polygon associated with the warehouse. It is used for geographic area representation.
defaultType:
Boolean
Description:
This field is a boolean value that indicates whether the warehouse is the default one or not. When set to <code>1</code>, it means this warehouse is used as the default.
users_to_notifyType:
Array
Description:
This field stores a list of user IDs who should be notified about certain events related to the warehouse.
emails_to_notifyType:
Array
Description:
This field stores a list of email addresses that should be notified about certain events related to the warehouse.

If you need further assistance or have any questions about how to fill out these fields, please don't hesitate to contact our support team.