CubeMaster API Guide

A complete RESTful API guide with technical specifications, interactive sandbox environment, and step 1 through 9 developer implementation tutorial.

Developer Resources & Documentation

Access essential API reference manuals, test live endpoints in our interactive sandbox, and review OpenAPI specifications.

Quick Developer Links
Enterprise Integration Hub & SDK Guides

Looking for step-by-step guides tailored for Cloud Platforms (AWS, Azure, GCP, Cloudflare), ERP/WMS Systems (SAP, Salesforce, Dynamics, NetSuite, Oracle, Manhattan, Blue Yonder), or Developer SDKs?

REST API Endpoints Reference

Base Endpoint: https://api.cubemaster.net

Method Endpoint Path Description & Operation
1. Calculation & Engine API
POST /loads Builds a new 3D load optimization calculation and saves it to the cloud database. Overwrites load with same title.
POST /Edit/Load/{userId} Builds a 3D load optimization plan from editing data buffer and saves it to the cloud repository.
2. Master Data & Database API
GET /Database/Cargoes Retrieves all master SKU cargoes from the database with pagination limit and creation date filters.
GET /Database/Cargoes/{name} Retrieves a specific cargo SKU master record by name from the cargoes database.
POST /Database/Cargoes/Multiple Inserts multiple cargo SKU master records into the database in a single batch call.
PUT /Database/Cargoes/{keyIs} Updates an existing cargo SKU master record (supports partial field updates).
DELETE /Database/Cargoes/{name} Deletes a cargo SKU master record by name from the database.
GET /Database/Containers/{type} Retrieves all containers or vehicles of a specific type (e.g. Truck, Sea Container, Air ULD, Pallet).
GET /Database/Containers/{type}/{name} Retrieves a specific container or vehicle master record by type and name.
POST /Database/Containers/{type} Inserts a new container or vehicle master record into the database.
DELETE /Database/Containers/{type}/{name} Deletes a container or vehicle master record by type and name.
3. Archive & Saved Loads API
GET /Loads Retrieves all saved load optimization plans and calculation histories from the database.
GET /Loads/{userId}/{title} Retrieves a specific saved load optimization plan by user ID and load title.
GET /Loads/{userId}/{title}/{filledContainerSeq} Retrieves details and 3D graphic image for a specific filled container within a saved load.
DELETE /Loads/{userId}/{title} Deletes a saved load optimization plan by user ID and title from the database.

Step-by-Step API Integration Tutorial

Follow Steps 1 through 9 below to connect your legacy database, ERP, WMS, or cloud application to CubeMaster REST API.

To access the CubeMaster Web API, register an account at CubeMaster Online and generate an API key (TokenID) from your user dashboard settings.

Your TokenID must be included in every HTTP request header:

Authorization: TokenID YOUR_SECRET_CUBEMASTER_TOKEN

The CubeMaster API follows REST architectural principles with base URL https://api.cubemaster.net. All payloads accept JSON data over TLS 1.3 encryption.

  • POST https://api.cubemaster.net/loads: Main optimization calculation engine.
  • GET https://api.cubemaster.net/Database/Cargoes: Master SKU database.
  • GET https://api.cubemaster.net/Database/Containers/{type}: Vehicle and container database.

Install HTTP client libraries in your project environment:

# Python
pip install requests sqlite3

# Node.js
npm install node-fetch sqlite3

# .NET C#
dotnet add package RestSharp

Extract order line items from your SQL database, ERP, or WMS and map dimensions to the CubeMaster Cargoes schema:

import sqlite3

def fetch_shipments():
    conn = sqlite3.connect('warehouse.db')
    cursor = conn.cursor()
    cursor.execute("SELECT sku_name, length, width, height, weight, qty FROM order_items")
    items = cursor.fetchall()
    
    cargoes = []
    for r in items:
        cargoes.append({
            "Name": r[0], "Length": r[1], "Width": r[2], "Height": r[3],
            "Weight": r[4], "Qty": r[5], "OrientationsAllowed": "OrientationsAll"
        })
    return cargoes

payload = {
    "Title": "Order #99281 Load Plan",
    "Cargoes": fetch_shipments(),
    "Containers": [
        { "Name": "53FT High Cube Truck", "Length": 630.0, "Width": 98.0, "Height": 106.0 }
    ]
}

import requests

url = "https://api.cubemaster.net/loads"
headers = {
    "Content-Type": "application/json",
    "Authorization": "TokenID YOUR_SECRET_CUBEMASTER_TOKEN"
}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 200:
    data = response.json()
    print("Status:", data["status"])
    print("Loaded Pieces:", data["loadSummary"]["piecesLoaded"])
    print("Volume %:", data["filledContainers"][0]["loadSummary"]["volumeUtilization"])
    print("3D Diagram Image URL:", data["filledContainers"][0]["graphics"]["images"]["path3DDiagram"])

Configure logging for debugging request headers, response execution time, and error status codes:

import logging

logging.basicConfig(level=logging.DEBUG, filename='cubemaster.log')
logging.info(f"Posting request to {url}")
if response.status_code != 200:
    logging.error(f"API Failed: {response.status_code} - {response.text}")

Best practices for enterprise production deployment:

  1. Secrets Management: Store your TokenID in AWS Secrets Manager, Azure Key Vault, or GCP Secret Manager.
  2. Asynchronous Queueing: Use Redis / SQS queues to process high-volume batch load requests asynchronously.
  3. Caching Masters: Cache container dimensions and master SKU definitions locally to reduce API roundtrips.
  4. Webhook Listeners: Register webhook listener endpoints for long-running heavy optimization jobs.