{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":821,"path":"api-reference/server-api-reference/GlideappCalcHelperAPI.md","title":"GlideappCalculationHelper - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# GlideappCalculationHelper- Global\n\nThe GlideappCalculationHelper API is a scriptable object that provides methods that add items to an existing request or request the recalculation of the price of a request.\n\nThe methods for this API are used in global server-side scripts \\(script includes, business rules, etc.\\). There is currently no support for scoped applications.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## GlideappCalculationHelper - addItemToExistingRequest\\(String requestID, String catalogID, String quantity\\)\n\nAdds a specific catalog item to an existing request. This API should be used only before a request \\(REQ\\) is approved. After the REQ is approved, the RITM process is not initiated.\n\n|Name|Type|Description|\n|----|----|-----------|\n|requestID|String|Sys\\_id of the request to which to add the catalog item\\(s\\)|\n|catalogID|String|Sys\\_id of the catalog item to add to the request|\n|quantity|String|Number \\(quantity\\) of the specified catalog item to be add to the request.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar catItemId = \"04b7e94b4f7b4200086eeed18110c7fd\";\nvar requestId = \"6eed229047801200e0ef563dbb9a71c2\";\nvar helper = new GlideappCalculationHelper();\nhelper.addItemToExistingRequest(requestId, catItemId, \"1\");\n```\n\n## GlideappCalculationHelper - rebalanceRequest\\(String requestID\\)\n\nRecalculates the price of all of the items in a specified request.\n\n|Name|Type|Description|\n|----|----|-----------|\n|requestID|String|Sys\\_id of the request for which to recalculate the price|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n```\nvar catItemId = \"04b7e94b4f7b4200086eeed18110c7fd\";\nvar requestId = \"6eed229047801200e0ef563dbb9a71c2\";\nvar helper = new GlideappCalculationHelper();\n//Add an item to the request\nhelper.addItemToExistingRequest(requestId, catItemId, \"1\");\n//Re-calculate the price of the request after adding the item\nhelper.rebalanceRequest(requestId);\n```\n\n"}}