CubeMaster Web API

Step-by-step guide and useful resources for integration with your system.

FAQ

The CubeMaster API is a RESTful API, which means it can be used with a wide range of technologies, including:

Platforms & Frameworks:
Programming Languages:

The API primarily supports the formats of JSON (application/json) for both input and output.

Example API Request (JSON Input):
{
  "multiProcessed": false,
  "cargoDetailLoadedFromDatabase": true,
  "UOM": "UnitEnglish",
  "userId": "[email protected]"
}
                            

Example API Response (JSON Output):
{
  "status": "success",
  "message": "Load successfully built",
  "loadDetails": {
    "containersUsed": 3,
    "volumeUtilization": "87%",
    "weightUtilization": "95%"
  }
}
                            

Pros:
  • Automation & Efficiency – Reduces manual load planning and optimizes cargo placement.
  • Scalability – Can be integrated with multiple platforms, including ERP, WMS, and TMS systems.
  • Real-time Data Processing – Supports real-time load calculations and asynchronous processing.
  • Graphical Representation – Generates load diagrams for visualization.
  • Multiple Unit Systems – Supports different units of measure (Metric, Imperial).
Cons:
  • Potential Learning Curve – May require developers with API and logistics expertise for full integration.
  • Asynchronous Processing Complexity – Webhook-based responses may need additional handling in apps.
  • Limited Input Formats – Primarily supports JSON, making it harder for XML-based systems to integrate directly.
Step 1: Understand the API Endpoints

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.

Step 2: Set Up Authentication

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.

Step 3: Prepare the Request

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
  }
}
            
Step 4: Make the API Request

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
  }
}'
            
Step 5: Handle the Response

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:

Step 6: Save or Share the Load

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.

Step 7: Test and Debug

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.

Step 8: Explore Advanced Features

Once you’re comfortable with the basics, explore advanced features such as:

Step 9: Integrate into Your Application

Once testing is complete, integrate the API into your application (e.g., ERP, WMS, TMS) to automate load planning and data management.