Warehouse
Use the REST API to interact with the warehouses in the application.
You should take into account when making your request
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?
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.
Create a Warehouse
Use this endpoint to create a Warehouse.
- Minimum
- Rest
{
"attributes": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001",
"en": {
"title": "Warehouse"
}
}
}
{
"attributes": {
"options": {
"map": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
},
"user_id": 1,
"users_to_notify": ["1"],
"emails_to_notify": ["test@mail.com"],
"status": "1",
"default": "0",
"country_id": "48",
"province_id": "786",
"city_id": "956",
"polygon_id": null,
"address": "Any street",
"es": {
"title": "warehouse 1",
"slug": "warehouse-1",
"description": "Warehouse"
},
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
}
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
}
}
- Minimum
- Rest
{
"attributes": {
"address": "Other Street"
}
}
{
"attributes": {
"options": {
"map": {
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
},
"user_id": 1,
"users_to_notify": ["1"],
"emails_to_notify": ["test@mail.com"],
"status": "1",
"default": "0",
"country_id": "48",
"province_id": "786",
"city_id": "956",
"polygon_id": null,
"address": "Other street",
"es": {
"title": "warehouse 158",
"slug": "warehouse-1",
"description": "Warehouse update"
},
"lat": "4.642129714308486",
"lng": "-74.11376953125001"
}
}
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:
Include | Description |
---|---|
country | Fetches the countries associated with the warehouse. |
province | Fetches provinces data associated with the warehouse. |
city | Fetches the cities associated with the warehouse. |
polygon | Fetches the polygons associated with the warehouse. |
orders | Fetches the orders associated with the warehouse. |
cartProducts | Fetches the cart products associated with the warehouse. |
profileAddresses | Fetches the profile addresses associated with the warehouse. |
Query Parameters:
- Rest
{
"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.
- Rest
{}
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.
- Rest
{}
Response
{
"data": "Request successful"
}
Warehouse Fields
Name | Description |
---|---|
title | Type: String Description: This field stores the title of the warehouse. It is used to represent the name of the warehouse. |
slug | Type: String Description: This field stores a URL-friendly version of the warehouse title. It is typically used in URLs to identify the warehouse. |
description | Type: String Description: This field stores a description of the warehouse. It provides additional details about the warehouse. |
lat | Type: Number Description: This field stores the latitude coordinate of the warehouse. It is used for geographic location. |
lng | Type: Number Description: This field stores the longitude coordinate of the warehouse. It is used for geographic location. |
address | Type: String Description: This field stores the physical address of the warehouse. It includes street, city, and postal code information. |
status | Type: String Description: This field stores the current status of the warehouse. Possible values could include "active", "inactive", or other status indicators. |
options | Type: Object Description: This field stores additional options related to the warehouse. It can include various settings and configurations. |
country_id | Type: Number Description: This field stores the ID of the country associated with the warehouse. It is a reference to the country entity. |
province_id | Type: Number Description: This field stores the ID of the province associated with the warehouse. It is a reference to the province entity. |
city_id | Type: Number Description: This field stores the ID of the city associated with the warehouse. It is a reference to the city entity. |
polygon_id | Type: Number Description: This field stores the ID of the polygon associated with the warehouse. It is used for geographic area representation. |
default | Type: 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_notify | Type: Array Description: This field stores a list of user IDs who should be notified about certain events related to the warehouse. |
emails_to_notify | Type: 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.