Retrieve, create, update, and delete containers stored in the Cube-IQ database. Containers define the physical properties of units used for load optimization.
Container Object
A container represents a physical unit used in load planning, such as a pallet, crate, or box. The following attributes define a container:
|
id string Unique identifier for the container. |
|
name string Descriptive name for the container. |
|
length integer Length of the container in the defined unit (e.g., cm, inches). |
|
width integer Width of the container in the defined unit. |
|
max_weight integer Maximum allowable weight for the container in the defined unit (e.g., kg, lbs). |
|
volume integer Total calculated volume of the container. |
|
type string Type of container (e.g., pallet, crate, box). |
|
material string Material composition of the container (e.g., wood, metal, plastic). |
|
created_at timestamp ISO 8601 timestamp of when the container was created. |
|
modified_at timestamp ISO 8601 timestamp of the last update to the container. |
Example Container Object
{
"cubeiq" : {
"containers" : {
"container" : [
{
"containerid" : "Large",
"depth" : 23.0000,
"width" : 14.0000,
"height" : 8.7500,
"maxweight" : 37.0000,
"settingsid" : "Box Default",
"type" : "Rectangular",
"bottomtotoploading" : false,
"partialloadonfloor" : true
},
{
"containerid" : "Medium",
"containerid1" : "Medium",
"depth" : 12.0000,
"width" : 12.0000,
"height" : 10.2500,
"maxweight" : 37.0000,
"settingsid" : "Box Default",
"type" : "Rectangular",
"bottomtotoploading" : false,
"partialloadonfloor" : true
}
]
},
"settings" : {
"setting" : [
{
"settingsid" : "Box Default",
"maxruntime" : 60,
"maxnonimproveiters" : 750,
"sequencemixok" : true,
"singleunitblocks" : true
}
]
},
"products" : {
"product" : [
{
"productid" : "0520803000",
"length" : 4.7500,
"width" : 4.8750,
"height" : 6.2500,
"weight" : 2.2800,
"turnable" : true,
"flatok" : true,
"sideupok" : true,
"endupok" : true,
"bottomonly" : false,
"toponly" : false,
"maxinlayer" : 999999,
"stackindex" : 2,
"type" : "Box",
"color" : 16760576
}
]
},
"loads" : {
"load" : [
{
"loadid" : "p1q4",
"notes" : "",
"date" : "17-11-2015"
}
]
},
"stages" : {
"stage" : [
{
"loadid" : "p1q4",
"stage" : 1,
"containerselectionrule" : 3
}
]
},
"containerstoload" : {
"containertoload" : [
{
"loadid" : "p1q4",
"containerid" : "Large",
"containernum" : 1
},
{
"loadid" : "p1q4",
"containerid" : "Medium",
"containernum" : 999999
}
]
},
"productstoload" : {
"producttoload" : [
{
"loadid" : "p1q4",
"productid" : "0520803000",
"batch" : 1,
"quantity" : 12
}
]
}
}
}
Create a Container
Creates a new container in the database.
Required Permissions
ADMIN, CREATE
Request
curl -X POST "https://api.magiclogic.com/db/v1/containers" \
-H "Authorization: Basic YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "C67890",
"name": Oversized Crate",
"length": 200,
"width": 150,
"height": 180,
"max_weight": 2000,
"type": "crate",
"material": "metal"
}'Response
Retrieve a Container
Retrieves the details of a specific container.
Required Permissions
ADMIN, CREATE, EDIT, VIEW
Request
curl -X GET "https://api.magiclogic.com/db/v1/container/{id}" \
-H "Authorization: Basic YOUR_API_KEY"Response
Retrieve All Containers
Retrieves a list of all containers stored in the database. Use the since parameter to filter containers modified after a specified timestamp.
Required Permissions
ADMIN, CREATE, EDIT, VIEW
Request
curl -X GET "https://api.magiclogic.com/db/v1/containers"
curl -X GET "https://api.magiclogic.com/db/v1/containers?since=YYYY-MM-DDTHH:NN:SS.ZZZResponse
{
"status": "success",
"container": {
"id": "C12345",
"length": 120,
"width": 80,
"height": 100,
"max_weight": 1000,
"volume": 960000,
"type": "pallet",
"material": "wood",
"created_at": "2025-02-21T12:00:00Z"
"modified_at": "2025-02-21T12:30:00Z"
}
}Parameters
since string
Returns only containers modified after the specified UTC timestamp