Problem
Customer reported that after using RequiredCostingsManagement.updateCostingQuantity to update costing quantity programmatically, the price became incorrect even though the quantity update appeared to work.
What We Found
The method RequiredCostingsManagement.updateCostingQuantity only changes the quantity in the ItineraryItemDto line parameters. It does not automatically update the occupancy parameter. When quantity is updated without also updating occupancy, the pricing calculation produces incorrect results.
Solution
- When calling RequiredCostingsManagement.updateCostingQuantity, you must also update the occupancy parameter alongside the quantity
- Refer to the Kaptio code sample documentation for the correct implementation pattern: https://docs.kaptioapis.com/kaptio-code-sample/-/price-line-factory#faVACAdICvH
Notes
- This is a common pitfall for developers using the Kaptio API to manage costings programmatically
- The customer confirmed the solution worked after following the documentation
Warnings
โ ๏ธ Updating quantity without updating occupancy will result in incorrect pricing
Source: KHELP-12327