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.

HEADER TokenID: {YOUR_API_KEY}

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

FieldTypeDescription
titlestringRequired. Unique name for the load. Used for saving and retrieval.
descriptionstringOptional text description of the load.

Core Components

FieldTypeDescription
cargoesarray of CargoRequired. List of cargo items to load. Each is a Cargo object.
emptyContainersarray of EmptyContainerRequired. Available containers to fill. Each is an EmptyContainer object.
rulesRules objectOptional. 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

ParameterTypeDescription
stylestringThe 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.
namestringUnique identifier for the cargo, e.g., SKU or part number. Required.
descriptionstringDescriptive text for the cargo, max 50 characters.
lengthintegerLength of the cargo in the unit specified by UOM (e.g., mm or inches). Required if not loaded from database.
widthintegerWidth of the cargo. Required if not loaded from database.
heightintegerHeight of the cargo. Required if not loaded from database.
weightfloatWeight of the cargo in the unit specified by UOM (e.g., kg or lbs).
qtyintegerQuantity of the cargo to ship. For pre-pack unitloads, represents number of unitloads. Required.
pieceInsideintegerNumber of pieces inside each cargo unit (e.g., smaller boxes in a shipping box). Used to calculate total pieces as qty * pieceInside.

Orientations

ParameterTypeDescription
orientationsAllowedstringAllowed orientations (e.g., "Orientations12" for basic orientations #1 and #2). Values like "Orientations123456" for all.
turnAllowedOnFloorbooleanIf true, turning orientations allowed on floor.
orientationPrioritynull/stringPriority for orientations (null if not set).
maxLayersOnOrientation1 to maxLayersOnOrientation6integerMax layers for each orientation. 0 means no limit.

Unitload

ParameterTypeDescription
isPalletizedbooleanIf true, cargo is palletized before loading.
palletizingobjectPallet configuration details.
palletizing.palletobjectPallet details: containerType ("Pallet"), palletType (e.g., "Wood2WaysDoube"), dimensions, etc.
palletizing.flatPalletTopbooleanIf true, keeps top of partial unitload flat.
palletizing.partialPalletsAllowedbooleanIf true, allows partial pallet loads.
palletizing.remainQtyToMixPalletbooleanIf true, remaining qty placed on mixed pallets.
palletizing.remainQtyToVehiclebooleanIf true, remaining qty placed directly on vehicle floor.
palletizing.fixedCargoCountOnPalletintegerFixed number of cargo per pallet (0 for no fixed).
unitloadTopPatternstringPattern for top layers of unitload: "BestFit", "Multi-Surface", etc.
unitloadBottomPatternstringPattern for bottom layers of unitload.
unitloadLayersQtyRotatedintegerNumber of layers to rotate in unitload for stability.
unitloadnull/objectPre-defined unitload details (null if not pre-pack).
palletizedUnitloadsQtyintegerNumber of palletized unitloads.

Extended

ParameterTypeDescription
orderPiecesintegerNumber of pieces ordered (often 0 if not used).
setRatiointegerRatio for set loads (e.g., 1:2:1 for components). Used in "Set Load" or "Multiple Set Load" types to maintain proportions.
priceintegerPrice of the cargo in US$. Used if load price limited rule is active.
aliasstringAlias or alternative identifier for the cargo.
alias2stringSecond alias.
groupNamestringGroup name for keeping cargoes together or separating by stops/destinations.
property1 to property10stringCustom properties for additional metadata (max 50 characters each). For display in reports.
sequenceintegerLoading sequence. Lower values load first if "Small sequences placed earlier" rule is on.
diameterintegerDiameter for cylindrical cargo (rolls). Set to 0 for non-cylindrical.
colorintegerRGB color code for visualization.
colorHexaCodestringHex color code.
colorKnownNamestringKnown color name.

Advanced

ParameterTypeDescription
maxLayersAllowedOverDifferentCargoesbooleanIf true, allows stacking over different cargoes.
stackValueintegerStack value for stacking rules (higher allows stacking on lower).
stackCodestringCode for stacking compatibility.
maxSupportingWeightintegerMax weight that can be placed on top.
floorStackTypestringFloor stacking rule: "Best Fit", "Bottom Only", "No Bottom".
floorStackSupportsOthersbooleanIf true, this cargo supports others on top in floor stacking.
overhangAllowedbooleanIf true, overhang allowed.
overhangLengthintegerMax overhang length.
overhangWidthintegerMax overhang width.
isOptionalbooleanIf true, cargo is optional for filling space in balancing.
bulgeSizeobjectBulge dimensions (length, width, height) for expansion/compression.
emptyContainersFavoritearrayPreferred containers for this cargo.
faceOpenstringOpen 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

ParameterTypeDescription
containerTypestringType of container: "SeaVan", "Truck", "Pallet", "Carton", "ULD". Required.
namestringIdentifier, e.g., "53FT-Intermodal".
lengthintegerLength in UOM units.
widthintegerWidth.
heightintegerHeight.
maxWeightintegerMaximum weight capacity in kg (e.g., 63000).

Drop Deck

ParameterTypeDescription
vehicleDropDeckRearSizenull/objectRear drop deck size for trucks: {length, width, height}.
vehicleDropDeckFrontSizenull/objectFront drop deck size: {length, width, height}.

Extended

ParameterTypeDescription
descriptionstringOptional description (often empty).
qtyintegerNumber of containers (often 0 for a single definition).
priorityintegerPriority for container selection (e.g., 0).
emptyWeightintegerWeight of the empty container in kg (e.g., 0).
maxLengthintegerMaximum cargo length (0 if unrestricted).
maxWidthintegerMaximum cargo width (0 if unrestricted).
maxHeightintegerMaximum cargo height (e.g., 111).
maxVolPercentintegerMaximum volume utilization percentage (0 if unrestricted).
maxCargoTypesintegerMaximum number of cargo types (0 if unrestricted).
priceintegerContainer cost (e.g., 0).
maxPriceintegerMaximum allowable cost (e.g., 0).

Advanced

ParameterTypeDescription
vehicleTypestringVehicle category (e.g., "Dry"). Matches VehicleTypeEnum (e.g., Dry, Refrigerated).
palletTypestringPallet type (e.g., "Wood2WaysDoube"). Matches PalletTypeEnum.
cartonTypestringCarton type (e.g., "Tuck"). Matches CartonTypeEnum.
palletThicknessintegerPallet thickness in cm (e.g., 0).
colorintegerNumeric color code for visualization (e.g., 65535).
colorHexaCodestringHex color code (empty if not specified).
colorKnownNamestringHuman-readable color name (empty if not specified).
palletOverhangbooleanWhether pallet overhang is allowed (e.g., false).
palletOverhangLengthintegerOverhang length in cm (e.g., 0).
palletOverhangWidthintegerOverhang width in cm (e.g., 0).
palletUnderhangbooleanWhether pallet underhang is allowed (e.g., false).
palletUnderhangLengthintegerUnderhang length in cm (e.g., 0).
palletUnderhangWidthintegerUnderhang width in cm (e.g., 0).
zonesnull/arrayZoning 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

ParameterTypeDescription
calculationTypestringType of load: "MixLoad" (mix SKUs into containers), "UnitLoad" (build pallets), "SetLoad" (proportional sets), "MultipleSetLoad". Required. Enum: [MixLoad, UnitLoad, SetLoad, MultipleSetLoad, others].
algorithmTypestringOptimization method: "Optimization" (best results, slower), "MaxVolumeFirst" (faster, approximate). Enum: [Optimization, MaxVolumeFirst, others].
fillDirectionstringDirection to fill: "BottomToTop", "FrontToRear", etc. Enum: [BottomToTop, FrontToRear].
optimizationLevelintegerLevel of optimization effort: 1 (fast) to 4 (thorough).
isWeightLimitedbooleanEnforce container weight limits.
isPriceLimitedbooleanEnforce price limits if used.
isSpreadIdenticalCargoAllowedbooleanAllow splitting same SKU across containers.
isEmptySpaceMergedbooleanMerge empty spaces in visualization.
isSequenceUsedbooleanUse sequence for loading order.
isUnitloadFirstbooleanBuild unitloads before vehicle loading.
isUnitloadsPartialAllowedWhenUnitloadsFirstbooleanIf true, allows partial unitloads when unitload first.
isUnitloadFilledWithDifferentCargoesbooleanIf true, allows different cargoes on unitload. Read-only.
bestFitContainersSelectionTypestringBest fit selection type. Enum: Array [5].
bestFitContainersSelectionMaxVolUtilThresholdnumberMax volume util threshold for best fit.
bestFitContainersSelectionMaxWeightUtilThresholdnumberMax weight util threshold for best fit.

Stacking

ParameterTypeDescription
isSafeStackingUsedbooleanIf true, enforces safe stacking rules like support rate.
minSupportRatenumberMinimum support rate for safe stacking (e.g., 0.8 for 80%).
maxDepthToSupportForSafeStackingnumberMax depth to consider for support in safe stacking.
minWeightDifferencePercentageForStackingTwoCargoesnumberMin weight difference % for stacking two different cargoes.
stackingRulestringStacking rule enum. Enum: Array [16] values (e.g., StackValue, StackCode).
groupsStackingRulestringStacking rule for groups. Enum: Array [2].
stackingMatrixarrayMatrix for custom stacking rules between cargoes.
maxStackingHeightobject{isUsed: boolean, algorithm: "ProportionalToGroundPlacementWidth", proportionalRateToSetMaxStackingHeight: 1.5} - Controls max stack height dynamically.

Grouping

ParameterTypeDescription
isGroupUsedbooleanIf true, respects groupName for keeping items together.
isGroupSequenceUsedbooleanIf true, uses sequence within groups.
isSameGroupAllowedInDifferentContainersbooleanIf true, allows splitting groups across containers.
isGroupsToPrefContainersbooleanIf true, assigns groups to preferred containers.
isSameAlias1TogetherInSameGroupbooleanIf true, keeps same alias1 in same group.
isSameAlias2TogetherInSameAlias1AndGroupbooleanIf true, keeps same alias2 within alias1 and group.
isDifferentGroupAllowedOnMultiSetLoadbooleanIf true, allows different groups in multi-set loads.
isSameGroupDividedToDifferentContainersWhenNotKeptTogetherbooleanIf true, divides groups when not kept together.

Advanced

ParameterTypeDescription
isCargoSizeConsolidatedbooleanConsolidate identical sizes.
isTunedbooleanIf true, uses tuned parameters for optimization.
maxSearchVolPerncentagenumberMax search volume percentage for tuning.
maxSearchDepthintegerMax search depth for algorithm.
maxRunTimeSecondsintegerMax runtime in seconds for calculation.
isMultiContainerTypesEnabledbooleanIf true, uses multiple container types.
maxFillQtyPerContainerintegerMax fill quantity per container.
isCargoCostComputedFromShipCostbooleanIf true, computes cargo cost from shipping cost. Read-only.
isIdenticalCargoStayInOneContainerWhenNotSpreadbooleanIf true, keeps identical cargo in one container when not spread. Read-only.
isSideSpaceOfCargoFilledWithSameCargobooleanIf true, fills side spaces with same cargo. Read-only.
isCargoSequenceUsedInOppositeOrderbooleanIf true, uses sequence in opposite order. Read-only.
isBottomOrientationRespectedbooleanIf true, respects bottom orientation. Read-only.
isEasyLoadUsedbooleanIf true, uses easy load mode. Read-only.
maxCargoTypesPerContainerintegerMax cargo types per container. Read-only.
maxPlacementSizenumberMax placement size. Read-only.
isCustomRuleUsedForSolutionsNamesbooleanIf true, uses custom naming for solutions. Read-only.
prefixOfSolutionsNamesstringPrefix for solution names. Nullable, read-only.
suffixOfSolutionsNamesstringSuffix for solution names. Nullable, read-only.
sequenceStartingNumberOfSolutionsNamesnumberStarting number for sequence in names. Nullable, read-only.
sequenceLengthOfSolutionsNamesnumberLength of sequence in names. Nullable, read-only.

Palletizing

ParameterTypeDescription
isPalletizedbooleanIf true, palletizes cargo.
palletizingobjectPalletizing rules for multiple cargoes {...}.
palletizing.isUsedbooleanIf true, palletizes cargo.
palletizing.isDifferentGroupsAllowedInSamePalletbooleanIf true, allows different groups on a pallet.
palletizing.minHeightOfPalletsnumberThe height the pallets need to be taller than.
palletizing.palletizingAlgorithmstringAlgorithm to use for building pallets - "UnitloadsDevelopedInAdvance", "UnitloadsDevelopedDinamically".
MixPalletobjectEmpty container for mixed pallets {...}.

Balancing

ParameterTypeDescription
isBalanceAppliedToAllSolutionsbooleanIf true, applies balance to all solutions.
isBalanceAppliedToLastSolutionbooleanIf true, applies balance only to last solution.
isBalanceReplacedWithSmallerSizesbooleanIf true, replaces with smaller sizes for balance.
isBalancePoorUtlizationUnloadedbooleanIf true, unloads poor utilization for balance.
maxUtilizationForBalanceUnloadnumberMax utilization threshold for unload in balance.
isBalanceSpreadLoadBottombooleanIf true, spreads load at bottom for balance.
isBalanceAlignLoadCenterbooleanIf true, aligns load to center for balance.
isBalanceFillWithOptionalCargoesbooleanIf true, fills with optional cargoes for balance.
optionalCargoesFillingActionstringAction for optional cargoes. Enum: Array [3].
isBalanceFillWithAdditionalAmountofExstingCargoesbooleanIf true, fills with additional existing cargoes for balance.
balanceConfigurationobject{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

ParameterTypeDescription
statusstring"succeed" or "failed". Indicates if the calculation was successful.
messagestringAdditional message, e.g., "OK".
calculationErrornull/objectIf failed, details of the error (e.g., validation issues). Null on success.

Load Summary

ParameterTypeDescription
loadSummaryobjectAggregate totals for the entire job across all containers.
loadSummary.cargoesLoadedintegerTotal cargo units loaded across all containers.
loadSummary.piecesLoadedintegerTotal pieces loaded.
loadSummary.cargoesLeftintegerCargo units not loaded.
loadSummary.piecesLeftintegerPieces not loaded.
loadSummary.unitloadsLoadedintegerTotal unitloads loaded.
loadSummary.weightAddednumberTotal weight added across all containers.
loadSummary.volumeUtilizationnumberAverage volume utilization %.
loadSummary.weightUtilizationnumberAverage weight utilization %.

Filled Containers

ParameterTypeDescription
filledContainersarrayThe core results: array of FilledContainer objects, each representing one loaded truck, sea container, or pallet.

Document

ParameterTypeDescription
documentobjectMetadata about the saved load (if loadSaved=true).
document.titlestringThe load title.
document.isSharedbooleanIf the load is shared company-wide.
document.isAutoSavedbooleanIf auto-saved.
document.calculationTimeInSecondsintegerTime taken for calculation.
document.processIdstringProcess ID for async tracking.
document.createdBystringUser email who created it.
document.createdAtstringCreation timestamp (ISO).
document.updatedAtstringUpdate timestamp (ISO).
document.containerTypestringType of containers used.
document.calculationTypestringThe 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

ParameterTypeDescription
namestringIdentifier for the filled container, often including group or date information (e.g., "002(2025-02-05)"). Corresponds to solution names in the results list.
sequenceintegerOrder or priority of the container in the load results (e.g., 2).
actualSizeobjectPhysical dimensions of the container {length, width, height} in UOM units.
loadSizeobjectDimensions of the loaded cargo footprint {length, width, height}.
emptyContainerobjectThe original empty container details used for this filled container.
uomstringUnit of measure used for dimensions and weights (e.g., "UnitMetric").

Load Summary

ParameterTypeDescription
loadSummaryobjectOverall metrics summarizing the load efficiency and contents. This corresponds to the summary at the top of the Results section in the user interface.
loadSummary.cargoesLoadedintegerTotal number of cargo units loaded into this container.
loadSummary.piecesLoadedintegerTotal number of individual pieces loaded (qty * pieceInside across all cargoes).
loadSummary.unitloadsLoadedintegerNumber of unitloads (pallets) loaded.
loadSummary.volumeLoadednumberTotal volume occupied by loaded cargo in cubic units.
loadSummary.volumeUtilizationnumberPercentage of container volume utilized (e.g., 81.44).
loadSummary.floorUtilizationnumberPercentage of floor space utilized (e.g., 84.11).
loadSummary.weightLoadednumberTotal weight of loaded cargo.
loadSummary.weightUtilizationnumberPercentage of max weight utilized.
loadSummary.dimWeightnumberDimensional weight calculation for shipping rates.
loadSummary.dimWeightFactornumberFactor used for dim weight (e.g., 194 for air freight).
loadSummary.priceLoadednumberTotal price of loaded cargo.
loadSummary.priceUtilizationnumberPercentage of max price utilized.
loadSummary.cargoesPerLayerintegerAverage number of cargoes per layer.
loadSummary.layersLoadedintegerTotal number of layers stacked.

Graphics

ParameterTypeDescription
graphicsobjectVisual representations of the load, corresponding to the graphics engine output in the user interface (e.g., 3D and 2D views in Results).
graphics.imagesobjectURLs to various diagram views.
graphics.images.path3DDiagramstringURL to 3D diagram of the load.
graphics.images.path2DTopstringURL to 2D top view.
graphics.images.path2DSidestringURL to 2D side view.
graphics.images.path2DFrontstringURL to 2D front view.

Spaces

ParameterTypeDescription
spacesarrayArray 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[].sequenceintegerOrder of the space in the loading sequence.
spaces[].isEmptybooleanIf true, this space is unused/empty.
spaces[].cargoesLoadedintegerNumber of cargo units in this space.
spaces[].piecesLoadedintegerNumber of individual pieces in this space.
spaces[].cargoobjectThe Cargo object details for items in this space.
spaces[].arrangementobjectLayout counts {length: int, width: int, height: int} - how many along each dimension.
spaces[].posobjectPosition coordinates {length, width, height} of the space start.
spaces[].sizeobjectDimensions of the space {length, width, height}.
spaces[].graphicsobjectThumbnail images for this space, if thumbnailsCreated=true.
spaces[].graphics.images.pathThumbnailstringURL to thumbnail of the space.

Placements (Sub of Spaces)

ParameterTypeDescription
spaces[].placementsarrayDetailed individual cargo placements within the space, included if placementsCreated=true. This provides precise positioning for each item.
spaces[].placements[].sequenceintegerOrder of this placement.
spaces[].placements[].fillDirectionstringOrientation used (e.g., "Orientation1").
spaces[].placements[].posobjectPosition {length, width, height} of this placement.
spaces[].placements[].sizeobjectSize {length, width, height} of this placement.

Manifest

ParameterTypeDescription
manifestarraySummary per cargo type loaded, similar to the Cargoes section in the Report View, showing loaded quantities and utilizations.
manifest[].sequenceintegerOrder of this cargo in the manifest.
manifest[].cargoobjectThe Cargo object details.
manifest[].cargoesLoadedintegerNumber of this cargo loaded.
manifest[].piecesLoadedintegerNumber of pieces of this cargo.
manifest[].unitloadsLoadedintegerNumber of unitloads for this cargo.
manifest[].volumeUtilizationnumberVolume % for this cargo.
manifest[].weightUtilizationnumberWeight % for this cargo.
manifest[].priceUtilizationnumberPrice % for this cargo.

Advanced

ParameterTypeDescription
cogobjectCenter of gravity {length, width, height}, used for balance checks.
cargoGroupsnull/arrayGrouped cargoes if grouping rules were applied.
reportLinksobjectLinks to detailed reports, corresponding to the Report View in the user interface.
reportLinks.overviewstringURL 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> request = new HttpEntity<>(data, headers);

ResponseEntity response = restTemplate.postForEntity(url, request, String.class);
System.out.println(response.getBody());
            

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

POST /loads

Builds a new load and saves it to the loads database. Overwrites a load with the same title.

Query Parameters

NameTypeDescriptionDefaultRequired
multiProcessedbooleanSet true for asynchronous processing with webhook result delivery. False for immediate results.falsefalse
cargoDetailLoadedFromDatabasebooleanIf true, cargo details are loaded from the database by name.falsefalse
containerDetailLoadedFromDatabasebooleanIf true, container details are loaded from the database by name.falsefalse
loadSavedbooleanIf true, the load is saved to the database.truefalse
loadSharedbooleanIf true, the load is shared company-wide.truefalse
userIdstringEmail of the user under whom the load is saved.API credential emailfalse
webhookListenerURLToNewLoadstringWebhook URL for asynchronous load results.nonefalse
graphicsCreatedbooleanIf true, generates container graphics.falsefalse
graphicsImageWidthintegerWidth of graphics in pixels.200false
graphicsImageDepthintegerDepth of graphics in pixels.200false
graphicsShowScalebooleanIf true, includes measurements in graphics.falsefalse
graphicsBackgroundColorRGBintegerRGB color for graphics background.0false
thumbnailsCreatedbooleanIf true, generates space thumbnails.falsefalse
thumbnailsImageWidthintegerWidth of thumbnails in pixels.200false
thumbnailsImageDepthintegerDepth of thumbnails in pixels.200false
thumbnailsCreatedInBlackWhitebooleanIf true, thumbnails are in black and white.falsefalse
spacesCreatedbooleanIf true, includes space details in response.falsefalse
placementsCreatedbooleanIf true, includes placement details in spaces.falsefalse
UOMstringUnit of measure: "UnitEnglish", "UnitMetric", "UnitHighMetric".UnitEnglishfalse
reportLanguagestringLanguage for reports: "ENG", "GER", "SPN", "FRN", "BRZ", "CHN", "JPN", "KOR".ENGfalse
reportToolbarShownbooleanIf true, shows report toolbar.falsefalse

Request Body: Load object (see Load Schema).

Response: Response object (see Response Schema).

Endpoints: Database/Master Data

GET /Database/Cargoes/{name}

Retrieves a cargo by name from the cargoes database.

Query Parameters

NameTypeDescriptionDefaultRequired
UOMstringUnit of measure.UnitEnglishfalse

Response: Cargo object.

DELETE /Database/Cargoes/{name}

Deletes a cargo by name from the cargoes database.

Query Parameters

NameTypeDescriptionDefaultRequired
None----
GET /Database/Cargoes

Retrieves all cargoes from the cargoes database.

Query Parameters

NameTypeDescriptionDefaultRequired
limitintegerLimits the number of cargoes returned.10false
createdAtstringFilter by creation date.nonefalse
sharedbooleanIf true, returns only shared cargoes.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
POST /Database/Cargoes/Multiple

Inserts multiple cargoes into the cargoes database.

Query Parameters

NameTypeDescriptionDefaultRequired
UOMstringUnit of measure.UnitEnglishfalse

Request Body: {cargoes: array of Cargo objects}.

PUT /Database/Cargoes/{keyIs}

Updates a cargo (partial updates supported).

Query Parameters

NameTypeDescriptionDefaultRequired
UOMstringUnit of measure.UnitEnglishfalse

Request Body: Partial Cargo object.

GET /Database/Containers/{type}

Retrieves all containers of a specific type (e.g., Truck, Pallet).

Query Parameters

NameTypeDescriptionDefaultRequired
limitintegerLimits the number returned.10false
createdAtstringFilter by creation date.nonefalse
sharedbooleanIf true, returns only shared.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
POST /Database/Containers/{type}

Inserts a container into the containers database.

Query Parameters

NameTypeDescriptionDefaultRequired
UOMstringUnit of measure.UnitEnglishfalse

Request Body: EmptyContainer object.

GET /Database/Containers/{type}/{name}

Retrieves a container by type and name.

Query Parameters

NameTypeDescriptionDefaultRequired
UOMstringUnit of measure.UnitEnglishfalse
DELETE /Database/Containers/{type}/{name}

Deletes a container by type and name.

Query Parameters

NameTypeDescriptionDefaultRequired
None----

Endpoints: Archive API

GET /Loads

Retrieves all saved loads from the database.

Query Parameters

NameTypeDescriptionDefaultRequired
limitintegerLimits the number of loads returned.10false
createdAtstringFilter by creation date.nonefalse
sharedbooleanIf true, returns only shared loads.falsefalse
graphicsCreatedbooleanIf true, includes graphics.falsefalse
graphicsImageWidthintegerWidth of graphics in pixels.200false
graphicsImageDepthintegerDepth of graphics in pixels.200false
graphicsShowScalebooleanIf true, includes measurements in graphics.falsefalse
graphicsBackgroundColorRGBintegerRGB color for graphics background.0false
thumbnailsCreatedbooleanIf true, generates space thumbnails.falsefalse
thumbnailsImageWidthintegerWidth of thumbnails in pixels.200false
thumbnailsImageDepthintegerDepth of thumbnails in pixels.200false
thumbnailsCreatedInBlackWhitebooleanIf true, thumbnails are in black and white.falsefalse
spacesCreatedbooleanIf true, includes space details.falsefalse
placementsCreatedbooleanIf true, includes placement details.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
GET /Loads/{userId}/{title}

Retrieves a specific load by user ID and title.

Query Parameters

NameTypeDescriptionDefaultRequired
graphicsCreatedbooleanIf true, includes graphics.falsefalse
graphicsImageWidthintegerWidth of graphics.200false
graphicsImageDepthintegerDepth of graphics.200false
graphicsShowScalebooleanInclude measurements in graphics.falsefalse
graphicsBackgroundColorRGBintegerBackground color.0false
thumbnailsCreatedbooleanGenerate space thumbnails.falsefalse
thumbnailsImageWidthintegerThumbnail width.200false
thumbnailsImageDepthintegerThumbnail depth.200false
thumbnailsCreatedInBlackWhitebooleanBlack and white thumbnails.falsefalse
spacesCreatedbooleanInclude space details.falsefalse
placementsCreatedbooleanInclude placement details.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
DELETE /Loads/{userId}/{title}

Deletes a load by user ID and title.

Query Parameters

NameTypeDescriptionDefaultRequired
None----
GET /Loads/{userId}/{title}/{filledContainerSeq}

Retrieves a specific filled container from a load.

Query Parameters

NameTypeDescriptionDefaultRequired
graphicsCreatedbooleanIf true, includes graphics.falsefalse
graphicsImageWidthintegerWidth of graphics.200false
graphicsImageDepthintegerDepth of graphics.200false
graphicsShowScalebooleanInclude measurements.falsefalse
graphicsBackgroundColorRGBintegerBackground color.0false
thumbnailsCreatedbooleanGenerate thumbnails.falsefalse
thumbnailsImageWidthintegerThumbnail width.200false
thumbnailsImageDepthintegerThumbnail depth.200false
thumbnailsCreatedInBlackWhitebooleanBlack and white.falsefalse
spacesCreatedbooleanInclude space details.falsefalse
placementsCreatedbooleanInclude placement details.falsefalse
UOMstringUnit of measure.UnitEnglishfalse

Endpoints: Edit & Upload API

POST /Edit/Load/{userId}

Builds a load from editing data and saves it.

Query Parameters

NameTypeDescriptionDefaultRequired
multiProcessedbooleanAsynchronous processing.falsefalse
webhookListenerURLToNewLoadstringWebhook for async.nonefalse
loadSavedbooleanSave the load.truefalse
loadSharedbooleanShare the load.truefalse
graphicsCreatedbooleanGenerate graphics.falsefalse
graphicsImageWidthintegerGraphics width.200false
graphicsImageDepthintegerGraphics depth.200false
graphicsShowScalebooleanShow scale in graphics.falsefalse
graphicsBackgroundColorRGBintegerBackground color.0false
thumbnailsCreatedbooleanGenerate thumbnails.falsefalse
thumbnailsImageWidthintegerThumbnail width.200false
thumbnailsImageDepthintegerThumbnail depth.200false
thumbnailsCreatedInBlackWhitebooleanBlack and white thumbnails.falsefalse
spacesCreatedbooleanInclude spaces.falsefalse
placementsCreatedbooleanInclude placements.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
reportLanguagestringReport language.ENGfalse
reportToolbarShownbooleanShow toolbar.falsefalse
GET /Edit/{userId}

Retrieves editing data for a user.

Query Parameters

NameTypeDescriptionDefaultRequired
None----
DELETE /Edit/{userId}

Deletes editing data for a user.

Query Parameters

NameTypeDescriptionDefaultRequired
None----
GET /Edit/Load/{userId}/{filledContainerSeq}

Retrieves a filled container from editing data.

Query Parameters

NameTypeDescriptionDefaultRequired
graphicsCreatedbooleanInclude graphics.falsefalse
graphicsImageWidthintegerGraphics width.200false
graphicsImageDepthintegerGraphics depth.200false
graphicsShowScalebooleanShow scale.falsefalse
graphicsBackgroundColorRGBintegerBackground color.0false
thumbnailsCreatedbooleanGenerate thumbnails.falsefalse
thumbnailsImageWidthintegerThumbnail width.200false
thumbnailsImageDepthintegerThumbnail depth.200false
thumbnailsCreatedInBlackWhitebooleanBlack and white.falsefalse
spacesCreatedbooleanInclude spaces.falsefalse
placementsCreatedbooleanInclude placements.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
POST /Upload/Excel

Uploads an Excel file to build mass loads.

Query Parameters

NameTypeDescriptionDefaultRequired
multiProcessedbooleanAsynchronous processing.falsefalse
webhookListenerURLToNewLoadstringWebhook URL.nonefalse
loadSavedbooleanSave the load.truefalse
loadSharedbooleanShare the load.truefalse
userIdstringUser email.API emailfalse
graphicsCreatedbooleanGenerate graphics.falsefalse
graphicsImageWidthintegerGraphics width.200false
graphicsImageDepthintegerGraphics depth.200false
graphicsShowScalebooleanShow scale.falsefalse
graphicsBackgroundColorRGBintegerBackground color.0false
thumbnailsCreatedbooleanGenerate thumbnails.falsefalse
thumbnailsImageWidthintegerThumbnail width.200false
thumbnailsImageDepthintegerThumbnail depth.200false
thumbnailsCreatedInBlackWhitebooleanBlack and white.falsefalse
spacesCreatedbooleanInclude spaces.falsefalse
placementsCreatedbooleanInclude placements.falsefalse
UOMstringUnit of measure.UnitEnglishfalse
reportLanguagestringReport language.ENGfalse
reportToolbarShownbooleanShow toolbar.falsefalse

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.

  1. Prepare the Request: Define cargo and container details.
  2. 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"
        }
    }
  3. Send the Request: POST /loads with TokenID header.
  4. Check the Response: Verify status "succeed" and filledContainers.

