Transport cost calculation logic
Transport costs represent the expenses incurred when goods are shipped between facilities or from a facility to the end consumer. These costs typically depend on the shipping service provider, the parcel or packaging type used, the destination country, and, depending on the chosen logic, additional factors such as weight or volume.
Packing logic and shipping cost calculation
fulfillmenttools applies bin-packing logic to determine how ordered items are distributed across available packaging units and calculates shipping costs accordingly.
Two effort levels are available:
The logic applied to a given transfer within a sourcing path is determined by how the packagingUnitByContexts object is configured in the respective facility connection.
If a packaging unit is referenced within a facility connection, the packagingUnitsByContexts property may only define the corresponding transit times. All other information is inherited from the referenced packagingUnit and must not be redefined at the facility connection level.
For details on how a fulfillment network is defined by facility connections and how they are structured, see the Facility connection article.
Determining which logic applies
The active logic for a given transfer is determined only by how packagingUnitByContexts is configured in the corresponding facility connection:
Packaging unit data is defined inline in packagingUnitByContexts in the facility connection.
Standard
The facility connection packagingUnitByContexts references an external packagingUnit
Advanced
Mixed logic within a sourcing route
The standard and advanced logics aren't mutually exclusive. Within a single sourcing route, different transfers can each apply a different logic, depending on how the respective facility connection is configured.

