Shipping Method
The ShippingMethod object defines logistical modes, delivery times, and cost calculation rules for each shipment. While Shipping Zones define where a product can be shipped, Shipping Methods establish how the price is calculated and which carriers are available.
ShippingMethod Definition (applied to CartItem)
| Property | Type | Description |
|---|---|---|
| productId | string (UUID) | ID of the associated product. |
| methodId | string (UUID) | Unique identifier for the shipping method. |
| label | string | Name displayed to the customer (e.g., "Standard Shipping"). |
| provider | string | The carrier or service provider (e.g., "Poste Italiane"). |
| pricing | Object | Complex cost configuration (base, per kg, free shipping thresholds). |
| availableCountries | string[] | Array of ISO country codes where this specific method is active. |
| etaMin / etaMax | number | Estimated minimum and maximum delivery days. |
| enabled | boolean | Activation status of the method. |
| maxWeight / maxVolume | number | Physical limits beyond which the method is no longer selectable. |
Shipping Logic (Fundamental)
In webround.com, the ability to ship a product to a specific country is determined by the intersection of two mandatory control levels:
- Level One (Where): A Shipping Zone must exist that includes the destination
countryCode. - Level Two (How): At least one Shipping Method must exist whose
availableCountriesarray contains the destination country code.
A product is considered shippable only if both criteria are met. If a country is present in the Shipping Zone but is not included in any active Shipping Method for that product, the user will not be able to complete the purchase for that destination.
Pricing Detail
The pricing property allows for variable cost algorithms:
- base: Fixed starting cost.
- perKg / perVolume: Incremental costs based on weight (in grams) or volume.
- freeShippingThreshold: Order value above which shipping becomes free (if
enableFreeShippingis true). - fromWeight / toWeight: Weight range within which the method is valid.
"pricing": {
"eur": {
"base": 8,
"perKg": 0.5,
"freeShippingThreshold": 250,
"enableFreeShipping": true
}
}
Remember that weights are expressed in grams and volumes in cm³. For example, a fromWeight of 10000 corresponds to 10kg. Ensure product data is consistent to avoid errors in cost calculation.