Tutorial 2: Using Database Cargo and Containers

Steps to build a load using pre-saved database entries.

  1. Add Cargo to Database: POST /Database/Cargoes/Multiple.
  2. Add Container to Database: POST /Database/Containers/Truck.
  3. Create Load from Database: POST /loads?cargoDetailLoadedFromDatabase=true&containerDetailLoadedFromDatabase=true with names only.
  4. Verify Response: Check load details.

Tutorial 3: Generating Graphics and Reviewing a Load

Steps to create a load with graphics and retrieve it.

  1. Create Load with Graphics: POST /loads?graphicsCreated=true&graphicsShowScale=true.
  2. Check Graphics in Response: Look for URLs in graphics.images.
  3. Retrieve the Load: GET /Loads/{userId}/{title}.
  4. Review Specific Container: GET /Loads/{userId}/{title}/{seq}.

Tutorial 4: Asynchronous Load Processing

Steps to process a large load asynchronously.

  1. Set Up Webhook: Create a server endpoint to receive POST results.
  2. Send Asynchronous Request: POST /loads?multiProcessed=true&webhookListenerURLToNewLoad=your-url.
  3. Receive Webhook Response: Handle the POST with the Response object.

Tutorial 5: Updating Cargo in Database

Steps to update an existing cargo.

  1. Retrieve Cargo: GET /Database/Cargoes/{name}.
  2. Update: PUT /Database/Cargoes/{name} with partial body, e.g., {"weight": 25}.
  3. Verify: GET again to check changes.

