Step-by-step guide and useful resources for integration with your system.
{ "multiProcessed": false, "cargoDetailLoadedFromDatabase": true, "UOM": "UnitEnglish", "userId": "[email protected]" }
{ "status": "success", "message": "Load successfully built", "loadDetails": { "containersUsed": 3, "volumeUtilization": "87%", "weightUtilization": "95%" } }
The CubeMaster API has three main types of endpoints:
For this guide, we’ll focus on the Calculation API. For more information of the all APIs, see the Reference Guide.
Before making API requests, ensure you have the necessary authentication credentials (e.g., API key or token).
Include the API key in the request headers like this:
TokenID: YOUR_API_KEY
If you don’t have an API key, generate it in the Settings - Integration after accessing your account. If you don't have an account yet, sign up.
To build a load, send a POST request to the following endpoint:
POST https://api.cubemaster.net/loads
Add parameters to set more settings to the request:
?multiProcessed=false&loadSaved=true&loadShared=false&UOM=UnitEnglish&graphicsCreated=true&graphicsImageWidth=200&graphicsImageDepth=200
The request body should include:
Here’s an example of a request body in JSON format:
{ "title": "Sample Load Plan", "description": "This is a sample load plan for testing.", "cargoes": [ { "name": "Cargo1", "length": 2.0, "width": 1.5, "height": 1.0, "weight": 50.0, "qty": 10, "style": "Shipcase" } ], "containers": [ { "name": "Container1", "length": 12.0, "width": 2.5, "height": 2.5, "emptyWeight": 1000.0, "maxWeight": 5000.0, "containerType": "SeaVan" } ], "rules": { "algorithmType": "Optimization", "optimizationLevel": 2, "fillDirection": "FrontToRear", "isWeightLimited": true, "isSafeStackingUsed": true } }
Use a tool like Postman, cURL, or a programming language (e.g., Python, JavaScript) to send the request.
Here’s an example using cURL:
curl -X POST "https://api.cubemaster.net/loads?loadSaved=true&loadShared=false&graphicsCreated=true&graphicsImageWidth=200&graphicsImageDepth=200&UOM=UnitEnglish" \ -H "TokenID: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Sample Load Plan", "description": "This is a sample load plan for testing.", "cargoes": [ { "name": "Cargo1", "length": 2.0, "width": 1.5, "height": 1.0, "weight": 50.0, "qty": 10, "style": "Shipcase" } ], "containers": [ { "name": "Container1", "length": 12.0, "width": 2.5, "height": 2.5, "emptyWeight": 1000.0, "maxWeight": 5000.0, "containerType": "SeaVan" } ], "rules": { "algorithmType": "Optimization", "optimizationLevel": 2, "fillDirection": "FrontToRear", "isWeightLimited": true, "isSafeStackingUsed": true } }'
The API will return a response in JSON format. Here’s an example of a successful response:
{ "message": "OK", "calculationError": "succeed", "filledContainers": [ { "name": "Container1", "sequence": 1, "loadQty": 10, "loadVolume": 30.0, "netWeight": 500.0, "grossWeight": 1500.0, "volumeUtilization": 80.0, "weightUtilization": 90.0, "graphics": { "images": [ "https://api.cubemaster.net/graphics/container1.png" ] } } ], "loadSummary": { "cargoesLoaded": 10, "piecesLoaded": 100, "cargoesLeft": 0, "piecesLeft": 0, "volumeLoaded": 30.0, "weightLoaded": 500.0, "containersLoaded": 1 } }
Key fields in the response include:
If you set loadSaved
or loadShared
to true
in the request, the load plan will be saved or shared in CubeMaster Online. You can access it later via the Archive API.
Use the Sandbox Environment provided by CubeMaster to test your requests. Check the error codes in the response to debug any issues (e.g., invalid cargo dimensions, missing parameters) by referring the Swagger Help and Reference Guide.
Once you’re comfortable with the basics, explore advanced features such as:
Once testing is complete, integrate the API into your application (e.g., ERP, WMS, TMS) to automate load planning and data management.