Skip to main content

Product Warehouse

Use the REST API to interact with the products in the warehouse.

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

Add a Product to the Warehouse

Use this endpoint to create a Warehouse.

POST/api/icommerce/v3/product-warehouse
{
"attributes": {
"product_id": "12",
"warehouse_id": "3",
"quantity": "20",
}
}
Response
{{
"data": {
"createdAt": "2024-07-01 16:14:24",
"createdBy": 1,
"id": 1,
"productId": "12",
"quantity": "20",
"updatedAt": "2024-07-01 16:14:24",
"updatedBy": 1,
"warehouseId": "3"
}
}

Update a Product in the Warehouse

Use this endpoint to modify a product in the warehouse. You can send one or multiple values in the request.

PUT/api/icommerce/v3/product-warehouse/{criteria}
{
"attributes": {
"quantity": "5"
}
}
Response
{
"data": "Item Updated"
}

Get Multiple Products from the Warehouse

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

IncludeDescription
productRetrieve associated product
warehouseRetrieve associated warehouse

Query Parameters:

GET/api/icommerce/v3/product-warehouse
{
"filter": {
"order": {
"field":"created_at",
"way":"desc"
}
},
"page": 1, // Page number of warehouse
"take": 1, // Number of warehouse to retrieve
"include": 'warehouse,product'
}
Response
{
"data": [
{
"createdAt": "2024-07-01 16:14:24",
"createdBy": 1,
"deletedAt": null,
"deletedBy": null,
"id": 1,
"organizationId": null,
"product": {
"id": 12,
"name": "asda",
"slug": "asda",
"summary": "asdasd",
"metaTitle": "",
"metaDescription": "",
"options": {
"masterRecord": 0,
"video": null
},
"sku": "s667f3596b56ba",
"quantity": 10,
"price": 0,
"formattedPrice": "$0",
"minimum": 1,
"description": "<p>asdasd</p>",
"createdAt": "2024-06-28 17:13:42",
"updatedAt": "2024-07-02 10:35:12",
"status": 1,
"stockStatus": 1,
"categoryId": 1,
"storeId": null,
"featured": "0",
"sortOrder": "0",
"visible": 0,
"url": "/tienda/p/asda",
"isCall": "0",
"showPriceIsCall": "0",
"totalTaxes": 0,
"volume": 0,
"mediaFiles": {},
"isNew": true,
"isAvailable": false,
"layoutId": null,
"isInternal": 0,
"advancedSummary": "<p>asdasd</p>",
"tags": [],
"priceLists": []
},
"productId": 12,
"quantity": 10,
"updatedAt": "2024-07-02 10:35:12",
"updatedBy": 1,
"warehouse": {
"address": "calle 123",
"cityId": 956,
"countryId": 48,
"createdAt": "2024-03-15 16:42:18",
"createdBy": 2,
"default": 0,
"deletedAt": null,
"deletedBy": null,
"description": null,
"emailsToNotify": null,
"id": 1,
"lat": "19.4326296",
"lng": "-99.1331785",
"options": {
"map": {
"label": "",
"lat": 19.4326296,
"lng": -99.1331785
}
},
"organizationId": null,
"polygonId": 5,
"provinceId": 786,
"slug": "test",
"status": 1,
"title": "test",
"updatedAt": "2024-03-15 18:20:58",
"updatedBy": 2,
"usersToNotify": null
},
"warehouseId": 1
}
],
"meta": {
"page": {
"total": 1,
"lastPage": 1,
"perPage": "10",
"currentPage": 1
}
}
}

Get a Specific Product from the Warehouse

Use this endpoint to retrieve a specific product from the warehouse.

GET/api/icommerce/v3/product-warehouse/{criteria}
{}
Response
{
"data": {
"createdAt": "2024-07-01 16:14:24",
"createdBy": 1,
"deletedAt": null,
"deletedBy": null,
"id": 1,
"organizationId": null,
"productId": 12,
"quantity": 10,
"updatedAt": "2024-07-02 10:35:12",
"updatedBy": 1,
"warehouse": {
"address": "calle 123",
"cityId": 956,
"countryId": 48,
"createdAt": "2024-03-15 16:42:18",
"createdBy": 2,
"default": 0,
"deletedAt": null,
"deletedBy": null,
"description": null,
"emailsToNotify": null,
"es": {
"title": "test",
"slug": "test",
"description": null
},
"id": 1,
"lat": "19.4326296",
"lng": "-99.1331785",
"options": {
"map": {
"label": "",
"lat": 19.4326296,
"lng": -99.1331785
}
},
"organizationId": null,
"polygonId": 5,
"provinceId": 786,
"slug": "test",
"status": 1,
"title": "test",
"updatedAt": "2024-03-15 18:20:58",
"updatedBy": 2,
"usersToNotify": null
},
"warehouseId": 1
}
}

Remove a Product from the Warehouse

Use this endpoint to delete a specific product from the warehouse by sending the ID.

DELETE/api/icommerce/v3/product-warehouse/{id}
{}
Response
{
"data": "Request successful"
}

Warehouse Fields

NameDescription
Product IDType:
Integer
Description:
You can obtain the product ID here.
Warehouse IDType:
Integer
Description:
You can obtain the warehouse ID here.
quantityType:
Number
Description:
Specify the quantity of the product. Each time you update or add a new quantity, the specified amount will be added to or subtracted from the current inventory of the product. For example, if the product has a quantity of 4 and you add 20, the product will now have 24 units.

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.