--- title: LeadtoCashCore - Scoped description: The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle.Triggers the PrimitiveUtil\(\) utility method.Returns the data of one or more given entities with a JSON object containing various details such as header, lines, child lines, characteristics, and their attributes.Compares the source and modified source JSON objects of a lead to cash entity and returns a JSON object that describes any changes made to the source JSON, such as any additions, deletions, or modifications.Transforms and applies the source JSON structure of a given entity to the target JSON of another entity. You can then commit the changed entity to the database using the commitInstance\(\) method.Commits the JSON of a given lead to cash entity to the instance, returns a status message with updated information, and updates the Lead to Cash Core Entity table as a result. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/server-api-reference/LeadToCashCoreAPI.html release: australia product: Server API Reference classification: server-api-reference topic_type: concept last_updated: "2026-03-12" reading_time_minutes: 47 breadcrumb: [Server API reference, API reference, API implementation and reference] --- # LeadtoCashCore- Scoped The LeadtoCashCore script include provides methods to orchestrate a lead-to-cash workflow in the Lead to Cash Core life cycle. The Lead to Cash Core \(com.snc.l2c.core\) plugin must be activated for LeadtoCashCore script includes to be available in an instance. This plugin can be accessed via the Lead to Cash Core \(com.snc.l2c\_core\) application in the ServiceNow Store. This script include belongs to the sn\_l2c\_core namespace and requires the admin role. In a lead to cash workflow, you map a source entity to a target entity. An entity is defined as a collection of tables. Source-to-target mapping allows you to transform the structure or content of the source entity to fit the structure or content needed in the target entity. The functionality provided by this script include represents the entity mapping feature available in the Lead to Cash feature. See [Lead to Cash Core](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/order-management/lead-to-cash.md) for more information. To complete a workflow using the LeadtoCash script include, you pass return parameters from one method to the next. Typically, you call these methods in the following order: 1. [LeadtoCashCore - getPrimitivesEPService\(String sourceToTargetConfigID, Object context\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) - Contains a utility for retrieving the extension point used to invoke scripts. Must be provided with every method call. See the 'Prequisites' section in this topic for more information. 2. [LeadtoCashCore - createInstance\(String headerSysIDs, String lineSysIDs, Boolean isTarget, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) - Fetches the data of a given entity. For example, customer order-related information including line items and their related data. Use the **context** parameter to declare one or more header or line IDs in the script, referred to as "multi-select". Pass the **context.entityConfigId** parameter to invoke the script without any defined mapping. For such multi-select use cases, the output JSON contains a key items array where each entry represents a single entity. 3. [LeadtoCashCore - delta\(Object sourceJSON, Object dirtyJSON, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) - Compares two JSON inputs and identifies any changes that occurred between them. For example, when something is added, deleted, or modified in an entity. 4. [LeadtoCashCore - effect\(Object sourceJSON, Object targetJSON, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) - Transforms the source JSON object into a target object. 5. [LeadtoCashCore - commitInstance\(Object targetJSON, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) - Commits the transformation made in the effect\(\) script include to the database. **Note:** If necessary, delta\(\) may be skipped in this workflow. However, calling these methods out of order results in an unsuccessful workflow \(for example, when calling commitInstance\(\) and then effect\(\)\). ## Prerequisites Each of these methods are bundled with an extension point, sn\_l2c\_core.LeadToCashServiceEP. PrimitiveUtil\(\) is a utility which provides methods to get the extension point service and invokes the script includes according to their available parameters. You must first provide PrimitiveUtil\(\) with the getPrimitivesEPService\(\) method, which specifies the table to get source and target information from. For more information, see [LeadtoCashCore - getPrimitivesEPService\(String sourceToTargetConfigID, Object context\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md). Once PrimitiveUtil\(\) and getPrimitivesEPService\(\) are provided in the script, you can then call any of the createInstance\(\), delta\(\), effect\(\), or commitInstance\(\) script includes as needed for your use case. ## Example Lead to Cash Core workflow script Though each of the available Lead to Cash Core script includes are documented individually, you can reference the following example to see how you can use these methods together to produce a lead to cash work flow. ``` var util = new sn_l2c_core.PrimitiveUtil(); // Set the context.isMultiSelect parameter as true to enable multi-select use cases // Set the context.entityConfigId parameter to the config id of the source entity (sold prodcut) to trigger createInstance with only configId var context = {"isMultiSelect": false, "entityConfigId": “sn_l2c_cust_flows_sold_product”}; //Flow: Creation of an order from a sold product var service = util.getPrimitivesEPService('sn_l2c_cust_flows_sp_to_order', context); //CREATE INSTANCE to get the data of sold product with sys_id '06670ba3c3adbd501caee74bb0013166' var SPInstance = service.createInstance(null, '06670ba3c3adbd501caee74bb0013166'); gs.info("SPInstance: "+JSON.stringify(SPInstance)); // DELTA // construct the dirtyJSON as required var deltaOutput = service.delta(SPInstance, dirtyJSON);/ gs.info("deltaOutput: "+JSON.stringify(deltaOutput)); // EFFECT var effectOutput = service.effect(deltaOutput); gs.info("effectOutput: " + JSON.stringify(effectOutput)); // COMMIT INSTANCE var commitOutput = service.commitInstance(effectOutput); gs.info("commitOutput: " + JSON.stringify(commitOutput)); ``` In our example, a customer purchased a sold product but now requests a modification on the existing sold product. The required modifications are provided in the form of a dirtyJSON. To apply these modifications, we call the Lead to Cash Core methods in the following order: 1. The first call gets the existing sold product information using the createInstance\(\) method. 2. We then compare this source JSON with the dirty JSON using the delta\(\) method, which returns a delta JSON. 3. The **delta\(\)** JSON is then transformed into a JSON of type order using the effect\(\) method. 4. The order JSON is committed to the database using the commitInstance\(\) method. **Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md) ## LeadtoCashCore - getPrimitivesEPService\(String sourceToTargetConfigID, Object context\) Triggers the PrimitiveUtil\(\) utility method. To use any of the available methods in the LeadtoCashCore script include, you must first always call the scripted extension point PrimitiveUtil\(\) in your script with the getPrimitivesEPService\(\) utility method to trigger the implementation.
| Name | Type | Description |
|---|---|---|
| context | Object | Optional. Additional parameter options for displaying attribute values and for invoking more than one instance at a time.``` "context": { "entityConfigId": "String", "isMultiSelect": "Boolean", "loadDisplayValue": "Boolean" } ``` |
| context.entityConfigId | String | Optional. Configuration ID of the entity. If both **entityConfigId** and **sourceToTargetConfigID** are provided, priority is given to **entityConfigId**.Table: Lead To Cash Entity \[sn\_l2c\_core\_entity\] Data type: String |
| context.isMultiSelect | Boolean | Optional. Flag that indicates whether to pass multiple entities as input to create the instance. Valid values: - true: Enables the passing of multiple entities as input. When true, you can pass multiple line items in a comma-separated list. - false: Doesn't enable the passing of multiple entities as input. Only one input may be passed in the API script. Default: false |
| context.loadDisplayValue | Boolean | Optional. Flag that indicates whether to load the display value for each attribute.Valid values: - true: Enables the loading of an attribute's display value. - false: Doesn't enable the loading of an attribute's display value. Default: false |
| sourceToTargetConfigID | String | Mapping configuration ID for the source-to-target mapping. Table: Lead To Cash Entity Mapping \[sn\_l2c\_core\_entity\_mapping\] |
| Name | Type | Description |
|---|---|---|
| additionalParams | Object | Optional. Additional parameters to use. |
| additionalParams.skipLines | Boolean | Optional. Flag that indicates whether to fetch line items for the specified entity.Valid values: - true: Skip returning line items information for the entity. - false: Return line items information for the entity. Default: false |
| fetchRecordSysIds | Array of Objects |
Enables selective fetching of data for both header‑based and header‑less scenarios by explicitly mapping table names to sys\_ids.Behavior:
- With header: Allows selective fetching of child entities \(like ramps\) linked to the header. If ramp IDs aren't provided, fetches all ramps linked to header.
- Without header: Supports fetching of ramps where direct relationships are missing in header-less entities. Ramp IDs must be included; without them, doesn't return ramp data.
Structure:
```
[{
" |
| multiSelectMerge | Boolean | Only for no-header scenarios. Flag that indicates whether to merge data of same context-type into a single flat structure.Valid values: - true: Merges same context-type data in a flat structure. - false: Doesn't merge data. |
| additionalParams.allowedContextTypes | Array of Strings | Optional. Controls population and processing to only those types listed in allowedContextTypes, excluding all other unrelated sections.Valid values: - For header-based partial sync, `header` must be passed in **allowedContextTypes** to allow this method to build the root structure. - For no-header partial sync, `lineItems` must be passed in **allowedContextTypes** to allow this method to build the structure for processing child data. Structure: ``` allowedContextTypes: ["header","headerRelatedParty"] }; ``` |
| headerSysIDs | String | Header sys\_id\(s\) of an entity to retrieve data from. Required if you don't provide the **lineSysIDs** parameter. Pass `null` if you aren't passing any header sys\_ids.To designate one or more header sys\_ids in your script, set `context.isMultiSelect = true` in the getPrimitivesEPService\(\) utility method. For more details, see the Parameters table in [LeadtoCashCore - getPrimitivesEPService\(String sourceToTargetConfigID, Object context\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md). **Note:** At least one **headerSysID** or **lineSysIDs** parameter is required. |
| isTarget | Boolean | Optional. Flag that determines whether to fetch target entity data.Valid values: - true: Fetch data of the target entity. - false: Don't fetch data of the target entity. Default: false |
| lineSysIDs | String | Line item sys\_id\(s\) of an entity to retrieve entity data from. Required if you don't provide **headerSysIDs** and if the entity structure starts with line items such as sold product. To designate one or more line item sys\_ids in your script, set `context.isMultiSelect = true` in the getPrimitivesEPService\(\) utility method. For more details, see the Parameters table in [LeadtoCashCore - getPrimitivesEPService\(String sourceToTargetConfigID, Object context\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md). **Note:** At least one **headerSysID** or **lineSysIDs** parameter is required. If passing multiple **lineSysIDs**, all records must belong to the same **headerSysID**. |
| Type | Description |
|---|---|
| JSON Object | A JSON containing details of the entity record.Data type: Array of objects ``` { "items": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String", "lineItems": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String", "characteristics": [Array], "lineItems": [Array] } ], "characteristics": [Array], "_state": "String" } ] } ``` |
| \_state | Activity state of the entity.Possible values: - active: The entity is active. - inactive: The entity is inactive. Default: active Data type: String |
| characteristics | List of entity characteristics. Characteristics may vary between entities.Data type: Array of objects ``` "characteristics": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| characteristics.attributes |
One or more objects that contain information about attributes associated with the characteristic record. The <attribute type> can be different values based on the records/functionality associated with the characteristic. For example, this object could contain references to the attributes record's sys\_id, associated characteristic records, characteristic option records, or sold product information.Data type: Object
```
"attributes": {
" |
| characteristics.attributes.<attribute\_type> |
Information about the key name of the item attribute.```
" |
| characteristics.attributes.<attribute\_type>.value | Typically the sys\_id of the of the associate attribute record, but can be any meaningful text string that describes the associated attribute type.Data type: String |
| characteristics.sys\_id | Object containing the sys\_id of the associated characteristic record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| characteristics.sys\_id.value | Sys\_id of the associated characteristic record.Data type: String |
| characteristics.table | Name of the table that contains the characteristic record of the lead to cash entity.Data type: String |
| items | Contains an array of selected objects when **context.isMultiSelect** is set to true.Data type: Array of Objects ``` "items": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String", "lineItems": [Array] }, ] ``` |
| items.attributes | Attributes of the item record. Attributes may vary between entities.``` "attributes": { "account": {Object}, "name": {Object} } ``` Data type: Object |
| items.attributes.account | Information about the account associated with the item attribute.``` "account": { "value": "String" } ``` |
| items.attributes.account.value |
Attributes of the item. Attributes may vary between entities.```
"attributes": {
"account": {Object},
" |
| items.attributes.<key\_name> |
Information about the key name of the item attribute.```
" |
| items.attributes.<key\_name>.value | Value of the key name attribute.Data type: String |
| items.sys\_id | Object containing sys\_id information about the entity item. Values vary between entities.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| items.sys\_id.value | Sys\_id of an associated item.Data type: String |
| items.table | Name of the table that contains line item record associated with the lead to cash entity.Data type: String |
| items.lineItems | JSON object that contains the line item details of the entity record. Data type: Array of objects ``` "lineItems": [ { "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "_state": "String", "sys_id": {Object}, "table": "String" } ] ``` |
| items.lineItems.\_state | Activity state of the line item entity.Possible values: - active: The entity is active. - inactive: The entity is inactive. Default: active Data type: String |
| items.lineItems.attributes |
Attributes of the line item record. Attributes may vary between entities.```
"attributes": {
"account": {Object},
" |
| items.lineItems.attributes.<key\_name> |
Information about the key name of the line item attribute.```
" |
| items.lineItems.attributes.<key\_name>.value | Value of the key name attribute.Data type: String |
| items.lineItems.attributes.account | Information about the account associated with the line item attribute.``` "account": { "value": "String" } ``` |
| items.lineItems.attributes.account.value | Sys\_id of the account associated with the line item attribute.Data type: String |
| items.lineItems.characteristics | List of characteristics associated with the line item. Characteristics may vary between entities.Data type: Array of objects ``` "characteristics": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| items.lineItems.characteristics.attributes |
One or more objects that contain information about attributes associated with the characteristic record. The <attribute type> can be different values based on the records/functionality associated with the characteristic. For example, this object could contain references to the attributes record's sys\_id, associated characteristic records, characteristic option records, or sold product information.Data type: Object
```
"attributes": {
" |
| items.lineItems.characteristics.attributes.<attribute\_type>.value | Typically the sys\_id of the of the associate attribute record, but can be any meaningful text string that describes the associated attribute type.Data type: String |
| items.lineItems.characteristics.sys\_id | Object containing the sys\_id of the associated characteristic record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| items.lineItems.characteristics.sys\_id.value | Sys\_id of the associated characteristic record.Data type: String |
| items.lineItems.characteristics.table | Name of the table that contains the characteristic record of the lead to cash entity.Data type: String |
| items.lineItems.lineItems | Child line items of a parent line item. This object has the same format as the **lineItems** parameter.Data type: Object ``` "lineItems": [ { "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "_state": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| items.lineItems.sys\_id | Object containing sys\_id information about the associated line item record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| items.lineItems.sys\_id.value | Sys\_id of an associated line item record.Data type: String |
| items.lineItems.table | Name of the table that contains the line item record associated with the lead to cash entity.Data type: String |
| Name | Type | Description |
|---|---|---|
| sourceJSON | Object | JSON object of the source lead to cash entity. **Note:** Use the [LeadtoCashCore - createInstance\(String headerSysIDs, String lineSysIDs, Boolean isTarget, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) method to retrieve the source JSON of an entity. |
| dirtyJSON | Object | Modified source JSON of the lead to cash entity. |
| additionalParams | Object | Optional. Additional parameters to use. |
| additionalParams.delta\_ignore\_attributes | Object |
Table attributes to ignore during comparison between the source and dirtyJSON. Enables support of reconfiguration use cases.```
{
“ |
| additionalParams.delta\_ignore\_attributes.<table\_name> | String | The name of the table and its associated attributes to ignore.For example: ``` { “sn_install_base_sold_product”: [“state”,”unit_price”] } ``` |
| additionalParams.loadDisplayValue | Boolean | Optional. Flag that indicates whether to load the display value for each attribute.Valid values: - true: Enables the loading of an attribute's display value. - false: Doesn't enable the loading of an attribute's display value. Default: false |
| Type | Description |
|---|---|
| JSON Object | An object containing details of the entity record with any changes that occurred between the sourceJSON and dirtyJSON.Data type: Object ``` { "lineItems": [Array] } ``` |
| lineItems | JSON object that contains the line item details of the entity record. For example, order line items or quote line items. Data type: Array of objects ``` "lineItems": [ { "_action": "String", "attributes": {Object} "characteristics": [Array] "lineItems": [Array], "sys_id": {Object}, "table": "String" } ] ``` |
| lineItems.\_action | Change action applied to the line item of the source JSON. Possible values: - add: Information was added to the source JSON. - change: Information was updated in the source JSON. - disconnect: Information was disconnected from the source JSON. - nochange: No change occurred on the source JSON. Data type: String |
| lineItems.attributes |
Attributes of the line item. For example, the attribute's name and value. May contain varying fields based on the entity.Data type: Object
```
"attributes": {
" |
| lineitems.attributes.<attribute\_name> |
Name of the line item attribute. For example, the name of an account or contact. May contain varying fields of the entity.Data type: Object
```
"attributes": {
" |
| lineitems.attributes.<attribute\_name>.value | Value of the line item attribute. Data type: String |
| lineItems.attributes.account | Information about the account associated with the item attribute.Data type: Object ``` "account": { "value": "String" } ``` |
| lineItems.attributes.account.value | Sys\_id of the account associated with the line item attribute.Data type: String |
| lineItems.characteristics | Characteristics of the line item. May contain varying fields based on the entity.Data type: Array of Objects ``` "characteristics": [ { "attributes": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| lineItems.characteristics.attributes |
Attributes of the header record characteristics. For example, the attribute's name and value. May contain varying fields based on the entity.Data type: Object
```
"attributes": {
" |
| lineitems.characteristics.attributes.<field\_name> |
Attribute name of the characteristic record associated with the line item.Data type: Object
```
" |
| lineitems.characteristics.attributes.<field\_name>.value | Value of the attribute belonging to the characteristic record of an entity.Data type: String |
| lineItems.characteristics.sys\_id | Sys\_id object of the characteristic record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| lineItems.characteristics.sys\_id.value | Sys\_id of the associated characteristic record. The updated table may vary between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| lineItems.characteristics.table | Name of the table containing the characteristic record.Data type: String |
| lineItems.lineItems | Child line items of a parent line item. This object has the same format as the **lineItems** parameter.Data type: Array of Objects ``` "lineItems": [ { "_glide_action": "String", "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "sys_id": {Object}, "table": "String" } ] ``` |
| lineItems.sys\_id | Sys\_id of the associated item record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| lineItems.sys\_id.value | Sys\_id of an associated item record. The updated table may vary between entities, like Order or Specification. For example, Order \[sn\_ind\_tmt\_orm\_order\]. Data type: String |
| lineItems.table | Name of the table that contains the item record associated with the lead to cash entity. Data type: String |
| Name | Type | Description |
|---|---|---|
| sourceJSON | Object | JSON containing details of the source entity.**Note:** Use the [LeadtoCashCore - createInstance\(String headerSysIDs, String lineSysIDs, Boolean isTarget, Object additionalParams\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) to retrieve the source JSON of an entity. |
| targetJSON | Object | JSON containing details of the target entity. |
| additionalParams | Object | Optional. Additional parameters to use. |
| additionalParams.is\_future\_state | Boolean | Optional. Use this to support reconfiguration use cases. Accepted values: - true: Provides context variable keys instead of dictionary field names. This allows you to provide all the attributes from the target entity instead of mapping attributes from source to target. - false: Provides dictionary field names. Default: false |
| Type | Description |
|---|---|
| JSON Object | Change that occurred and was applied from the source to target entity JSON objects at each of the header of the lead to cash entity.Data type: Object ``` { "_glide_action": "String", "_records_count: {Object}, "_source_object": {Object}, "lineItems": [Array], "sys_id": "String", "table": "String" } ``` |
| \_glide\_action | Indicates the change that occurred at the item level between the source and target JSON.Possible values \(case-sensitive\): - DELETE: Information was removed between the source and target JSON structures. - INSERT: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and JSON structures. Data type: String |
| \_records\_count | Details of new records inserted for each table.Data type: Object ``` "_records_count": { "tableName": {Object} } ``` |
| \_records\_count.tableName | Name of the table in which new records are inserted.Data type: Object ``` "tableName": { "insert": Number} } ``` |
| \_records\_count.tableName.insert | Number of new records inserted in the table.Data type: Number |
| \_source\_object | Source JSON object to which changes were applied. The object structure may vary between entities.Data type: Object ``` "_source_object": { "sys_id": "String", "table": "String" } ``` |
| \_source\_object.sys\_id | Sys\_id of the source entity record that was updated. Data type: String |
| \_source\_object.table | Table location of the source entity record that was updated. This value may vary between entities.Data type: String |
| lineItems.\_glide\_action | Change action that occurred on the line item.Possible values: - DELETE: Information was removed between the source and target JSON structures. - INSERT: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and JSON structures. Data type: String |
| lineItems.\_source\_object | Source entity record details to which the \_glide\_action was applied. This object may vary between entities.Data type: Object ``` "_source_object": { "sys_id": "String", "table": "String" } ``` |
| lineItems.\_source\_object.sys\_id | Sys\_id of the source entity record that was updated. Data type: String |
| lineItems.\_source\_object.table | Table location of the source entity record that was updated. This value may vary between entities.Data type: String |
| lineItems.\_state | State of the entity.Data type: Object ``` "_state": { "value": "String" } ``` |
| lineItems.\_state.value | The current state of the entity.Possible values: - active: The entity object is in an active state. - inactive: The entity object isn't in an active state. Data type: String |
| lineItems.attributes |
Attributes of the line item. For example, the attribute's name and value. May contain varying fields based on the entity.Data type: Object
```
"attributes": {
" |
| lineitems.attributes.<attribute\_name> |
Name of the line item attribute. For example, the name of an account or contact. May contain varying fields of the entity.Data type: Object
```
"attributes": {
" |
| lineitems.attributes.<attribute\_name>.value | Value of the line item attribute. Data type: String |
| lineItems.attributes.account | Information about the account associated with the item attribute.Data type: Object ``` "account": { "value": "String" } ``` |
| lineItems.attributes.account.value | Sys\_id of the account associated with the line item attribute.Data type: String |
| lineItems.attributes.short\_description | Brief description of the line item attribute.Data type: String |
| lineItems.characteristics | List of characteristics associated with the line item. Characteristics may vary between entities.Data type: Array of Objects ``` "characteristics": [ { "_glide_action: "String", "attributes": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| lineItems.characteristics.\_glide\_action | Change action that occurred on the line item.Possible values: - DELETE: Information was removed between the source and target JSON structures. - INSERT: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and JSON structures. Data type: String |
| lineItems.characteristics.attributes |
One or more objects that contain information about attributes associated with the characteristic record.For example, this object could contain references to the attributes record's sys\_id, associated characteristic records, accounts or contacts, characteristic option records, or sold product information.
Data type: Object
```
"attributes": {
" |
| lineItems.characteristics.attributes.<attribute\_type> |
Type of attribute. This value can contain different values based on the records or functionality associated with the characteristic.Data type: Object
```
" |
| lineItems.characteristics.attributes.<attribute\_type>.value | Value of the line item attribute.Data type: String |
| lineitems.characteristics.attributes.<field\_name> |
Attribute name of the characteristic record associated with the line item.Data type: Object
```
" |
| lineitems.characteristics.attributes.<field\_name>.value | Value of the attribute belonging to the characteristic record of an entity.Data type: String |
| lineItems.characteristics.sys\_id | Sys\_id of the associated characteristic record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| lineItems.characteristics.sys\_id.value | Sys\_id of the associated characteristic record. The updated table may vary between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| lineItems.characteristics.table | Name of the table containing the characteristic record.Data type: String |
| lineItems.lineItems | Child line items of a parent line item. This object has the same format as the **lineItems** parameter.Data type: Array of Objects ``` "lineItems": [ { "_glide_action": "String", "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "sys_id": {Object}, "table": "String" } ] ``` |
| lineItems.sys\_id | Sys\_id of the associated item record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| lineItems.sys\_id.value | Sys\_id of an associated item record. The updated table may vary between entities, like Order or Specification. For example, Order \[sn\_ind\_tmt\_orm\_order\]. Data type: String |
| lineItems.table | Name of the table that contains the item record associated with the lead to cash entity. Data type: String |
| sys\_id | Sys\_id of the entity.Data type: String |
| table | Name of the table in which the entity is found.Data type: String |
| Name | Type | Description |
|---|---|---|
| targetJSON | Object | JSON object containing the ‘glide\_action’ of a target entity to commit. You can pass the output of the [effect\(\)](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/LeadToCashCoreAPI.md) method here. **Note:** ‘glide\_action’ identifies the change action that occurred between the source and target JSON of a lead to cash entity. |
| additionalParams | Object | Optional. Additional parameters to use.``` "additionalParams": { "returnDeletedGr": Boolean, "useNumberGeneartor": Boolean } ``` |
| additionalParams.useNumberGenerator | Boolean | Optional. Flag that indicates if to generate sys\_numbers in bulk. Applicable values: - true: Generate the sys\_numbers in bulk to be utilized during the record insertion process. Reduces the need for additional queries to fetch numbers and decreases insertion time. - incorrect: Generate the sys\_number individually at the time of insertion for each record. Default: incorrect |
| additionalParams.returnDeletedGr | Boolean | Optional. Flag that indicates whether to trigger post processing upon a DELETE operation. Only set **returnDeletedGr** to `true` if your subclass overrides `_postProcess` or `_postHierarchyCommit` and contains logic that should execute after DELETE operations. Valid values: - true: The deleted GlideRecord is returned after a DELETE operation and assigned to target, which causes **\_postProcess** and **\_postHierarchyCommit** to fire. - false: DELETE operations don't trigger**\_postProcess** or **\_postHierarchyCommit**. Default: false |
| Type | Description |
|---|---|
| JSON Object | Details about the target entity record.Data type: Object ``` { "dataObject": {Object}, "displayMessage": "String", "error": "String", "headerID": "String", "message": "String", "rootLineIDs": [Array], "status": "String" } ``` **Note:** **headerID** is only present for header entities, **rootLineIDs** are only present for no‑header entities. **dataObject**, **displayMessage**, **error**, **message**, and **status** are always present. |
| dataObject | JSON object that has detailed data on the commit operations performed at each level. **Note:** As of the March 2026 store release, the **dataObject** field at this time accumulates all root entity types by their typeValue keys \(for example lineItems, ramp\), preserving data for all root entities. Data type: Object Structure when entity has a header: ``` dataObject: { "sys_id": "String", "table": "String", "attributes": {Object}, "_glide_action": "String", "_source_object": {Object}, "_commitObjectInfo": {Object}, "lineItems": [Array], "ramp": [Array], "headerRelatedParty": [Array], "characteristics": [Array] } ``` |
| dataObject.\_commitObjectInfo | Commit status and sys\_id if the line item change is an ENGAGE action.Data type: Object ``` "_commitObjectInfo": { "status": "String", "sys_id": "String" } ``` |
| dataObject.ramp | Represents the ramp group\(s\) associated with a header or Sold Material.Array of Objects ``` "ramp": { "sys_id": "String", "table": "String", "attributes": {Object} } ``` |
| dataObject.ramp.sys\_id | Sys\_id of the ramp. Providing ramp IDs without the parent mapping is considered invalid input for no-header and multiselect patterns.Data type: String |
| dataObject.ramp.table | Table name of the ramp entity associated with the committed Sold Material or header. For example, `"sn_install_base_sold_product_ramp"`.Data type: String |
| dataObject.ramp.attribute | Attributes of the ramp.Data type: Object ``` "attributes": { "end_date": String, "parent": String, "parent_table": String, "ramp_type": String, "start_date": String, "status": String, "term": String } ``` |
| dataObject.ramp.attribute.parent | Sys\_id of the ramp's parent attribute.Data type: String |
| dataObject.ramp.attribute.parent\_table | Table location of the attribute. For example, `table_name`.Data type: String |
| dataObject.ramp.attribute.ramp\_type | Type of ramp.Possible values: - Quarterly - Yearly - Custom Data type: String |
| dataObject.ramp.attribute.term | Term.Data type: String |
| dataObject.ramp.attribute.start\_date | Start date of the ramp.Data type: String |
| dataObject.ramp.attribute.end\_date | End date of the ramp.Data type: String |
| dataObject.\_commitObjectInfo.status | Status of the commit operation performed on the particular entity. Possible values: - success: The entity commit operation was correct. - if...not: The entity commit operation wasn't correct. Data type: String |
| dataObject.\_commitObjectInfo.sys\_id | Sys\_id of the inserted record. The method returns this parameter only if the **dataObject.\_glide\_action** is `ENGAGE`. The updated table possibly change between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| dataObject.\_glide\_action | Change action that occurred on the line item. Possible values: - REMOVE: Information was removed between the source and target JSON structures. - ENGAGE: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and target structures. Data type: String |
| dataObject.\_source\_object | Source JSON object to which changes were applied. The object structure possibly change between entities.Data type: Object ``` "_source_object": { "sys_id": "String", "table": "String” } ``` |
| dataObject.\_source\_object.sys\_id | Sys\_id of the source entity record to which the \_glide\_action was applied. The updated table possibly change between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| dataObject.\_source\_object.table | Name of the table that has the source entity record to which the \_glide\_action was applied. This possibly change between entities.Data type: String |
| dataObject.lineItems | Line item details of the entity record. For example, order line items or give line items.Data type: Array of Objects ``` "lineItems": [ { "_action": "String", "_commitObjectInfo": {Object}, "_glide_action": "String", "_source_object": {Object}, "_state": "String", "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "sys_id": {Object}, "table": "String", } ] ``` |
| dataObject.lineItems.\_action | Change action applied to the line item of the source JSON. Possible values: - add: Information was added to the source JSON. - change: Information was updated in the source JSON. - disconnect: Information was disconnected from the source JSON. - nochange: No change occurred on the source JSON. Data type: String |
| dataObject.lineItems.\_commitObjectInfo | Returned if the line item change is an `ENGAGE` action. Has the object’s commit status and sys\_id.Data type: Object ``` "_commitObjectInfo": { "status": "String", "sys_id": "String" } ``` |
| dataObject.lineItems.\_commitObjectInfo.status | Status of the commit operation performed on the particular entity. Possible values: - success: The entity commit operation was correct. - if...not: The entity commit operation wasn't correct. Data type: String |
| dataObject.lineItems.\_commitObjectInfo.sys\_id | Sys\_id of the inserted record. The updated table possibly change between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| dataObject.lineItems.\_glide\_action | Change action that occurred on the line item.Possible values: - DELETE: Information was removed between the source and target JSON structures. - INSERT: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and JSON structures. Data type: String |
| dataObject.lineItems.\_source\_object | Source entity record details to which the \_glide\_action was applied. This object may vary between entities.Data type: Object ``` "_source_object": { "sys_id": "String", "table": "String" } ``` |
| dataObject.lineItems.\_source\_object.sys\_id | Sys\_id of the source entity record to which the \_glide\_action was applied. Data type: String |
| dataObject.lineItems.\_source\_object.table | Table name of the source entity record to which the \_glide\_action was applied.Data type: String |
| dataObject.lineItems.\_state | Condition of the object.Possible values: - active: The entity object is in an active condition. - inactive: The entity object isn't in an active condition. Data type: String |
| dataObject.lineItems.attributes |
Attributes of the line item. For example, the attribute's name and value. May contain varying fields based on the entity.Data type: Object
```
"attributes": {
" |
| dataObject.lineItems.attributes.<attribute\_name> |
Name of the line item attribute. For example, the name of an account or contact. May contain varying fields of the entity.Data type: Object
```
"attributes": {
" |
| dataObject.lineItems.attributes.<attribute\_name>.value | Value of the line item attribute. Data type: String |
| dataObject.lineItems.characteristics | List of characteristics associated with the line item. Characteristics may vary between entities.Data type: Array of Objects ``` "characteristics": [ { "_glide_action: "String", "attributes": {Object}, "sys_id": {Object}, "table": "String" } ] ``` |
| dataObject.lineItems.characteristics.\_glide\_action | Change action that occurred on the line item.Possible values: - DELETE: Information was removed between the source and target JSON structures. - INSERT: Information was added between the source and target JSON structures. - NO\_CHANGE: No change occurred between the source and target JSON structures. - UPDATE: Information was modified between the source and JSON structures. Data type: String |
| dataObject.lineItems.characteristics.attributes |
One or more objects that contain information about attributes associated with the characteristic record.For example, this object could contain references to the attributes record's sys\_id, associated characteristic records, accounts or contacts, characteristic option records, or sold product information.
Data type: Object
```
"attributes": {
" |
| dataObject.lineItems.characteristics.attributes.<attribute\_type> |
Name of the quality attribute. Possibly contain varying fields of the entity.Data type: Object
```
" |
| dataObject.lineItems.characteristics.attributes.<attribute\_type>.<attribute\_name> |
Name of the quality attribute.Data type: Object
```
" |
| dataObject.lineItems.characteristics.attributes.<attribute\_type>.<attribute\_name>.value | Value of the line item attribute.Data type: String |
| dataObject.lineItems\[0\].characteristics.sys\_id | Sys\_id of the associated characteristic record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| dataObject.lineItems\[0\].characteristics.sys\_id.value | Sys\_id of the associated characteristic record. The updated table may vary between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\].Data type: String |
| dataObject.lineItems\[0\].characteristics.table | Name of the table containing the characteristic record.Data type: String |
| dataObject.lineItems\[0\].lineItems | Child line items of a parent line item. This object has the same format as the **lineItems** parameter.Data type: Array of Objects ``` "lineItems": [ { "_glide_action": "String", "attributes": {Object}, "characteristics": [Array], "lineItems": [Array], "sys_id": {Object}, "table": "String" } ] ``` |
| dataObject.lineItems\[0\].sys\_id | Sys\_id of the associated item record.Data type: Object ``` "sys_id": { "value": "String" } ``` |
| dataObject.lineItems\[0\].sys\_id.value | Sys\_id of an associated item record. The updated table may vary between entities, like Order or Specification. For example, Order \[sn\_ind\_tmt\_orm\_order\]. Data type: String |
| dataObject.lineItems\[0\].table | Name of the table that contains the item record associated with the lead to cash entity. Data type: String |
| dataObject.sys\_id | Sys\_id of the associated line item record. The updated table possibly change between entities. For example, Order \[sn\_ind\_tmt\_orm\_order\]. Data type: String |
| dataObject.table | Name of the table that has the record of the lead to cash entity.Data type: String |
| displayMessage | Message that is displayed to the user in the UI. The display message is identical to the **message** string value.Data type: String |
| error | Error message that describes the if...not of the commitInstance method. If the request is correct, this parameter returns an empty string.Data type: String |
| headerID | Required only for entities with a header. Sys\_id of the target entity record created or updated by the commitInstance method. Stored in: The related table depending on the entity type, like sold material, order, etc. Data type: String |
| message | Message describing the success, error, or partially\_success scenarios. This message is the same as the **displayMessage** string value and can be used by other apply calls to the API.Data type: String |
| rootLineIDs | Required only for no-header entities. Comma-separated list of sys\_ids of the target entity records inserted, updated, or deleted by the commitInstance method. Stored in: The related table depending on the entity type, like sold material, order, etc. Data type: Array of Strings |
| status | Status message confirming the success of the commit. Possible values: - success: The commit was correct. - if...not: The root line or header glide operation unserviceable. Retrigger the LeadtoCashCore API flow. - partial\_success: There were failures while processing the entire JSON. Refer to processing logs to troubleshooting specific errors. Data type: String |