---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideappCalculationHelper - Global

# GlideappCalculationHelper - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The 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.

The methods for this API are used in global server-side scripts (script includes, business
rules, etc.). There is currently no support for scoped applications.

## GlideappCalculationHelper - addItemToExistingRequest(String requestID, String catalogID,
String quantity) {#ariaid-title2}

Adds 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.
{#GACalcHelp-addItemToRequest_S_S_S__table_amp_nym_rz__entry__3}

| Name | Type | Description |
|-|-|-|
| requestID | String | Sys_id of the request to which to add the catalog item(s) |
| catalogID | String | Sys_id of the catalog item to add to the request |
| quantity | String | Number (quantity) of the specified catalog item to be add to the request. |
[Table 1. Parameters]

{#GACalcHelp-addItemToRequest_S_S_S__table_amp_nym_rz} {#GACalcHelp-addItemToRequest_S_S_S__table_bmp_nym_rz__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 2. Returns]

{#GACalcHelp-addItemToRequest_S_S_S__table_bmp_nym_rz}  

    var catItemId = "04b7e94b4f7b4200086eeed18110c7fd";
    var requestId = "6eed229047801200e0ef563dbb9a71c2";
    var helper = new GlideappCalculationHelper();
    helper.addItemToExistingRequest(requestId, catItemId, "1");

## GlideappCalculationHelper - rebalanceRequest(String requestID) {#ariaid-title3}

Recalculates the price of all of the items in a specified request.
{#GACalcHelp-rebalanceRequest_S__table_ncc_s1n_rz__entry__3}

| Name | Type | Description |
|-|-|-|
| requestID | String | Sys_id of the request for which to recalculate the price |
[Table 3. Parameters]

{#GACalcHelp-rebalanceRequest_S__table_ncc_s1n_rz} {#GACalcHelp-rebalanceRequest_S__table_occ_s1n_rz__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#GACalcHelp-rebalanceRequest_S__table_occ_s1n_rz}  

    var catItemId = "04b7e94b4f7b4200086eeed18110c7fd";
    var requestId = "6eed229047801200e0ef563dbb9a71c2";
    var helper = new GlideappCalculationHelper();
    //Add an item to the request
    helper.addItemToExistingRequest(requestId, catItemId, "1");
    //Re-calculate the price of the request after adding the item
    helper.rebalanceRequest(requestId);