Standard logic
The use of the standard logic is well‑suited for scenarios in which the carrier portfolio within the network is relatively homogeneous, and the pricing structure is simple, with only marginal differences between carriers.
The standard packing logic applies when packaging unit information is defined directly within the facility connection object in packagingUnitByContexts. No reference to an external collection is required.
A first-fit decreasing algorithm is applied to assign items to packaging units. This approach offers sufficient accuracy across a wide range of use cases and improves calculation speed.
First-fit decreasing algorithm
Check whether the largest item fits within the highest priority packaging unit (usually the smallest and cheapest to ship), based on the item's dimensions and the package's dimensions.
If it does not fit, the next packaging unit is tried (in order of priority). If it fits, check for the next item to fit in this package, and so on.
Do this for every item. If a packaging unit is full (considering its dimensions and restrictions), check for a second package, starting again with the package of highest priority.
A packaging unit is full when the sum of the item volumes exceeds the inner parcel volume. However, an empty space (
volumeBufferInPercent) might be deducted to ensure that the items really fit. Note: Geometries aren't considered, and no "Tetris" is played. So, it's important to leave some empty space.A parcel is also full if the maximum item amount is reached. This feature ensures that only one item is placed in a single package.
Shipping costs are calculated using a standardized formula applied uniformly across all transfers using the standard logic.
Advanced logic
The advanced logic is particularly suitable in scenarios where the carrier portfolio is broad and includes multiple shipping methods (for example, parcel, pallet, bulky goods, and two‑person handling).
In such environments, an optimized packing strategy combined with price‑optimized routing can significantly reduce fulfillment costs. This approach is especially beneficial when at least one of the following conditions applies:
The network uses different parcel types
Items vary significantly in size or dimensional characteristics
The cost structure requires precise optimization across heterogeneous carriers
It should also be noted that the advanced logic is computationally more expensive and may not be ideal for very large networks where performance constraints are critical.
The advanced packing logic applies when packagingUnitByContexts within the facility connection references packaging units defined in a separate collection, rather than containing the packaging unit information inline.
Advanced algorithm
Finds the cheapest combination of packaging units: fulfillmenttools evaluates all feasible ways to group the ordered items into packaging units and selects the option with the lowest total cost.
Considers all available shipping options: From standard parcels to freight and pallet shipments, fulfillmenttools automatically picks the best packaging unit type for each part of your order.
Respects physical constraints: Item dimensions, weight limits, and carrier requirements are all factored in to ensure your shipment is valid and deliverable.
Guaranteed lowest shipping cost: The result will always be the optimized packaging solution, not just a "good enough" estimate.
In contrast to the first-fit decreasing approach, the advanced logic evaluates all possible distribution combinations within the solution space. The goal is cost optimization: the algorithm identifies the distribution of items across available facilities and their respective packaging units that results in the lowest overall shipping cost.
Packaging units defined in the separate collection also support a significantly broader set of configurable properties, including:
Girth measurement
Volumetric weight
Detailed price tables dependent on weight and destination region
Packaging unit type-specific definitions and calculation logics
The following section describes the logic applied to each packagingUnit type. It outlines the available configuration options, including the attributes and restrictions that can be defined for each type.
Also, it explains the factors used for price calculation, which are provided through the packagingPricingDetails associated with each packaging unit. Different shipping methods need different pricing calculation logics. These logics are defined per packagingUnit type and must be maintained accordingly.
All items are, by default, eligible for all packaging types unless this is explicitly restricted through packagingUnitsByContexts.context[] in the facility connection.
All the following examples are using advanced logic. So, using the packaging units endpoint.
Parcel
Definitions and restrictions
The parcel packagingUnit type can be used for standard parcel shipment, fully enclosed in a box. Three-dimensional constraints apply because carriers calculate costs and enforce size limits based on weight, height, length, and width.
The maximum permissible dimensions are defined through the mandatory fields maxWeight, maxHeightInMillimeters, maxWidthInMillimeters, and maxLengthInMillimeters. These values establish the physical limits for routing and packing decisions. If an article or article combination exceeds any of these dimensions, fulfillmenttools doesn't assign it to this packaging unit.
The optional volumeBufferInPercent allows configuring additional free space within the parcel to account for packaging materials or irregular article geometries.
The optional maxItemQuantity specifies the maximum number of items that may be placed in a single parcel. This configuration can be used for operational requirements such as handling hazardous goods or specialized packaging scenarios, including bottle shipments or flower logistics.
Pricing structure and calculation logic
The shipping cost for a parcel unit is determined by the packagingPricingDetails configuration and is composed of up to three components.
The primary cost is derived from the pricing array, which defines weight-based price brackets. Each bracket specifies an upperThreshold in grams and the corresponding shipping price. The bracket whose upperThreshold is equal to or greater than the actual shipment weight applies. Two approaches are available for handling shipments that exceed all defined thresholds:
The highest configured
upperThresholdmatches the packaging unit'smaxWeightexactly, ensuring no shipment exceeds the defined brackets.An
overflowFactoris defined, which specifies the additional cost per gram above the highestupperThreshold.
This approach allows pricing to extend beyond the last bracket without requiring an exhaustive weight table.
Optionally, price brackets can be differentiated by destination region using the zone field within each pricing object. A zone is defined by the ISO 3166-2 country code, followed by a dash and the first digits of the destination postal code (for example, DE-50 for Cologne, Germany). This allows different prices to apply based on the delivery location. This is particularly relevant for freight and pallet shipments, where regional pricing is standard practice among carriers, but it also applies to parcel shipments.
In addition, one or more surcharges can be configured in surchargesPerPackagingUnits and added to the net shipping price. Two surcharge types are supported:
ABSOLUTE_SURCHARGE_TYPEadds a fixed monetary amount per unit. Typical examples include a fixed handling fee for manual processing or special workflow steps, or a fixed fuel surcharge per shipment where the carrier does not apply percentage-based rates.RELATIVE_SURCHARGE_TYPEadds a percentage of the net freight price. Typical examples include a percentage-based fuel surcharge or an environmental levy.
Example parcel cost calculation
Use the tabs below to click through the example scenario.
We'll set the following definitions:
Maximum dimension:
Maximum length: 120 cm
Maximum width: 60 cm
Maximum height: 60 cm
Maximum weight: 31.5 kg
Volume buffer: 5% (for packaging material)
Pricing tiers
Up to 2 kg: €3.00
Up to 5 kg: €4.00
Up to 10 kg: €7.00
Up to 31.5 kg: €11.00
Environmental surcharge per unit: €1.50
1 x item 1
10 cm x 10 cm x 20 cm
Weight per unit: 1.5 kg
1x item 2
20 cm x 40 cm x 80 cm
Weight per unit: 6.1 kg
2 items need to be packed
Items add up to a total weight of 7.6 kg (1.5 kg (item 1) + 6.1 kg (item 2)
7.6 kg has the corresponding pricing tier of up to 10 kg
The up to 10 kg pricing tier is €7.00
Add the mandatory environmental surcharge of €1.50
Total calculated costs: €7.00 + €1.50 = €8.50
Pallet
Definitions and restrictions
This packaging unit type can be used for pallet-based shipment for heavier or bulk freight. In addition to three-dimensional constraints, a volumetricWeightFactor is required because freight carriers charge based on whichever is greater — actual weight or volumetric (dimensional) weight. The factor converts physical volume into a comparable weight value for cost calculation.
fulfillmenttools calculates the volumetric weight by dividing the packaging units' volume by the carrier‑specific volumetricWeightFactor (very common: 5000 or 6000). Routing and cost calculation use this value whenever the volumetric weight exceeds the actual weight, ensuring that carrier constraints and billing rules are applied consistently.
Additionally, a pallet may optionally define maxItemQuantity and volumeBufferInPercent, which are evaluated in the same way as for the parcel configuration.
Pricing structure and calculation logic
The shipping cost for a pallet unit follows the same zone-matching, weight-bracket, and surcharge logic as parcel units, with one additional step. Before the applicable price bracket is determined, fulfillmenttools calculates the shipment's volumetric weight using the mandatory volumetricWeightFactor. The greater of the actual weight and the volumetric weight is then used to select the price bracket. This reflects standard freight carrier practice, in which oversized but lightweight shipments are billed based on their dimensional weight rather than their actual weight. Multi-currency pricing, the overflowFactor, and surchargesPerPackagingUnits apply in the same way as for parcel units.
Example pallet cost calculation
Use the tabs below to click through the example scenario.
We'll set the following definitions:
Maximum dimension:
Maximum length: 120 cm
Maximum width: 80 cm
Maximum height: 180 cm
Maximum weight: 2000 kg
Volume buffer: 5% (for packaging material)
Pricing tiers
Up to 100 kg: €30.00
Up to 200 kg: €40.00
Up to 300 kg: €48.00
...
Up to 2000 kg: €200.00
Environmental surcharge per unit: €1.50
10 x item 1:
100 cm x 15 cm x 5 cm
Weight per unit: 25 kg
40 x item 2
60 cm x 20 cm x 1 cm
Weight per unit: 1 kg
50 items need to be packed
The volumetric weight is lower than the real weight, so the real weight is used
Items add up to a total weight of 290 kg (250 kg (10 x item 1 (25 kg)) + 40 kg (40 x item 2 (1kg))
290 kg has the corresponding pricing tier of up to 300 kg
The up to 300 kg pricing tier is €48.00
Add the mandatory environmental surcharge of €1.50
Total calculated costs: €48.00 + €1.50 = €49.50
Bulky goods
Definitions and restrictions
This packaging unit type can be used for oversized or irregularly shaped items (for example, doors, bicycles, car tires, and so on) that can't be packed using a standard three‑dimensional box. Instead of height, length, and width, carriers for bulky goods typically apply girth‑based constraints, which express the combined circumference and longest dimension of a shipment.
For packaging units of this type, the maximum allowable girth (maxGirth) must be defined.
In addition, carriers also enforce restrictions on maximum length (maxLength) and maximum weight (maxWeight). Optionally, a maximum number of items (maxItemQuantity) can be specified to limit how many articles may be consolidated into a single bulky‑goods shipment.
Pricing structure and calculation logic
The shipping cost for a bulky goods unit is calculated using the same zone-matching, weight-bracket, and surcharge model as parcel units. Because bulky goods are defined by maxLength and maxGirth rather than three-dimensional box measurements, volumetric weight can't be derived, and no volumetricWeightFactor is applied.
Multi-currency pricing, the overflowFactor, and all configured surchargesPerPackagingUnits apply in the same way as for parcel units.
Example bulky good cost calculation
We'll set the following definitions:
Maximum dimension:
Maximum length: 200 cm
Maximum girth: 300 cm
Maximum weight: 31.5 kg
Pricing tiers
Up to 31.5 kg: €25.00
1 x item 1:
140 cm x 60 cm x 7 cm
Weight per unit: 19 kg
1 item needs to be packed
The
maxGirthis 300 cmThe girth of the item to pack is 274 cm (140 cm + 2(60 cm + 7 cm))
The item is within the
maxGirthThe price is fixed at €25.00
Total calculated costs: €25.00
Two-person handling
Definitions and restrictions
This packaging unit type is suitable for heavy or large items that require two-person delivery (for example, furniture). Three-dimensional constraints apply as with parcels. An additional optional maxVolume field is available for carriers that enforce a total cubic volume limit independent of individual dimensions. Also, a maxItemQuantity restriction can be applied here.
Pricing structure and calculation logic
Volume-based pricing tiers define the shipping cost for two-person handling. For the surcharge model, the optional overflowFactor and all configured surchargesPerPackagingUnits are evaluated analogously to the other packagingUnitTypes. The optional maxVolume constraint on the unit determines whether a given set of items is eligible for this packaging unit. Still, it doesn't effect the cost calculation itself.
Example two-person handling cost calculation
We'll set the following definitions:
Maximum dimension:
Maximum length: 400 cm
Maximum width: 230 cm
Maximum height: 200 cm
Maximum weight: 200 kg
Maximum volume: 4 CBM
Pricing tiers
Up to 0.2 CBM: €20.00
Up to 0.4 CBM: €30.00
Up to 0.6 CBM: €37.00
Up to 0.8 CBM: €43.00
Up to 1.0 CBM: €48.00
Every additional 0.1 CBM: €2.00
Environmental surcharge per unit: €1.50
Pre‑carriage costs per started CBM: €6.00
1 x item 1:
200 cm x 100 cm x 60 cm
Weight per unit: 68 kg
1 item needs to be packed
The
maxVolumeis 4 CBMThe volume of the item to pack is 1.2 CBM (200 cm x 100 cm x 60 cm = 1.2 CBM)
The item is within the
maxVolumeThe up to 1 CBM pricing tier is €48.00
Every extra 0.1 CBM is €2.00 (2 x €2.00 = €4.00)
Add the pre‑carriage costs per started CBM (2 x €6.00 = €12.00)
Add the mandatory environmental surcharge of €1.50
Total calculated costs: €48.00 + €4.00 + €12.00 + €1.50 = €65.50
This part of the API is in Beta status. For details please check the api-release-life-cycle documentation. Creates a single PackagingUnitDetail.
PackagingUnitDetailForCreation
LocaleStringConstrained
The reference to the carrier associated with the packagingUnit.
The tenant specific identifier for the packagingUnit.
Successfully created the PackagingUnitDetail.
No content
Your user is not allowed to operate against this API instance
Your user, although recognized, is not authorized to use this
The requested entity was not found
No content
Last updated

