Retrieve, create, update, and delete products stored in the Cube-IQ database. Products represent items that can be loaded into containers for optimization purposes.
Product Object
A product represents an item that can be included in load planning. The following attributes define a product:
|
id string Unique identifier for the product. |
|
name string Descriptive name for the product. |
|
length integer Length of the product in the defined unit (e.g., cm, inches). |
|
width integer Width of the product in the defined unit. |
|
height integer Height of the product in the defined unit. |
|
weight integer Weight of the product in the defined unit (e.g., kg, lbs). |
|
volume integer Calculated volume of the product. |
|
shape string Shape of the product (e.g., box, cylinder, L-shape). |
|
stackable boolean Indicates whether the product can be stacked. |
|
created_at timestamp ISO 8601 timestamp of when the product was created. |
|
modified_at timestamp ISO 8601 timestamp of the last update to the product. |
Example Product Object
{
"id": "product_123",
"name": "Widget A",
"quantity": 100,
"weight": 5,
"dimensions": {
"length": 10,
"width": 5,
"height": 4,
"unit": "inches"
},
"stacking": {
"max_stack_height": 5,
"max_weight_per_stack": 50,
"orientation_restrictions": ["upright", "side"]
},
"created_at": "2025-02-21T12:00:00Z",
"updated_at": "2025-02-21T12:20:00Z"
}
Create a Product
Creates a new product in the database.
Required Permissions
ADMIN, CREATE
Request
curl -X POST "https://api.magiclogic.com/db/v1/product"
-u "Authorization: Basic YOUR_API_KEY"
-H 'Content-Type: application/json'
-d '{
"product": {
"id": "P67890"
"name": "Large Cylinder",
"length": 100,
"width": 100,
"height": 150,
"weight": 20,
"shape": "cylinder",
"stackable": false,
},
}'Response
Retrieve a Product
Retrieve the details of a specific product by ID.
Required Permissions
ADMIN, CREATE
Request
curl -X GET "https://api.magiclogic.com/db/v1/product/{id}" \
-H "Authorization: Basic YOUR_API_KEY" \Response
{
"status": "success",
"product": {
"id": "P12345",
"name": "Standard Box"
"length": 50,
"width": 30,
"height": 20,
"weight": 5,
"volume": 30000,
"shape": "box",
"stackable": true,
"created_at": "2025-02-21T12:00:00Z"
"modified_at": "2025-02-21T12:30:00Z"
}
}
Retrieve All Products
Retrieves a list of all products stored in the database. Use the since parameter to filter products modified after a specified timestamp.
Required Permissions
ADMIN, CREATE, EDIT, VIEW
Request
curl -X GET "https://api.magiclogic.com/db/v1/products" \
-H "Authorization: Basic YOUR_API_KEY"/products" \
curl -X GET "https://api.magiclogic.com/db/v1/products" \
-H "Authorization: Basic YOUR_API_KEY"/products?since=YYYY-MM-DDTHH:NN:SS.ZZZResponse
{
"status": "success",
"product": {
"id": "P12345",
"name": "Standard Box"
"length": 50,
"width": 30,
"height": 20,
"weight": 5,
"volume": 30000,
"shape": "box",
"stackable": true,
"created_at": "2025-02-21T12:00:00Z"
"modified_at": "2025-02-21T12:30:00Z"
}
}Parameters
since string
Returns only products modified after the specified UTC timestamp.