Optimization
Adding Package Recommendation to the Checkout
Optimization determines the exact size of the parcel(s) to be sent. This naturally results in more accurate delivery option estimations, especially if coupled with Digital Transport Agreements for cost calculation.
To enable order optimization in the checkout, you simply need to:
- Onboard your packages.
- Contact Skrym to enable the optimization in the checkout
It is also always suggested to onboard product data to easily enable any integration.
To read more about how our order optimization works, head over to Package Optimization.
Data requirements
Skrym follows specific steps to determine which products should be sent for optimization. The process involves:
-
Checking Product Type: Skrym examines the products type field to identify physical products eligible for optimization. Non-physical products are excluded from the optimization flow.
-
Extracting Product Data: Skrym retrieves product dimensions and weight for optimization in two ways:
2.1 From the Request: If the request contains product dimensions for all physical products, Skrym uses that data for a checkout optimization (although this still requires onboarded package data).
2.2 From the Database: You can onboard products and utilize their dimensions for optimization. To use this approach, you must provide an external ID (reference) in the order and set the
onboard-products
checkout preference to true underklarna-shipping-assistant
/API
.
Exception handling
- Empty Product Reference:
- If the
onboard-products
preference is false, Skrym uses the dimension data provided by the caller. - If the data is valid, optimization proceeds as usual. If the data is invalid, the optimization fails, and the flow continues without any optimization results (this can negatively affect other extensions such as costs/availability/emissions).
- If the
onboard-products
preference is true, but the product reference is empty,- Then products cannot be fetched from the database due to the lack of an identifier.
- Empty Product Type:
- If the product type is empty, Skrym will disregard the product in the optimzation.
- If the dimensions are invalid and the product reference is valid, the product is not sent for optimization.