Tutorial 6: Deleting a Load

Steps to delete a saved load.

  1. List Loads: GET /Loads to find the title.
  2. Delete: DELETE /Loads/{userId}/{title}.
  3. Confirm: GET /Loads to see it's gone.

Tutorial 7: Using UnitLoad Calculation

Steps to build pallets.

  1. Prepare: Set rules.calculationType = "UnitLoad".
  2. Send: POST /loads with cargoes and pallet as emptyContainer.
  3. Response: FilledContainers as loaded pallets.

Tutorial 8: Handling Errors

Steps to debug a failed calculation.

  1. Send Invalid Request: e.g., missing required fields.
  2. Check Response: Look for status "failed" and calculationError details.
  3. Fix and Retry: Adjust based on error message.

Tutorial 9: Uploading Excel for Mass Loads

Steps to upload Excel.

  1. Prepare Excel: Format with cargoes and containers as per template.
  2. Upload: POST /Upload/Excel with multipart file.
  3. Response: Processed loads.

Tutorial 10: Retrieving Specific Container with Placements

Steps to get detailed placements.

  1. Create Load: POST /loads?placementsCreated=true.
  2. Retrieve Container: GET /Loads/{userId}/{title}/{seq}?placementsCreated=true.
  3. Analyze: Use spaces.placements for positions.

