Transsmart offers cost prediction based on the transport contracts a customer has with one or more carriers. As the number of connected carriers has grown, so have the different types of contracts they use. To efficiently calculate transport costs, we developed the tariff engine. This article explains how the engine works and how customers can configure and maintain their own rates.
Sections in this article:
Process description
The diagram below shows how the rate calculation process is structured.
Schematic overview of the Transsmart rate calculation process:
During this process, transport costs are calculated or predicted. It also allows you to compare predicted costs with actual costs. Because shipping charges and surcharges are shown separately, it is possible to analyze the full breakdown of the total rate.
Basic configuration
The following tables are involved in the rate calculation process:
| Previous table name (<2022) | Current table name |
| Client-carrier | Client Carriers |
| Zone Lookup | Zones |
| Weight Determination Lookup | Buy Weights |
| Sales Weight Determination Lookup | Sell Weights |
| Tariff Determination [DEV] | Buy Rates |
| Sales Tariff Determination [DEV] | Sell Rates |
| Sales Margins [DEV] | Sell Margins |
Only Buy Rates, Sell Rates, and Sell Margins can be configured by customers. All other tables can only be managed by an nShift employee.
The main focus is on the Buy Rates table. However, to support a comprehensive understanding of the system, all tables are briefly explained in the Other Tables section.
Buy Rates
The Buy Rates table is the foundation of the tariff engine. Unlike the previous setup, where only a single matching tariff line was used, the engine now evaluates all applicable lines and adds them together to determine the final rate. This allows rules defined at the collo, package or shipment level to all contribute to the calculation.
The following section explains the columns in the Buy Rates table, followed by examples.
| # | Element | Mandatory | Description |
| 1 | Identity | N | This field contains the unique database ID of the record. If you download existing records, it will be filled. If you wish to upload and overwrite existing records, this field needs to remain filled. If you wish to add new lines, make sure this field is empty. |
| 2 | customerId | N | In this column all values of the customer hierarchy can be used: customer_id, group_id and organisation_id |
| 3 | costcenter | N | If a cost center has different rates this can be set-up by filling this column |
| 4 | level | Y | Rates can be set on various levels: COLLO, PACKAGE and SHIPMENT. Based on this value the rates are calculated differently. See below for an explanation on the differences of each level |
| 5 | carrier | Y | The carrier needs to specified here |
| 6 | serviceLevelTime | N | The serviceleveltime can be specified here if different rates are applicable for different serviceleveltime values |
| 7 | serviceLevelOther | N | The servicelevelother can be specified here if different rates are applicable for different servicelevelother values |
| 8 | packageType | N | The package type can be specified here if different rates are applicable for different package types |
| 9 | carrierAccountno | N | The carrier account number can be specified here if different rates are applicable for different account number |
| 10 | inbound | N | It can be specified here if rates are for inbound shipments. Default this is set to ‘0’ meaning an outbound shipment |
| 11 | zone | N | The zone can be specified here if different rates are applicable for different zones |
| 12 | minTotalWeight | N | The minimum total weight in KG of the specified level (#3) is stated here. It can be specified until 3 digits after the decimal point |
| 13 | maxTotalWeight | N | The maximum total weight in KG of the specified level (#3) is stated here. It can be specified until 3 digits after the decimal point |
| 14 | minLength | N | The minimum length in CM of each collo is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 15 | maxLength | N | The maximum length in CM of each collo is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 16 | minWidth | N | The minimum width in CM of each collo is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the(decimal point |
| 17 | maxWidth | N | The maximum width in CM of each collo is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 18 | minHeight | N | The minimum height in CM of each collo is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 19 | maxHeight | N | The maximum height of each collo in CM is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 20 | minConveyDimension | N | The minimum dimension of the level (collo, package, shipment) in CM is specified here. This is calculated by adding up length + 2*width + 2*height. It can be specified until 3 digits after the decimal point |
| 21 | maxConveyDimension | N | The maximum dimension of the level (collo, package, shipment) in CM is specified here. This is calculated by adding up length + 2*width + 2*height. It can be specified until 3 digits after the decimal point |
| 22 | minLoadmeter | N | The minimum load meter of the shipment, package or collo is specified here. It can be specified until 3 digits after the decimal point |
| 23 | maxLoadmeter | N | The maximum load meter of the shipment, package or collo is specified here. It can be specified until 3 digits after the decimal point |
| 24 | minVolume | N | The minimum volume of the level (collo, package, shipment) in CM3 is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 25 | maxVolume | N | The maximum volume of the level (collo, package, shipment) in CM3 is specified here. In case of multi colli shipments each collo is checked separately. It can be specified until 3 digits after the decimal point |
| 26 | minValue | N | The minimum commercial value of the shipment, package or collo is specified here. It can be specified until 3 digits after the decimal point |
| 27 | maxValue | N | The maximum commercial value of the shipment, package or collo is specified here. It can be specified until 3 digits after the decimal point |
| 28 | colloQuantityFrom | N | The minimum number of colli can be specified here |
| 29 | colloQuantityTo | N | The maximum number of colli can be specified here |
| 30 | calcType | Y | The method to be used to calculate the rate is set here. Please see below under ‘Calculation Type’ for additional information |
| 31 | queryType | N | The method to be used to calculate the rate is set here. Please see below under ‘Query Type’ for additional information |
| 32 | tariffValue | Y | The actual rate is set here. This can be a flat rate, a percentage or a KG rate. It can be specified until 4 digits after the decimal point |
| 33 | currency | Y | The currency which is used is set here |
| 34 | chargeGroup | N | The charge group to be used is set here. Please see below under ‘Charge Group’ for additional information |
| 35 | chargeType | N | The charge type to be used is set here. Please see below under ‘Charge Type for additional information |
| 36 | boundaryType | N | In this element additional restrictions can be specified which need to be taken into account such as COLLOWEIGHT, PALLETWEIGHT or LOADMETER |
| 37 | boundaryMin | N | If a restriction is specified in element #25 then this parameter sets the minimum value for this. It can be specified until 3 digits after the decimal point |
| 38 | boundaryMax | N | If a restriction is specified in element #25 then this parameter sets the maximum value for this. It can be specified until 3 digits after the decimal point |
| 39 | validFrom | Y | The start date of when the rate is valid is set here |
| 40 | validUntil | Y | The end date of when the rate is valid is set here |
Calculation Type
| # | Calculation Type | Level | Description |
| 1 | BASE |
Shipment Collo Package |
With this type a fixed price for that specific line is set. It can be specified until 4 digits after the decimal point |
| 2 | PIECE |
Shipment Collo Package |
Through this type a rate per collo is set. The formula to be used is relevant amount*tariffValue. It can be specified until 4 digits after the decimal point |
| 3 | KG |
Shipment Collo Package |
This enables a rate per KG. Based on the Buy Weights table either the calculated weight or the gross weight (whichever is the highest) will be used and, if set, a rounding factor will be used. It is important to set the queryType to STAFFEL. This calculation type will likely always lead to multiple rate results as a scale is generally applied for various weights and on top of that a KG rate is added: if a shipment weighs 73,26 there will be a result for the BASE price scale 70.01 to 9999.00 kg and a result for the KG – STAFFEL line of 70.01 to 9999.00 kg. The formula to be used is tariffValue (euro per kg)*amount kg. It can be specified until 4 digits after the decimal point |
| 4 | PERCENT_VALUE | Shipment | In this way a percentage is calculated in relation to the commercial value of the shipment. The method to set a percentage is 0.01 equals 1%. The percentage can be specified until 3 digits after the decimal point |
| 5 | PERCENT_SERVICE | Shipment | This calculation type uses a similar functionality to PERCENT_VALUE but then a percentage of the purchase value is added. An example of this type is a fuel surcharge and / or an oversize surcharge. The percentage can be specified until 3 digits after the decimal point |
| 6 | LOADMETER |
Shipment Package Collo |
In this way the calculated load meters are used to determine the transport costs. |
| 7 | VOLUME |
Shipment Package Collo |
In this way the calculated volume are used to determine the transport costs. |
| 8 | MINIMUM |
Shipment Collo Package |
With this type a minimum result can be set combined with the specified chargeGroup. |
| 9 | MAXIMUM |
Shipment Collo Package |
With this type a maximum result can be set combined with the specified chargeGroup. |
| 10 | MIN_PRICE_PIECE | Shipment | This calculation type can be used to indicate a minimum price for an entire shipment. |
Query Type
The Query Type parameter is required to calculate certain exceptions. It is set to SINGLE by default, but two other values can apply:
- OR
- STAFFEL
OR
Use OR for surcharges where a shipment or collo is checked against multiple limits, such as:
- Total weight
- Total length
- Total width
- Total height
- Total convey_dimension
If any one of these limits is exceeded, the surcharge applies. An example of this is the PostNL conveyor surcharge.
STAFFEL
Use STAFFEL for KG-based contracts that include multiple weight scales. This allows multiple rate levels to be added together.
Example: DHL Express rate structure:
- Base rate up to 10 kg
- Additional scales (10–30 kg, 30–70 kg, 70–200 kg, 200–2500 kg)
With STAFFEL, the base price and the applicable scale price are added to produce the final rate.
Charge Group
There are two charge groups: SHIPPING and SURCHARGE.
- SHIPPING covers the basic transport costs.
- SURCHARGE covers additional fees such as fuel, customs, or oversize charges.
Charge Groups can be further detailed using Charge Types.
Charge Type
Each line in the tariff engine also includes a Charge Type, which specifies the exact cost component. These components are managed in the Generics table.
Find an example of Fuel Rates table here.
Other Tables
Client Carriers
Possible parameters in the Client Carriers table:
In the Client Carriers table, customer and carrier parameters are defined. For rate calculation, the following parameters are relevant:
SHOWRATES: Determines which rates are visible in the online platform and API.
- BUY – shows only purchase rates
- SELL – shows only sales rates
- BUYSELL – shows both purchase and sales rates
USERATES: Specifies whether purchase (BUY) or sales (SELL) rates should be used when applying CHEAPEST logic (selecting the lowest transport option). One of the two must be selected.
TARIFFLOOKUP: Defines the source of rate calculation.
- ENGINE – uses the tariff engine (required for the tariff engine to function)
- NONE – no rates are calculated
-
CARRIER – retrieves rates directly from the carrier, if available
TARIFF_LEVEL: Sets the hierarchy level at which purchase (BUY) rates are calculated. This is useful for customers with sub-account structures and are used to set which level the rates are calculated on:
- customer_id
- group_id
-
organisation_id
SALES_TARIFF_LEVEL: Same function as TARIFF_LEVEL, but applied to sales rates.
CALC_SALES_MARGINS: When set to ACTUAL, enables recalculation of rates based on purchase invoices.
Zones
The Zones table determines the delivery zone for each booking. A zone can be defined at multiple levels:
- Carrier
- Customer
- Collection country
- Serviceleveltime
- Servicelevelother
- Cost center
- Or any combination of these
The resulting zone is used in the rate calculation, as different zones may have different rates.
Buy Weights
The Buy Weights table defines which weight should be used in the rate calculation. Because shipments may include both heavy and voluminous goods, the gross weight is not always the correct basis.
When factors for volume weight and/or load meter weight are applied, the system calculates three types of weight—gross, volume, and load meter—and uses the highest value.
Keep in mind that some rate structures (like those based on collo counts) might not depend on weight, so this table may not always impact the calculation.
Weight rules can be set at various levels:
- Carrier
- Customer
- Collection country
- Serviceleveltime
- Servicelevelother
- Cost center
- Packagetype
- Or combinations of these
Sell Weights
The Sell Weights table functions the same as Buy Weights but is used for sales rates and/or margins.