๐Ÿงช Experimental KB โ€” Official knowledge hub: community.kaptio.com

Price incorrect after updating costing quantity with RequiredCostingsManagement.updateCostingQuantity

Customer reported that after using RequiredCostingsManagement.updateCostingQuantity to update costing quantity programmatically, the price became incorrect even though the quantity update appeared to

RequiredCostingsManagement updateCostingQuantity costing pricing occupancy API

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

  1. When calling RequiredCostingsManagement.updateCostingQuantity, you must also update the occupancy parameter alongside the quantity
  2. 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

Was this article helpful?