Tutorial 11: SetLoad for Proportional Loading

Steps to load items in set ratios.

  1. Set Ratios: Use setRatio in cargoes, e.g., 1 for A, 2 for B.
  2. Rules: calculationType = "SetLoad".
  3. Send: POST /loads.
  4. Response: Loads maintaining ratios.

Tutorial 12: Balancing Weight Distribution

Steps to balance load.

  1. Rules: balanceConfiguration = {isUsed: true, maxWeightDifference: 100}.
  2. Send: POST /loads.
  3. Check: Response cog for balance.

Tutorial 13: Using Custom Stacking Matrix

Steps to define stacking compatibility.

  1. Rules: stackingMatrix = array of rules between cargoes.
  2. Send: POST /loads.
  3. Response: Stacking respects matrix.

Tutorial 14: Multi-Container Types

Steps to use different containers.

  1. Rules: isMultiContainerTypesEnabled = true.
  2. EmptyContainers: Array with different types.
  3. Send: POST /loads.
  4. Response: Filled with optimal types.

Tutorial 15: Custom Solution Names

Steps to name solutions.

  1. Rules: isCustomRuleUsedForSolutionsNames = true, prefixOfSolutionsNames = "Load-".
  2. Send: POST /loads.
  3. Response: filledContainers names like "Load-001".