CubeMaster API V2 Developer Guide
Integrate the CubeMaster Load Planning Engine directly into your workflow. This document details the full JSON schema parameters for precision load building.
Base URL: https://api.cubemaster.net
Authentication
CubeMaster requires a specific header for all requests. Obtain yours from your CubeMaster account under Settings > Integration.
Note: Do not use 'Authorization: Bearer'. Use 'TokenID'.
Load Object
The top-level request body for POST /loads, defining the entire load calculation input.
Basic Parameters
| Field | Type | Description |
|---|---|---|
| title | string | Required. Unique name for the load. Used for saving and retrieval. |
| description | string | Optional text description of the load. |
Core Components
| Field | Type | Description |
|---|---|---|
| cargoes | array of Cargo | Required. List of cargo items to load. Each is a Cargo object. |
| emptyContainers | array of EmptyContainer | Required. Available containers to fill. Each is an EmptyContainer object. |
| rules | Rules object | Optional. Calculation rules and constraints. |
Sample Load JSON
{
"title": "Sample Load",
"description": "Test mix load",
"cargoes": [
{
"style": "Shipcase",
"name": "Box1",
"length": 10,
"width": 5,
"height": 3,
"weight": 20,
"qty": 50
}
],
"emptyContainers": [
{
"containerType": "Truck",
"name": "Standard Truck",
"length": 20,
"width": 8,
"height": 8,
"maxWeight": 1000
}
],
"rules": {
"calculationType": "MixLoad",
"algorithmType": "Optimization"
}
}
Cargo Object
The Cargo object defines an item or product (SKU) to be placed in a container. It includes metadata, dimensions, weight, stacking rules, and palletization details.
Basic
| Parameter | Type | Description |
|---|---|---|
| style | string | The type of cargo. Possible values: "Shipcase" (a box or carton containing smaller boxes), "Palletload" (an entire unitload of cargo on a pallet or slipsheet), "Roll" (cylindrical cargo like rolls of paper). Required. |
| name | string | Unique identifier for the cargo, e.g., SKU or part number. Required. |
| description | string | Descriptive text for the cargo, max 50 characters. |
| length | integer | Length of the cargo in the unit specified by UOM (e.g., mm or inches). Required if not loaded from database. |
| width | integer | Width of the cargo. Required if not loaded from database. |
| height | integer | Height of the cargo. Required if not loaded from database. |
| weight | float | Weight of the cargo in the unit specified by UOM (e.g., kg or lbs). |
| qty | integer | Quantity of the cargo to ship. For pre-pack unitloads, represents number of unitloads. Required. |
| pieceInside | integer | Number of pieces inside each cargo unit (e.g., smaller boxes in a shipping box). Used to calculate total pieces as qty * pieceInside. |
Orientations
| Parameter | Type | Description |
|---|---|---|
| orientationsAllowed | string | Allowed orientations (e.g., "Orientations12" for basic orientations #1 and #2). Values like "Orientations123456" for all. |
| turnAllowedOnFloor | boolean | If true, turning orientations allowed on floor. |
| orientationPriority | null/string | Priority for orientations (null if not set). |
| maxLayersOnOrientation1 to maxLayersOnOrientation6 | integer | Max layers for each orientation. 0 means no limit. |
Unitload
| Parameter | Type | Description |
|---|---|---|
| isPalletized | boolean | If true, cargo is palletized before loading. |
| palletizing | object | Pallet configuration details. |
| palletizing.pallet | object | Pallet details: containerType ("Pallet"), palletType (e.g., "Wood2WaysDoube"), dimensions, etc. |
| palletizing.flatPalletTop | boolean | If true, keeps top of partial unitload flat. |
| palletizing.partialPalletsAllowed | boolean | If true, allows partial pallet loads. |
| palletizing.remainQtyToMixPallet | boolean | If true, remaining qty placed on mixed pallets. |
| palletizing.remainQtyToVehicle | boolean | If true, remaining qty placed directly on vehicle floor. |
| palletizing.fixedCargoCountOnPallet | integer | Fixed number of cargo per pallet (0 for no fixed). |
| unitloadTopPattern | string | Pattern for top layers of unitload: "BestFit", "Multi-Surface", etc. |
| unitloadBottomPattern | string | Pattern for bottom layers of unitload. |
| unitloadLayersQtyRotated | integer | Number of layers to rotate in unitload for stability. |
| unitload | null/object | Pre-defined unitload details (null if not pre-pack). |
| palletizedUnitloadsQty | integer | Number of palletized unitloads. |
Extended
| Parameter | Type | Description |
|---|---|---|
| orderPieces | integer | Number of pieces ordered (often 0 if not used). |
| setRatio | integer | Ratio for set loads (e.g., 1:2:1 for components). Used in "Set Load" or "Multiple Set Load" types to maintain proportions. |
| price | integer | Price of the cargo in US$. Used if load price limited rule is active. |
| alias | string | Alias or alternative identifier for the cargo. |
| alias2 | string | Second alias. |
| groupName | string | Group name for keeping cargoes together or separating by stops/destinations. |
| property1 to property10 | string | Custom properties for additional metadata (max 50 characters each). For display in reports. |
| sequence | integer | Loading sequence. Lower values load first if "Small sequences placed earlier" rule is on. |
| diameter | integer | Diameter for cylindrical cargo (rolls). Set to 0 for non-cylindrical. |
| color | integer | RGB color code for visualization. |
| colorHexaCode | string | Hex color code. |
| colorKnownName | string | Known color name. |
Advanced
| Parameter | Type | Description |
|---|---|---|
| maxLayersAllowedOverDifferentCargoes | boolean | If true, allows stacking over different cargoes. |
| stackValue | integer | Stack value for stacking rules (higher allows stacking on lower). |
| stackCode | string | Code for stacking compatibility. |
| maxSupportingWeight | integer | Max weight that can be placed on top. |
| floorStackType | string | Floor stacking rule: "Best Fit", "Bottom Only", "No Bottom". |
| floorStackSupportsOthers | boolean | If true, this cargo supports others on top in floor stacking. |
| overhangAllowed | boolean | If true, overhang allowed. |
| overhangLength | integer | Max overhang length. |
| overhangWidth | integer | Max overhang width. |
| isOptional | boolean | If true, cargo is optional for filling space in balancing. |
| bulgeSize | object | Bulge dimensions (length, width, height) for expansion/compression. |
| emptyContainersFavorite | array | Preferred containers for this cargo. |
| faceOpen | string | Open face: "NeitherSide", etc. |
Sample Cargo JSON
{
"style": "Shipcase",
"name": "Cargo1",
"length": 10,
"width": 5,
"height": 3,
"weight": 20,
"qty": 50
}
EmptyContainer Object
The EmptyContainer object defines the properties and constraints of an empty shipping container for logistics planning.
Basic
| Parameter | Type | Description |
|---|---|---|
| containerType | string | Type of container: "SeaVan", "Truck", "Pallet", "Carton", "ULD". Required. |
| name | string | Identifier, e.g., "53FT-Intermodal". |
| length | integer | Length in UOM units. |
| width | integer | Width. |
| height | integer | Height. |
| maxWeight | integer | Maximum weight capacity in kg (e.g., 63000). |
Drop Deck
| Parameter | Type | Description |
|---|---|---|
| vehicleDropDeckRearSize | null/object | Rear drop deck size for trucks: {length, width, height}. |
| vehicleDropDeckFrontSize | null/object | Front drop deck size: {length, width, height}. |
Extended
| Parameter | Type | Description |
|---|---|---|
| description | string | Optional description (often empty). |
| qty | integer | Number of containers (often 0 for a single definition). |
| priority | integer | Priority for container selection (e.g., 0). |
| emptyWeight | integer | Weight of the empty container in kg (e.g., 0). |
| maxLength | integer | Maximum cargo length (0 if unrestricted). |
| maxWidth | integer | Maximum cargo width (0 if unrestricted). |
| maxHeight | integer | Maximum cargo height (e.g., 111). |
| maxVolPercent | integer | Maximum volume utilization percentage (0 if unrestricted). |
| maxCargoTypes | integer | Maximum number of cargo types (0 if unrestricted). |
| price | integer | Container cost (e.g., 0). |
| maxPrice | integer | Maximum allowable cost (e.g., 0). |
Advanced
| Parameter | Type | Description |
|---|---|---|
| vehicleType | string | Vehicle category (e.g., "Dry"). Matches VehicleTypeEnum (e.g., Dry, Refrigerated). |
| palletType | string | Pallet type (e.g., "Wood2WaysDoube"). Matches PalletTypeEnum. |
| cartonType | string | Carton type (e.g., "Tuck"). Matches CartonTypeEnum. |
| palletThickness | integer | Pallet thickness in cm (e.g., 0). |
| color | integer | Numeric color code for visualization (e.g., 65535). |
| colorHexaCode | string | Hex color code (empty if not specified). |
| colorKnownName | string | Human-readable color name (empty if not specified). |
| palletOverhang | boolean | Whether pallet overhang is allowed (e.g., false). |
| palletOverhangLength | integer | Overhang length in cm (e.g., 0). |
| palletOverhangWidth | integer | Overhang width in cm (e.g., 0). |
| palletUnderhang | boolean | Whether pallet underhang is allowed (e.g., false). |
| palletUnderhangLength | integer | Underhang length in cm (e.g., 0). |
| palletUnderhangWidth | integer | Underhang width in cm (e.g., 0). |
| zones | null/array | Zoning information (null if not used). Array of zone objects with position, size, maxWeight. |
Sample EmptyContainer JSON
{
"containerType": "Truck",
"name": "Standard Truck",
"length": 20,
"width": 8,
"height": 8,
"maxWeight": 1000
}
Rules Object
The Rules object specifies calculation rules for load building, controlling how the engine optimizes and constrains the load.
Basic
| Parameter | Type | Description |
|---|---|---|
| calculationType | string | Type of load: "MixLoad" (mix SKUs into containers), "UnitLoad" (build pallets), "SetLoad" (proportional sets), "MultipleSetLoad". Required. Enum: [MixLoad, UnitLoad, SetLoad, MultipleSetLoad, others]. |
| algorithmType | string | Optimization method: "Optimization" (best results, slower), "MaxVolumeFirst" (faster, approximate). Enum: [Optimization, MaxVolumeFirst, others]. |
| fillDirection | string | Direction to fill: "BottomToTop", "FrontToRear", etc. Enum: [BottomToTop, FrontToRear]. |
| optimizationLevel | integer | Level of optimization effort: 1 (fast) to 4 (thorough). |
| isWeightLimited | boolean | Enforce container weight limits. |
| isPriceLimited | boolean | Enforce price limits if used. |
| isSpreadIdenticalCargoAllowed | boolean | Allow splitting same SKU across containers. |
| isEmptySpaceMerged | boolean | Merge empty spaces in visualization. |
| isSequenceUsed | boolean | Use sequence for loading order. |
| isUnitloadFirst | boolean | Build unitloads before vehicle loading. |
| isUnitloadsPartialAllowedWhenUnitloadsFirst | boolean | If true, allows partial unitloads when unitload first. |
| isUnitloadFilledWithDifferentCargoes | boolean | If true, allows different cargoes on unitload. Read-only. |
| bestFitContainersSelectionType | string | Best fit selection type. Enum: Array [5]. |
| bestFitContainersSelectionMaxVolUtilThreshold | number | Max volume util threshold for best fit. |
| bestFitContainersSelectionMaxWeightUtilThreshold | number | Max weight util threshold for best fit. |
Stacking
| Parameter | Type | Description |
|---|---|---|
| isSafeStackingUsed | boolean | If true, enforces safe stacking rules like support rate. |
| minSupportRate | number | Minimum support rate for safe stacking (e.g., 0.8 for 80%). |
| maxDepthToSupportForSafeStacking | number | Max depth to consider for support in safe stacking. |
| minWeightDifferencePercentageForStackingTwoCargoes | number | Min weight difference % for stacking two different cargoes. |
| stackingRule | string | Stacking rule enum. Enum: Array [16] values (e.g., StackValue, StackCode). |
| groupsStackingRule | string | Stacking rule for groups. Enum: Array [2]. |
| stackingMatrix | array | Matrix for custom stacking rules between cargoes. |
| maxStackingHeight | object | {isUsed: boolean, algorithm: "ProportionalToGroundPlacementWidth", proportionalRateToSetMaxStackingHeight: 1.5} - Controls max stack height dynamically. |
Grouping
| Parameter | Type | Description |
|---|---|---|
| isGroupUsed | boolean | If true, respects groupName for keeping items together. |
| isGroupSequenceUsed | boolean | If true, uses sequence within groups. |
| isSameGroupAllowedInDifferentContainers | boolean | If true, allows splitting groups across containers. |
| isGroupsToPrefContainers | boolean | If true, assigns groups to preferred containers. |
| isSameAlias1TogetherInSameGroup | boolean | If true, keeps same alias1 in same group. |
| isSameAlias2TogetherInSameAlias1AndGroup | boolean | If true, keeps same alias2 within alias1 and group. |
| isDifferentGroupAllowedOnMultiSetLoad | boolean | If true, allows different groups in multi-set loads. |
| isSameGroupDividedToDifferentContainersWhenNotKeptTogether | boolean | If true, divides groups when not kept together. |
Advanced
| Parameter | Type | Description |
|---|---|---|
| isCargoSizeConsolidated | boolean | Consolidate identical sizes. |
| isTuned | boolean | If true, uses tuned parameters for optimization. |
| maxSearchVolPerncentage | number | Max search volume percentage for tuning. |
| maxSearchDepth | integer | Max search depth for algorithm. |
| maxRunTimeSeconds | integer | Max runtime in seconds for calculation. |
| isMultiContainerTypesEnabled | boolean | If true, uses multiple container types. |
| maxFillQtyPerContainer | integer | Max fill quantity per container. |
| isCargoCostComputedFromShipCost | boolean | If true, computes cargo cost from shipping cost. Read-only. |
| isIdenticalCargoStayInOneContainerWhenNotSpread | boolean | If true, keeps identical cargo in one container when not spread. Read-only. |
| isSideSpaceOfCargoFilledWithSameCargo | boolean | If true, fills side spaces with same cargo. Read-only. |
| isCargoSequenceUsedInOppositeOrder | boolean | If true, uses sequence in opposite order. Read-only. |
| isBottomOrientationRespected | boolean | If true, respects bottom orientation. Read-only. |
| isEasyLoadUsed | boolean | If true, uses easy load mode. Read-only. |
| maxCargoTypesPerContainer | integer | Max cargo types per container. Read-only. |
| maxPlacementSize | number | Max placement size. Read-only. |
| isCustomRuleUsedForSolutionsNames | boolean | If true, uses custom naming for solutions. Read-only. |
| prefixOfSolutionsNames | string | Prefix for solution names. Nullable, read-only. |
| suffixOfSolutionsNames | string | Suffix for solution names. Nullable, read-only. |
| sequenceStartingNumberOfSolutionsNames | number | Starting number for sequence in names. Nullable, read-only. |
| sequenceLengthOfSolutionsNames | number | Length of sequence in names. Nullable, read-only. |
Palletizing
| Parameter | Type | Description |
|---|---|---|
| isPalletized | boolean | If true, palletizes cargo. |
| palletizing | object | Palletizing rules for multiple cargoes {...}. |
| palletizing.isUsed | boolean | If true, palletizes cargo. |
| palletizing.isDifferentGroupsAllowedInSamePallet | boolean | If true, allows different groups on a pallet. |
| palletizing.minHeightOfPallets | number | The height the pallets need to be taller than. |
| palletizing.palletizingAlgorithm | string | Algorithm to use for building pallets - "UnitloadsDevelopedInAdvance", "UnitloadsDevelopedDinamically". |
| MixPallet | object | Empty container for mixed pallets {...}. |
Balancing
| Parameter | Type | Description |
|---|---|---|
| isBalanceAppliedToAllSolutions | boolean | If true, applies balance to all solutions. |
| isBalanceAppliedToLastSolution | boolean | If true, applies balance only to last solution. |
| isBalanceReplacedWithSmallerSizes | boolean | If true, replaces with smaller sizes for balance. |
| isBalancePoorUtlizationUnloaded | boolean | If true, unloads poor utilization for balance. |
| maxUtilizationForBalanceUnload | number | Max utilization threshold for unload in balance. |
| isBalanceSpreadLoadBottom | boolean | If true, spreads load at bottom for balance. |
| isBalanceAlignLoadCenter | boolean | If true, aligns load to center for balance. |
| isBalanceFillWithOptionalCargoes | boolean | If true, fills with optional cargoes for balance. |
| optionalCargoesFillingAction | string | Action for optional cargoes. Enum: Array [3]. |
| isBalanceFillWithAdditionalAmountofExstingCargoes | boolean | If true, fills with additional existing cargoes for balance. |
| balanceConfiguration | object | {isUsed: boolean, maxWeightDifference: number} - Weight balance rules across axles or sides. |
Sample Rules JSON
{
"calculationType": "MixLoad",
"algorithmType": "Optimization",
"allowMix": true,
"isWeightLimited": true
}
Response Object
The Response object is the top-level structure returned by the POST /loads endpoint when status is "succeed". It includes overall status, aggregates, and detailed filled containers. If validation or calculation fails, calculationError will contain details instead of filledContainers.
Basic
| Parameter | Type | Description |
|---|---|---|
| status | string | "succeed" or "failed". Indicates if the calculation was successful. |
| message | string | Additional message, e.g., "OK". |
| calculationError | null/object | If failed, details of the error (e.g., validation issues). Null on success. |
Load Summary
| Parameter | Type | Description |
|---|---|---|
| loadSummary | object | Aggregate totals for the entire job across all containers. |
| loadSummary.cargoesLoaded | integer | Total cargo units loaded across all containers. |
| loadSummary.piecesLoaded | integer | Total pieces loaded. |
| loadSummary.cargoesLeft | integer | Cargo units not loaded. |
| loadSummary.piecesLeft | integer | Pieces not loaded. |
| loadSummary.unitloadsLoaded | integer | Total unitloads loaded. |
| loadSummary.weightAdded | number | Total weight added across all containers. |
| loadSummary.volumeUtilization | number | Average volume utilization %. |
| loadSummary.weightUtilization | number | Average weight utilization %. |
Filled Containers
| Parameter | Type | Description |
|---|---|---|
| filledContainers | array | The core results: array of FilledContainer objects, each representing one loaded truck, sea container, or pallet. |
Document
| Parameter | Type | Description |
|---|---|---|
| document | object | Metadata about the saved load (if loadSaved=true). |
| document.title | string | The load title. |
| document.isShared | boolean | If the load is shared company-wide. |
| document.isAutoSaved | boolean | If auto-saved. |
| document.calculationTimeInSeconds | integer | Time taken for calculation. |
| document.processId | string | Process ID for async tracking. |
| document.createdBy | string | User email who created it. |
| document.createdAt | string | Creation timestamp (ISO). |
| document.updatedAt | string | Update timestamp (ISO). |
| document.containerType | string | Type of containers used. |
| document.calculationType | string | The calculationType from rules. |
Sample Response JSON (Success)
{
"status": "succeed",
"message": "OK",
"calculationError": null,
"document": {
"title": "Sample Load",
"isShared": true,
"calculationTimeInSeconds": 5,
"createdAt": "2025-03-26T10:00:00Z"
},
"loadSummary": {
"cargoesLoaded": 50,
"piecesLoaded": 50,
"unitloadsLoaded": 1,
"weightAdded": 1000
},
"filledContainers": [
{
"name": "Truck 1_1",
"sequence": 1,
"loadQty": 50,
"grossWeight": 1000,
"volumeUtilization": 80.5
}
]
}
FilledContainer Object
Represents a container filled with cargo after load calculation. This schema is part of the API response, providing summary, utilization metrics, graphical representations, and precise placement details. It mirrors the "Results" section in the CubeMaster user interface, where results are displayed in various views like Tree View, List View, Tile View, and Report View for analysis.
Basic
| Parameter | Type | Description |
|---|---|---|
| name | string | Identifier for the filled container, often including group or date information (e.g., "002(2025-02-05)"). Corresponds to solution names in the results list. |
| sequence | integer | Order or priority of the container in the load results (e.g., 2). |
| actualSize | object | Physical dimensions of the container {length, width, height} in UOM units. |
| loadSize | object | Dimensions of the loaded cargo footprint {length, width, height}. |
| emptyContainer | object | The original empty container details used for this filled container. |
| uom | string | Unit of measure used for dimensions and weights (e.g., "UnitMetric"). |
Load Summary
| Parameter | Type | Description |
|---|---|---|
| loadSummary | object | Overall metrics summarizing the load efficiency and contents. This corresponds to the summary at the top of the Results section in the user interface. |
| loadSummary.cargoesLoaded | integer | Total number of cargo units loaded into this container. |
| loadSummary.piecesLoaded | integer | Total number of individual pieces loaded (qty * pieceInside across all cargoes). |
| loadSummary.unitloadsLoaded | integer | Number of unitloads (pallets) loaded. |
| loadSummary.volumeLoaded | number | Total volume occupied by loaded cargo in cubic units. |
| loadSummary.volumeUtilization | number | Percentage of container volume utilized (e.g., 81.44). |
| loadSummary.floorUtilization | number | Percentage of floor space utilized (e.g., 84.11). |
| loadSummary.weightLoaded | number | Total weight of loaded cargo. |
| loadSummary.weightUtilization | number | Percentage of max weight utilized. |
| loadSummary.dimWeight | number | Dimensional weight calculation for shipping rates. |
| loadSummary.dimWeightFactor | number | Factor used for dim weight (e.g., 194 for air freight). |
| loadSummary.priceLoaded | number | Total price of loaded cargo. |
| loadSummary.priceUtilization | number | Percentage of max price utilized. |
| loadSummary.cargoesPerLayer | integer | Average number of cargoes per layer. |
| loadSummary.layersLoaded | integer | Total number of layers stacked. |
Graphics
| Parameter | Type | Description |
|---|---|---|
| graphics | object | Visual representations of the load, corresponding to the graphics engine output in the user interface (e.g., 3D and 2D views in Results). |
| graphics.images | object | URLs to various diagram views. |
| graphics.images.path3DDiagram | string | URL to 3D diagram of the load. |
| graphics.images.path2DTop | string | URL to 2D top view. |
| graphics.images.path2DSide | string | URL to 2D side view. |
| graphics.images.path2DFront | string | URL to 2D front view. |
Spaces
| Parameter | Type | Description |
|---|---|---|
| spaces | array | Array of space objects representing placement zones or build steps within the container. This details how cargo is arranged, similar to the detailed breakdown in the Report View. |
| spaces[].sequence | integer | Order of the space in the loading sequence. |
| spaces[].isEmpty | boolean | If true, this space is unused/empty. |
| spaces[].cargoesLoaded | integer | Number of cargo units in this space. |
| spaces[].piecesLoaded | integer | Number of individual pieces in this space. |
| spaces[].cargo | object | The Cargo object details for items in this space. |
| spaces[].arrangement | object | Layout counts {length: int, width: int, height: int} - how many along each dimension. |
| spaces[].pos | object | Position coordinates {length, width, height} of the space start. |
| spaces[].size | object | Dimensions of the space {length, width, height}. |
| spaces[].graphics | object | Thumbnail images for this space, if thumbnailsCreated=true. |
| spaces[].graphics.images.pathThumbnail | string | URL to thumbnail of the space. |
Placements (Sub of Spaces)
| Parameter | Type | Description |
|---|---|---|
| spaces[].placements | array | Detailed individual cargo placements within the space, included if placementsCreated=true. This provides precise positioning for each item. |
| spaces[].placements[].sequence | integer | Order of this placement. |
| spaces[].placements[].fillDirection | string | Orientation used (e.g., "Orientation1"). |
| spaces[].placements[].pos | object | Position {length, width, height} of this placement. |
| spaces[].placements[].size | object | Size {length, width, height} of this placement. |
Manifest
| Parameter | Type | Description |
|---|---|---|
| manifest | array | Summary per cargo type loaded, similar to the Cargoes section in the Report View, showing loaded quantities and utilizations. |
| manifest[].sequence | integer | Order of this cargo in the manifest. |
| manifest[].cargo | object | The Cargo object details. |
| manifest[].cargoesLoaded | integer | Number of this cargo loaded. |
| manifest[].piecesLoaded | integer | Number of pieces of this cargo. |
| manifest[].unitloadsLoaded | integer | Number of unitloads for this cargo. |
| manifest[].volumeUtilization | number | Volume % for this cargo. |
| manifest[].weightUtilization | number | Weight % for this cargo. |
| manifest[].priceUtilization | number | Price % for this cargo. |
Advanced
| Parameter | Type | Description |
|---|---|---|
| cog | object | Center of gravity {length, width, height}, used for balance checks. |
| cargoGroups | null/array | Grouped cargoes if grouping rules were applied. |
| reportLinks | object | Links to detailed reports, corresponding to the Report View in the user interface. |
| reportLinks.overview | string | URL to the full load report. |
Sample FilledContainer JSON
{
"name": "Truck 1_1",
"sequence": 1,
"loadQty": 50,
"grossWeight": 1000,
"volumeUtilization": 80.5
}
Practical Use Cases
Manufacturing Industry
In manufacturing, use the API to optimize loading of auto parts into trucks. For example, load crossmembers and assemblies into intermodal containers to maximize space and minimize damage. Set isPalletized=true for palletizing parts, and use maxSupportingWeight to ensure heavy items are at the bottom.
Logistics and Shipping
For logistics companies, calculate mix loads for sea containers or trucks. Use calculationType="MixLoad" to mix different SKUs, and balanceConfiguration to ensure weight distribution for safe transport. Integrate with TMS systems to automate route planning.
E-Commerce
In e-commerce, optimize carton packing for orders. Use containerType="Carton" and algorithmType="Basic" for fast calculations during checkout. This reduces shipping costs by minimizing package size and number.
Retail and Distribution
For retail, plan pallet loads for warehouse storage. Set palletizing.fixedCargoCountOnPallet to standard quantities, and use maxStackingHeight to comply with safety regulations.
Aerospace and Defense
Optimize ULD loads for air freight. Use containerType="ULD" and isWeightLimited=true to stay under aircraft weight limits. Include zones for fragile items.
Food and Beverage
For perishable goods, use vehicleType="Refrigerated" and allowMix=false to separate items. Use groupName for temperature zones.
Pharmaceuticals
Ensure secure loading with isSafeStackingUsed=true and minSupportRate=0.95 for fragile vials. Use stackingMatrix to define compatibility between items.
Integration Examples for Platforms and Technologies
The API supports integration with various platforms like web, mobile, ERP, cloud, IoT, and technologies including Python, JavaScript, Java, C#, PHP, Ruby, Go.
cURL (Command Line)
cURL Example
curl -X POST "https://api.cubemaster.net/loads?graphicsCreated=true&UOM=UnitEnglish" \
-H "TokenID: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"title": "Sample", "cargoes": [{"style": "Shipcase", "name": "Box1", "length": 10, "width": 5, "height": 3, "weight": 20, "qty": 50}], "emptyContainers": [{"containerType": "Truck", "name": "Truck1", "length": 20, "width": 8, "height": 8, "maxWeight": 1000}], "rules": {"calculationType": "MixLoad"}}'
Python (Requests)
Python Example
import requests
url = "https://api.cubemaster.net/loads"
params = {"graphicsCreated": True, "UOM": "UnitEnglish"}
headers = {"TokenID": "YOUR_API_KEY", "Content-Type": "application/json"}
data = {
"title": "Sample",
"cargoes": [{"style": "Shipcase", "name": "Box1", "length": 10, "width": 5, "height": 3, "weight": 20, "qty": 50}],
"emptyContainers": [{"containerType": "Truck", "name": "Truck1", "length": 20, "width": 8, "height": 8, "maxWeight": 1000}],
"rules": {"calculationType": "MixLoad"}
}
response = requests.post(url, params=params, headers=headers, json=data)
print(response.json())
JavaScript (Axios)
JavaScript Example
const axios = require('axios');
axios.post('https://api.cubemaster.net/loads', {
title: 'Sample',
cargoes: [{style: 'Shipcase', name: 'Box1', length: 10, width: 5, height: 3, weight: 20, qty: 50}],
emptyContainers: [{containerType: 'Truck', name: 'Truck1', length: 20, width: 8, height: 8, maxWeight: 1000}],
rules: {calculationType: 'MixLoad'}
}, {
params: {graphicsCreated: true, UOM: 'UnitEnglish'},
headers: {'TokenID': 'YOUR_API_KEY', 'Content-Type': 'application/json'}
}).then(res => console.log(res.data));
Java (Spring Boot)
Java Example
import org.springframework.web.client.RestTemplate;
RestTemplate restTemplate = new RestTemplate();
String url = "https://api.cubemaster.net/loads?graphicsCreated=true&UOM=UnitEnglish";
Map data = Map.of(
"title", "Sample",
"cargoes", List.of(Map.of("style", "Shipcase", "name", "Box1", "length", 10, "width", 5, "height", 3, "weight", 20, "qty", 50)),
"emptyContainers", List.of(Map.of("containerType", "Truck", "name", "Truck1", "length", 20, "width", 8, "height", 8, "maxWeight", 1000)),
"rules", Map.of("calculationType", "MixLoad")
);
HttpHeaders headers = new HttpHeaders();
headers.set("TokenID", "YOUR_API_KEY");
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity
C# (.NET)
C# Example
using System.Net.Http;
using System.Text;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("TokenID", "YOUR_API_KEY");
var url = "https://api.cubemaster.net/loads?graphicsCreated=true&UOM=UnitEnglish";
var content = new StringContent(@"{
""title"": ""Sample"",
""cargoes"": [{""style"": ""Shipcase"", ""name"": ""Box1"", ""length"": 10, ""width"": 5, ""height"": 3, ""weight"": 20, ""qty"": 50}],
""emptyContainers"": [{""containerType"": ""Truck"", ""name"": ""Truck1"", ""length"": 20, ""width"": 8, ""height"": 8, ""maxWeight"": 1000}],
""rules"": {""calculationType"": ""MixLoad""}
}", Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
PHP
PHP Example
'Sample',
'cargoes' => [[
'style' => 'Shipcase',
'name' => 'Box1',
'length' => 10,
'width' => 5,
'height' => 3,
'weight' => 20,
'qty' => 50
]],
'emptyContainers' => [[
'containerType' => 'Truck',
'name' => 'Truck1',
'length' => 20,
'width' => 8,
'height' => 8,
'maxWeight' => 1000
]],
'rules' => ['calculationType' => 'MixLoad']
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'TokenID: YOUR_API_KEY',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Ruby
Ruby Example
require 'net/http'
require 'json'
uri = URI('https://api.cubemaster.net/loads?graphicsCreated=true&UOM=UnitEnglish')
req = Net::HTTP::Post.new(uri)
req['TokenID'] = 'YOUR_API_KEY'
req['Content-Type'] = 'application/json'
data = {
title: 'Sample',
cargoes: [{
style: 'Shipcase',
name: 'Box1',
length: 10,
width: 5,
height: 3,
weight: 20,
qty: 50
}],
emptyContainers: [{
containerType: 'Truck',
name: 'Truck1',
length: 20,
width: 8,
height: 8,
maxWeight: 1000
}],
rules: {
calculationType: 'MixLoad'
}
}
req.body = data.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(req)
end
puts res.body
Go
Go Example
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.cubemaster.net/loads?graphicsCreated=true&UOM=UnitEnglish"
data := map[string]interface{}{
"title": "Sample",
"cargoes": []map[string]interface{}{{
"style": "Shipcase",
"name": "Box1",
"length": 10,
"width": 5,
"height": 3,
"weight": 20,
"qty": 50,
}},
"emptyContainers": []map[string]interface{}{{
"containerType": "Truck",
"name": "Truck1",
"length": 20,
"width": 8,
"height": 8,
"maxWeight": 1000,
}},
"rules": map[string]interface{}{
"calculationType": "MixLoad",
},
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("TokenID", "YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
Endpoints: Calculation
Builds a new load and saves it to the loads database. Overwrites a load with the same title.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| multiProcessed | boolean | Set true for asynchronous processing with webhook result delivery. False for immediate results. | false | false |
| cargoDetailLoadedFromDatabase | boolean | If true, cargo details are loaded from the database by name. | false | false |
| containerDetailLoadedFromDatabase | boolean | If true, container details are loaded from the database by name. | false | false |
| loadSaved | boolean | If true, the load is saved to the database. | true | false |
| loadShared | boolean | If true, the load is shared company-wide. | true | false |
| userId | string | Email of the user under whom the load is saved. | API credential email | false |
| webhookListenerURLToNewLoad | string | Webhook URL for asynchronous load results. | none | false |
| graphicsCreated | boolean | If true, generates container graphics. | false | false |
| graphicsImageWidth | integer | Width of graphics in pixels. | 200 | false |
| graphicsImageDepth | integer | Depth of graphics in pixels. | 200 | false |
| graphicsShowScale | boolean | If true, includes measurements in graphics. | false | false |
| graphicsBackgroundColorRGB | integer | RGB color for graphics background. | 0 | false |
| thumbnailsCreated | boolean | If true, generates space thumbnails. | false | false |
| thumbnailsImageWidth | integer | Width of thumbnails in pixels. | 200 | false |
| thumbnailsImageDepth | integer | Depth of thumbnails in pixels. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | If true, thumbnails are in black and white. | false | false |
| spacesCreated | boolean | If true, includes space details in response. | false | false |
| placementsCreated | boolean | If true, includes placement details in spaces. | false | false |
| UOM | string | Unit of measure: "UnitEnglish", "UnitMetric", "UnitHighMetric". | UnitEnglish | false |
| reportLanguage | string | Language for reports: "ENG", "GER", "SPN", "FRN", "BRZ", "CHN", "JPN", "KOR". | ENG | false |
| reportToolbarShown | boolean | If true, shows report toolbar. | false | false |
Request Body: Load object (see Load Schema).
Response: Response object (see Response Schema).
Endpoints: Database/Master Data
Retrieves a cargo by name from the cargoes database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| UOM | string | Unit of measure. | UnitEnglish | false |
Response: Cargo object.
Deletes a cargo by name from the cargoes database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| None | - | - | - | - |
Retrieves all cargoes from the cargoes database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| limit | integer | Limits the number of cargoes returned. | 10 | false |
| createdAt | string | Filter by creation date. | none | false |
| shared | boolean | If true, returns only shared cargoes. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Inserts multiple cargoes into the cargoes database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| UOM | string | Unit of measure. | UnitEnglish | false |
Request Body: {cargoes: array of Cargo objects}.
Updates a cargo (partial updates supported).
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| UOM | string | Unit of measure. | UnitEnglish | false |
Request Body: Partial Cargo object.
Retrieves all containers of a specific type (e.g., Truck, Pallet).
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| limit | integer | Limits the number returned. | 10 | false |
| createdAt | string | Filter by creation date. | none | false |
| shared | boolean | If true, returns only shared. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Inserts a container into the containers database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| UOM | string | Unit of measure. | UnitEnglish | false |
Request Body: EmptyContainer object.
Retrieves a container by type and name.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| UOM | string | Unit of measure. | UnitEnglish | false |
Deletes a container by type and name.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| None | - | - | - | - |
Endpoints: Archive API
Retrieves all saved loads from the database.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| limit | integer | Limits the number of loads returned. | 10 | false |
| createdAt | string | Filter by creation date. | none | false |
| shared | boolean | If true, returns only shared loads. | false | false |
| graphicsCreated | boolean | If true, includes graphics. | false | false |
| graphicsImageWidth | integer | Width of graphics in pixels. | 200 | false |
| graphicsImageDepth | integer | Depth of graphics in pixels. | 200 | false |
| graphicsShowScale | boolean | If true, includes measurements in graphics. | false | false |
| graphicsBackgroundColorRGB | integer | RGB color for graphics background. | 0 | false |
| thumbnailsCreated | boolean | If true, generates space thumbnails. | false | false |
| thumbnailsImageWidth | integer | Width of thumbnails in pixels. | 200 | false |
| thumbnailsImageDepth | integer | Depth of thumbnails in pixels. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | If true, thumbnails are in black and white. | false | false |
| spacesCreated | boolean | If true, includes space details. | false | false |
| placementsCreated | boolean | If true, includes placement details. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Retrieves a specific load by user ID and title.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| graphicsCreated | boolean | If true, includes graphics. | false | false |
| graphicsImageWidth | integer | Width of graphics. | 200 | false |
| graphicsImageDepth | integer | Depth of graphics. | 200 | false |
| graphicsShowScale | boolean | Include measurements in graphics. | false | false |
| graphicsBackgroundColorRGB | integer | Background color. | 0 | false |
| thumbnailsCreated | boolean | Generate space thumbnails. | false | false |
| thumbnailsImageWidth | integer | Thumbnail width. | 200 | false |
| thumbnailsImageDepth | integer | Thumbnail depth. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | Black and white thumbnails. | false | false |
| spacesCreated | boolean | Include space details. | false | false |
| placementsCreated | boolean | Include placement details. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Deletes a load by user ID and title.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| None | - | - | - | - |
Retrieves a specific filled container from a load.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| graphicsCreated | boolean | If true, includes graphics. | false | false |
| graphicsImageWidth | integer | Width of graphics. | 200 | false |
| graphicsImageDepth | integer | Depth of graphics. | 200 | false |
| graphicsShowScale | boolean | Include measurements. | false | false |
| graphicsBackgroundColorRGB | integer | Background color. | 0 | false |
| thumbnailsCreated | boolean | Generate thumbnails. | false | false |
| thumbnailsImageWidth | integer | Thumbnail width. | 200 | false |
| thumbnailsImageDepth | integer | Thumbnail depth. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | Black and white. | false | false |
| spacesCreated | boolean | Include space details. | false | false |
| placementsCreated | boolean | Include placement details. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Endpoints: Edit & Upload API
Builds a load from editing data and saves it.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| multiProcessed | boolean | Asynchronous processing. | false | false |
| webhookListenerURLToNewLoad | string | Webhook for async. | none | false |
| loadSaved | boolean | Save the load. | true | false |
| loadShared | boolean | Share the load. | true | false |
| graphicsCreated | boolean | Generate graphics. | false | false |
| graphicsImageWidth | integer | Graphics width. | 200 | false |
| graphicsImageDepth | integer | Graphics depth. | 200 | false |
| graphicsShowScale | boolean | Show scale in graphics. | false | false |
| graphicsBackgroundColorRGB | integer | Background color. | 0 | false |
| thumbnailsCreated | boolean | Generate thumbnails. | false | false |
| thumbnailsImageWidth | integer | Thumbnail width. | 200 | false |
| thumbnailsImageDepth | integer | Thumbnail depth. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | Black and white thumbnails. | false | false |
| spacesCreated | boolean | Include spaces. | false | false |
| placementsCreated | boolean | Include placements. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
| reportLanguage | string | Report language. | ENG | false |
| reportToolbarShown | boolean | Show toolbar. | false | false |
Retrieves editing data for a user.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| None | - | - | - | - |
Deletes editing data for a user.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| None | - | - | - | - |
Retrieves a filled container from editing data.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| graphicsCreated | boolean | Include graphics. | false | false |
| graphicsImageWidth | integer | Graphics width. | 200 | false |
| graphicsImageDepth | integer | Graphics depth. | 200 | false |
| graphicsShowScale | boolean | Show scale. | false | false |
| graphicsBackgroundColorRGB | integer | Background color. | 0 | false |
| thumbnailsCreated | boolean | Generate thumbnails. | false | false |
| thumbnailsImageWidth | integer | Thumbnail width. | 200 | false |
| thumbnailsImageDepth | integer | Thumbnail depth. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | Black and white. | false | false |
| spacesCreated | boolean | Include spaces. | false | false |
| placementsCreated | boolean | Include placements. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
Uploads an Excel file to build mass loads.
Query Parameters
| Name | Type | Description | Default | Required |
|---|---|---|---|---|
| multiProcessed | boolean | Asynchronous processing. | false | false |
| webhookListenerURLToNewLoad | string | Webhook URL. | none | false |
| loadSaved | boolean | Save the load. | true | false |
| loadShared | boolean | Share the load. | true | false |
| userId | string | User email. | API email | false |
| graphicsCreated | boolean | Generate graphics. | false | false |
| graphicsImageWidth | integer | Graphics width. | 200 | false |
| graphicsImageDepth | integer | Graphics depth. | 200 | false |
| graphicsShowScale | boolean | Show scale. | false | false |
| graphicsBackgroundColorRGB | integer | Background color. | 0 | false |
| thumbnailsCreated | boolean | Generate thumbnails. | false | false |
| thumbnailsImageWidth | integer | Thumbnail width. | 200 | false |
| thumbnailsImageDepth | integer | Thumbnail depth. | 200 | false |
| thumbnailsCreatedInBlackWhite | boolean | Black and white. | false | false |
| spacesCreated | boolean | Include spaces. | false | false |
| placementsCreated | boolean | Include placements. | false | false |
| UOM | string | Unit of measure. | UnitEnglish | false |
| reportLanguage | string | Report language. | ENG | false |
| reportToolbarShown | boolean | Show toolbar. | false | false |
Request Body: Multipart form with Excel file.
Enumerations
ContainerTypeEnum
- Carton
- Pallet
- SeaVan
- Truck
- AirPallet
VehicleTypeEnum
- Dry
- OpenTop
- FlatRack
PalletTypeEnum
- Wood2WaysDoube
- Wood4Ways
- Plastic4Ways
- Paper
- Steel
- Slipsheet
- Plastic2WaysDoube
- Plastic2WaysSingle
- Plastic4Ways
CartonTypeEnum
- Tuck
- TuckWithoutMinorFlap
- RSC
- RSCClosed
- HSC
- Cube
- TrayHalf
- ShrinkWrap
- BottomOpen
StyleEnum (Cargo)
- Shipcase
- Palletload
- Roll
OrientationEnum
- OrientationsBasic
- OrientationsAll
- Orientation1
- Orientation2
- Orientation3
- Orientation4
- Orientation5
- Orientation6
- Orientations12
- Orientations13
- Orientations14
- Orientations15
- Orientations16
- Orientations23
- Orientations24
- Orientations25
- Orientations26
- Orientations34
- Orientations35
- Orientations36
- Orientations45
- Orientations46
- Orientations56
- Orientations123
- Orientations134
- Orientations145
- Orientations156
- Orientations234
- Orientations245
- Orientations256
- Orientations345
- Orientations356
- Orientations456
- Orientations1234
- Orientations1235
- Orientations1236
- Orientations1245
- Orientations1256
- Orientations1345
- Orientations1346
- Orientations1356
- Orientations1456
- Orientations2345
- Orientations2456
- Orientations3456
- OrientationsDefault
PatternEnum
- BestFit
- Pattern1Block
- Pattern2Blocks
- Pattern3Blocks
- Pattern4Blocks
- MultiSurface
- PatternVoid
CalculationTypeEnum
- MixLoad
- UnitLoad
- SetLoad
- MultipleSetLoad
AlgorithmTypeEnum
- Optimization
- MaxVolumeFirst
BestfitContainersSelectionEnum
- BestfitDisabled
- BestfitMaxEmptySizeFirst
- BestfitMaxVolUtilFirst
- BestfitMaxLoadVolFirst
- BestfitMaxWeightUtilFirst
FillDirectionEnum
- BottomToTop
- FrontToRear
StackingRuleEnum
- HigherStackValueBottomFirst
- AllowedTopBottmStackValueSame
- AllowedTopBottomFootPrintSame
- HeavierBottomFirst
- FloorStack
- FollowStackMatrix
- FollowStackMatrixByCargoNames
- FollowStackMatrixByStackCodes
- AlwaysNotAllowed
- BestFit
- AlwaysSingleLayerOnBottom
- FloorStackAndHeavierBottomFirst
- AllowedTopBottomFootPrintSameHeavierBottomFirst
- AllowedTopBottomFootPrintSameFollowDeadStack
- AllowedTopBottomFootPrintSameHigherStackValueBottomFirst
- AllowedTopBottomFootPrintSameOrTopFootPrintSmaller
- FormPyramidStack
GroupsStackingRuleEnum
- AlwaysNotAllowed
- BestFit
OptionalCargoesFillingActionEnum
- Starightforward
- CargoSequenceRespectedAndDisplacementMinimized
- GroupSequenceRespectedAndDisplacementMinimized
FAQ
How do I get an API key?
Log into your CubeMaster account, go to Settings > Integration, and generate or copy your API key. Use it in the header like this: TokenID: YOUR_API_KEY.
What happens if I send a load with an existing title?
The existing load will be overwritten. For example, if you POST /loads with the same title, it updates the existing one.
Can I test the API without saving loads?
Yes, set loadSaved=false in the query parameters. Example: POST /loads?loadSaved=false.
How do asynchronous requests work?
Use multiProcessed=true and provide webhookListenerURLToNewLoad. The server will POST the result to your URL when done.
What units of measure are supported?
UnitEnglish (inches/lbs), UnitMetric (mm/kg), UnitHighMetric (cm/kg). Set UOM in query parameters.
How do I view generated graphics?
Set graphicsCreated=true. The response will include URLs in graphics.images for 3D and 2D views.
What if I encounter a 401 error?
Check your API key in the TokenID header. Ensure it's correct and not expired.
How do I retrieve all saved loads?
Use GET /Loads with optional parameters like limit=20 or shared=true.
Can I delete a specific load?
Yes, use DELETE /Loads/{userId}/{title}.
How do I add cargo to the database?
Use POST /Database/Cargoes/Multiple with a body containing an array of cargoes.
How do I update a cargo?
Use PUT /Database/Cargoes/{keyIs} with partial cargo object in body.
What’s the difference between synchronous and asynchronous processing?
Synchronous (multiProcessed=false) returns results immediately, while asynchronous (true) uses a webhook for larger loads to avoid timeouts.
How do I specify a custom background color for graphics?
Use graphicsBackgroundColorRGB with an integer RGB value, e.g., 16711680 for red.
Can I retrieve a specific container from a load?
Yes, use GET /Loads/{userId}/{title}/{filledContainerSeq}.
How do I share a load company-wide?
Set loadShared=true when creating or editing the load.
What languages are supported for reports?
ENG, GER, SPN, FRN, BRZ, CHN, JPN, KOR. Set reportLanguage in query.
How do I handle large datasets?
Use POST /Upload/Excel to upload Excel files for mass load creation.
What if my calculation fails?
Check the calculationError field in the response for details on validation or processing issues.
How do I use database-loaded details?
Set cargoDetailLoadedFromDatabase=true and provide only name and qty in cargoes array.
Can I get thumbnails in black and white?
Set thumbnailsCreatedInBlackWhite=true when thumbnailsCreated=true.
How do I include measurements in graphics?
Set graphicsShowScale=true.
What is the max image size for graphics?
Use graphicsImageWidth and graphicsImageDepth, up to reasonable sizes like 800.
How do I limit the number of results in GET /Loads?
Use the limit parameter, e.g., limit=5.
How do I filter loads by creation date?
Use createdAt parameter in GET /Loads, e.g., createdAt=2025-03-26.
What is the difference between spaces and placements?
Spaces are zones with grouped cargo, placements are individual item positions within spaces.
How do I enable detailed placements?
Set placementsCreated=true in query.
Can I use the API for real-time calculations?
Yes, for small loads use synchronous; for large, async with webhook.
How do I integrate with ERP systems?
Fetch data from ERP, construct Load JSON, call POST /loads, process response back to ERP.
Tutorials
Tutorial 1: Creating and Saving a Basic Load
Steps to create a truck load with cargo and save it.
- Prepare the Request: Define cargo and container details.
- Send the Request: POST /loads with TokenID header.
- Check the Response: Verify status "succeed" and filledContainers.
Request Body
{
"title": "Basic Truck Load",
"description": "Tutorial load",
"cargoes": [
{
"style": "shipcase",
"name": "Tutorial Box",
"length": 10,
"width": 5,
"height": 3,
"weight": 20,
"qty": 40
}
],
"emptyContainers": [
{
"containerType": "Truck",
"name": "Tutorial Truck",
"length": 20,
"width": 8,
"height": 8,
"maxWeight": 1000
}
],
"rules": {
"calculationType": "MixLoad",
"algorithmType": "Optimization"
}
}
Tutorial 2: Using Database Cargo and Containers
Steps to build a load using pre-saved database entries.
- Add Cargo to Database: POST /Database/Cargoes/Multiple.
- Add Container to Database: POST /Database/Containers/Truck.
- Create Load from Database: POST /loads?cargoDetailLoadedFromDatabase=true&containerDetailLoadedFromDatabase=true with names only.
- Verify Response: Check load details.
Tutorial 3: Generating Graphics and Reviewing a Load
Steps to create a load with graphics and retrieve it.
- Create Load with Graphics: POST /loads?graphicsCreated=true&graphicsShowScale=true.
- Check Graphics in Response: Look for URLs in graphics.images.
- Retrieve the Load: GET /Loads/{userId}/{title}.
- Review Specific Container: GET /Loads/{userId}/{title}/{seq}.
Tutorial 4: Asynchronous Load Processing
Steps to process a large load asynchronously.
- Set Up Webhook: Create a server endpoint to receive POST results.
- Send Asynchronous Request: POST /loads?multiProcessed=true&webhookListenerURLToNewLoad=your-url.
- Receive Webhook Response: Handle the POST with the Response object.
Tutorial 5: Updating Cargo in Database
Steps to update an existing cargo.
- Retrieve Cargo: GET /Database/Cargoes/{name}.
- Update: PUT /Database/Cargoes/{name} with partial body, e.g., {"weight": 25}.
- Verify: GET again to check changes.
Tutorial 6: Deleting a Load
Steps to delete a saved load.
- List Loads: GET /Loads to find the title.
- Delete: DELETE /Loads/{userId}/{title}.
- Confirm: GET /Loads to see it's gone.
Tutorial 7: Using UnitLoad Calculation
Steps to build pallets.
- Prepare: Set rules.calculationType = "UnitLoad".
- Send: POST /loads with cargoes and pallet as emptyContainer.
- Response: FilledContainers as loaded pallets.
Tutorial 8: Handling Errors
Steps to debug a failed calculation.
- Send Invalid Request: e.g., missing required fields.
- Check Response: Look for status "failed" and calculationError details.
- Fix and Retry: Adjust based on error message.
Tutorial 9: Uploading Excel for Mass Loads
Steps to upload Excel.
- Prepare Excel: Format with cargoes and containers as per template.
- Upload: POST /Upload/Excel with multipart file.
- Response: Processed loads.
Tutorial 10: Retrieving Specific Container with Placements
Steps to get detailed placements.
- Create Load: POST /loads?placementsCreated=true.
- Retrieve Container: GET /Loads/{userId}/{title}/{seq}?placementsCreated=true.
- Analyze: Use spaces.placements for positions.
Tutorial 11: SetLoad for Proportional Loading
Steps to load items in set ratios.
- Set Ratios: Use setRatio in cargoes, e.g., 1 for A, 2 for B.
- Rules: calculationType = "SetLoad".
- Send: POST /loads.
- Response: Loads maintaining ratios.
Tutorial 12: Balancing Weight Distribution
Steps to balance load.
- Rules: balanceConfiguration = {isUsed: true, maxWeightDifference: 100}.
- Send: POST /loads.
- Check: Response cog for balance.
Tutorial 13: Using Custom Stacking Matrix
Steps to define stacking compatibility.
- Rules: stackingMatrix = array of rules between cargoes.
- Send: POST /loads.
- Response: Stacking respects matrix.
Tutorial 14: Multi-Container Types
Steps to use different containers.
- Rules: isMultiContainerTypesEnabled = true.
- EmptyContainers: Array with different types.
- Send: POST /loads.
- Response: Filled with optimal types.
Tutorial 15: Custom Solution Names
Steps to name solutions.
- Rules: isCustomRuleUsedForSolutionsNames = true, prefixOfSolutionsNames = "Load-".
- Send: POST /loads.
- Response: filledContainers names like "Load-001".