Skip to main content

VolumeClass

Use the REST API to interact with the volumeClass 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 VolumeClass

Use this endpoint to create a volumeClass. You can only have one default as true.

POST/api/icommerce/v3/volume-classes
{
"attributes": {
"value": 1,
"en": { //This depends on the server's language
"title": "Liter",
"unit": "l",
}
}
}
Response
{
"data": {
"id": 1,
"title": "Liter",
"default": true,
"unit": "l",
"value": 1
}
}

Modify a VolumeClass

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

By default, the accepted value is the ID. However, if you want to send another value, you must include it in the Query Parameters:

{
"filter": {
"field": "title" // Value by which the search will be performed
}
}
PUT/api/icommerce/v3/volume-classes/{criteria}
{
"attributes": {
"en": {
"title": "Milliliter",
}
}
}
Response
{
"data": "Item Updated"
}

Get Multiple VolumeClass

Use this endpoint to retrieve multiple VolumeClass.

You can filter VolumeClass and paginate the results.

Query Parameters:

GET/api/icommerce/v3/volume-classes
{
"filter": {
"order": {
"field":"created_at",
"way":"desc"
}
},
"page": 1,
"take": 1
}
Response
{
"data": [
{
"id": 1,
"title": "Liter",
"default": true,
"unit": "l",
"value": 1
}
],
"meta": {
"page": {
"total": 1,
"lastPage": 1,
"perPage": "1",
"currentPage": 1
}
}
}

Get a VolumeClass

Use this endpoint to retrieve a specific VolumeClass.

GET/api/icommerce/v3/volume-classes/{criteria}
{}
Response
{
"data": {
"id": 1,
"title": "Liter",
"default": true,
"unit": "l",
"value": 1
}
}

Delete a VolumeClass

Use this endpoint to delete a specific VolumeClass.

Send the VolumeClass's ID to delete it.

DELETE/api/icommerce/v3/volume-classes/{id}
{}
Response
{
"data": "Request successful"
}

VolumeClass Fields

NameDescription
valueType:
Double (15,8)
Description:
This field stores a numeric value of decimal type with a total precision of 15 digits, of which 8 are reserved for the decimal part. It can be used to represent volume values.
defaultType:
Boolean
Description:
This field is a boolean value that indicates whether the volume category is the default one or not. When set to true, it means this category is used as the default.
titleType:
String
Description:
This field stores the title or name of the volume category.
unitType:
String
Description:
This field stores the unit of measurement associated with the volume category. For example, you could use l for liter or ml for milliliter, depending on your needs.