This REST API manages packaging containers for a warehouse profile. For the API to work properly, create a warehouse profile to obtain API key and warehouse ID. This API also requires a valid partner ID.
To avoid per minute quota, requests should be spread out whenever possible.
{
"status": {"success": true, "messages": []},
"containers": [
{
"containerId": "f3b4a6c8-7b3c-4d2c-94ab-2c1f6cdb2c99",
"name": "Small Box",
"enabled": true,
"weightUnit": "lb",
"dimensionUnit": "in",
"emptyBoxWeight": 0.5,
"minGrossWeight": 0,
"maxGrossWeight": 20,
"exteriorLength": 10,
"exteriorWidth": 8,
"exteriorHeight": 4,
"interiorLength": 9.5,
"interiorWidth": 7.5,
"interiorHeight": 3.5,
"tags": ["boxes"]
}
]
}
{
"containers": [
{
"name": "Small Box",
"enabled": true,
"type": 0,
"weightUnit": "lb",
"dimensionUnit": "in",
"emptyBoxWeight": 0.5,
"minGrossWeight": 0,
"maxGrossWeight": 20,
"exteriorLength": 10,
"exteriorWidth": 8,
"exteriorHeight": 4,
"interiorLength": 9.5,
"interiorWidth": 7.5,
"interiorHeight": 3.5,
"tags": ["boxes"]
}
]
}
{
"containers": [
{
"enabled": true,
"type": 0,
"name": "Small Box",
"dimensionUnit": "in",
"interiorLength": 9.5,
"interiorWidth": 7.5,
"interiorHeight": 3.5,
"exteriorLength": 10,
"exteriorWidth": 8,
"exteriorHeight": 4,
"weightUnit": "lb",
"emptyBoxWeight": 0.5,
"minGrossWeight": 0,
"maxGrossWeight": 20,
"containerId": "06bb9ea1-0fcf-4d25-90aa-c7aab916abfb"
}
],
"status": {
"success": true,
"messages": [
"Data saved succesfully."
]
}
}
{
"containers": [
{
"containerId": "f3b4a6c8-7b3c-4d2c-94ab-2c1f6cdb2c99",
"name": "Small Box",
"maxGrossWeight": 25
}
]
}
{
"containers": [
{
"enabled": true,
"type": 0,
"name": "Small Box",
"dimensionUnit": "in",
"interiorLength": 9.5,
"interiorWidth": 7.5,
"interiorHeight": 3.5,
"exteriorLength": 10,
"exteriorWidth": 8,
"exteriorHeight": 4,
"weightUnit": "lb",
"emptyBoxWeight": 0.5,
"minGrossWeight": 0,
"maxGrossWeight": 25,
"containerId": "77050564-683a-4960-85d2-bc3a50f8d6f4"
}
],
"status": {
"success": true,
"messages": [
"Data saved succesfully."
]
}
}
{
"containers": [
{"containerId": "f3b4a6c8-7b3c-4d2c-94ab-2c1f6cdb2c99"}
]
}
{
"status": {
"success": true,
"messages": [
"Data deleted succesfully."
]
}
}
The example code creates, updates, and deletes containers. Use the containerId returned from the create response.
<?php
$baseUrl = "https://api.solvingmaze.com/api/v1/containers/partner/$partner/key/$apiKey/warehouse/$warehouseId";
$headers = array('Content-Type: application/json');
// create
$create = array(
"containers" => array(
array(
"name" => "Small Box",
"enabled" => true,
"weightUnit" => "lb",
"dimensionUnit" => "in",
"emptyBoxWeight" => 0.5,
"minGrossWeight" => 0,
"maxGrossWeight" => 20,
"exteriorLength" => 10,
"exteriorWidth" => 8,
"exteriorHeight" => 4,
"interiorLength" => 9.5,
"interiorWidth" => 7.5,
"interiorHeight" => 3.5
)
)
);
$ch = curl_init($baseUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($create));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$createResponse = curl_exec($ch);
curl_close($ch);
echo $createResponse;
// update
$containerId = "CONTAINER_ID";
$update = array(
"containers" => array(
array(
"containerId" => $containerId,
"name" => "Small Box",
"maxGrossWeight" => 25
)
)
);
$ch = curl_init($baseUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($update));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$updateResponse = curl_exec($ch);
curl_close($ch);
echo $updateResponse;
// delete
$delete = array(
"containers" => array(
array("containerId" => $containerId)
)
);
$ch = curl_init($baseUrl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($delete));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$deleteResponse = curl_exec($ch);
curl_close($ch);
echo $deleteResponse;
?>