---
sourceDocument: Brazil Sales Customer Relationship Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/order-management

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Sales Customer Relationship Management

ft:clusterId :

    - omgmt

bundleId :

    - omgmt

workflow :

    - Customer and Industry


---

# ServiceNow Quote Experience Integration - POST

# ServiceNow Quote Experience Integration - POST {#ariaid-title1}

Release version: Brazil  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of ServiceNow Quote Experience Integration - POST

This guide explains how ServiceNow CPQ customers can write data back to Salesforce using a POST integration with the Salesforce Composite Graph API.
It is designed for customers who have integrated ServiceNow CPQ with Salesforce and want to update Salesforce transaction records with ServiceNow quote data efficiently and reliably.
Show full answer Show less  

## Salesforce Setup

Customers should verify that necessary Salesforce fields exist on the **LGKTransactionc** (header) and **LGKTransactionLinec** (line) objects. Key fields include transaction stage, net totals, quantities, prices, and references to parent transactions and products. These fields enable mapping ServiceNow CPQ transaction and line data correctly into Salesforce.

## Integration Approach with Composite Graph API

The integration uses the Salesforce Composite Graph API to update multiple Salesforce objects (header and lines) in a single API call. This approach:

* Reduces API calls and resource consumption
* Ensures atomic transactions (all-or-nothing updates)
* Improves data consistency and error handling

No special Salesforce setup is needed for this API; it is a built-in Salesforce capability.

## ServiceNow Quote Experience Setup

To maintain accurate synchronization, the integration relies on mapping transaction IDs and line references between ServiceNow and Salesforce, including:

* Mapping parent transaction IDs to link Salesforce transaction lines properly
* Using custom line fields `lineReferenceId` and `parentLineReferenceId` to track line relationships
* Mapping product partner IDs to associate correct product pricing and discounts

This ensures updates, additions, and deletions of lines reflect properly in Salesforce while preserving discounts.

## Handling Salesforce ID Format Restrictions

Since Salesforce Composite Graph API does not support hyphens in certain identifiers, hyphens are programmatically removed from ServiceNow line IDs before sending data to Salesforce. This is done using determination rule actions with scripts that strip hyphens from `lineReferenceId` and `parentLineReferenceId` fields, ensuring ID compatibility and smooth integration operation.

## Configuring the POST Integration

To configure the integration in ServiceNow:

* Create an HTTP POST integration targeting the Salesforce Composite Graph API endpoint
* Use a transformation template with Handlebar syntax to format transaction header and line data into the composite graph JSON structure
* Map all required fields including transaction stage, net totals, quantities, prices, and references as per Salesforce field mappings
* Ensure the Salesforce transaction record ID is available via a prior GET integration to link updates correctly

## Debugging and Testing

ServiceNow provides an Integration Admin interface to debug POST calls by fetching sample transaction JSON and running the transformation logic before sending data. Customers can also use tools like Postman connected to Salesforce for end-to-end testing of the integration.

## Key Benefits for ServiceNow Customers

* Efficiently update Salesforce transactions and lines directly from ServiceNow CPQ
* Maintain data integrity with atomic, consistent updates across objects
* Customize field mappings to fit specific business requirements
* Handle complex line item relationships with parent/child references
* Overcome Salesforce ID format limitations seamlessly  
Learn how to write data to a third-party application suh as Salesforce by using the POST integration.

## Prerequisites {#transaction-manager-integration-post__section_iqy_f4d_hhc}

This article assumes that you have a ServiceNow CPQ environment that is integrated to a corresponding Salesforce environment. Before you continue, see [Installing the Salesforce Transaction Manager Integration Package extension](https://servicenow-prod.fluidtopics.net/8wR7E2X7MuqD4ZXlSgyVxA "To use Transaction Manager with Salesforce, you must first follow these steps to install and configure the Salesforce Transaction Manager Integration Package Extension.") to complete the necessary integrations.

When the end user initiates a function that writes ServiceNow CPQ data back to the corresponding Salesforce transaction record, ServiceNow CPQ must have the Salesforce transaction's record identifier on hand. To understand how to retrieve the Salesforce transaction ID and save it into ServiceNow CPQ for future use, see [ServiceNow Quote Experience Integration - GET](https://servicenow-prod.fluidtopics.net/96r0a71Pe3wMBhHOz2oMpQ "Learn how to access data from a third-party application such as Salesforce by using the GET integration.").

## Salesforce setup {#transaction-manager-integration-post__section_mm5_zmd_hhc}

In this example, we write LGK data to the Salesforce fields listed below. Review the Salesforce Transaction and TransactionLine objects to ensure these fields are present.

Header fields (Salesforce object:LGK__Transaction__c)

* LGK__Stage__c holds the stage of the ServiceNow CPQ transaction.
* LGK__PricingExtendedNet__c is the transaction (header-level) net total.
* LGK__Id__c is mapped to the id of the parent transaction.

{#transaction-manager-integration-post__ul_j53_qhd_hhc}

Line Fields (Salesforce object: LGK__TransactionLine__c)

* LGK__Quantity__c: the line-level quantity.
* LGK__PricingList__c: the line-level list price.
* LGK__PricingNet__c: the line net price, or discounted piece price.
* LGK__PricingExtendedNet__c: the line net total, or extended net price (includes quantity).
* LGK__ParentTransactionLineId__c checks whether txn.line.custom.parentLineReferenceId exists. If it does, it assigns the corresponding line's id; otherwise, it sets the value to null.
* LGK__Product2Id__c is mapped to the partnerId of the product associated with the current transaction line.
{#transaction-manager-integration-post__ul_k53_qhd_hhc}

## POST integration using Composite Graph {#transaction-manager-integration-post__POST-Integration-Using-Composite-Graph}

The LGK POST integration uses the Salesforce Composite Graph API to update multiple Salesforce objects simultaneously in a single API call, allowing both header-level and line-level fields to be updated in the same request.

The Salesforce Composite Graph API enables bundling multiple operations into a single request, making it highly efficient for integrations. It allows writing to multiple Salesforce objects in a single POST call, reducing API usage,
ensuring data consistency, and enabling atomic transactions---where either all operations succeed or none are applied. This simplifies integration processes and improves error handling. For more details on the Composite Graph
construct, see [Composite Graph \| REST API Developer Guide \| Salesforce Developers](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph.htm).

Because the Composite Graph API is a core Salesforce capability, no setup is necessary. However, we introduce the concept here, before we populate a Composite Graph in the LGK POST call, described below. In the example below for
POST, the integration uses the previously mentioned header-level and line-level fields in the Salesforce Setup section above, with the option for users to add or remove fields as per their requirements.

## ServiceNow Quote Experience setup {#transaction-manager-integration-post__section_ghw_2nd_hhc}

The transaction ID mappings mentioned in the Salesforce Setup section help ServiceNow CPQ send the right line IDs to Salesforce and manage updates, deletions, and additions effectively. By mapping LGK__TransactionId__c to the parent transaction ID, Salesforce can link all line-level changes to
the correct transaction, ensuring proper association. The LGK__ParentTransactionLineId__c checks for a parent line reference; if present, it assigns the corresponding line ID, ensuring that only valid lines are updated or deleted.
If no reference exists, it sets the value to null. The LGK__Product2Id__c maps to the product's partner ID, ensuring the correct product is linked to the line for accurate pricing and discount application. These dynamic mappings
ensure that Salesforce can accurately update quantities, delete lines, and add new ones while preserving user's line-level discounts by maintaining proper associations with transaction and product data.

This integration transform requires the use of two custom line fields, lineReferenceId and parentLineReferenceId. These fields must be set up to store a variation of the
txn.line.id and (potentially) txn.line.parent.id system fields.

## Rules {#transaction-manager-integration-post__Rules}

The Salesforce Composite Graph API does not support hyphens in certain identifiers, which can cause issues when sending data that includes hyphenated IDs, such as the LGK line IDs. To make the integration work, the system removes
any hyphens present in the LGK line IDs before sending them to Salesforce. This ensures that the IDs comply with Salesforce's format requirements and that the integration functions correctly without errors related to invalid
characters. By removing the hyphens, the system ensures that all identifiers are accepted by Salesforce, allowing the integration to process updates and other operations smoothly.

To remove hyphens by using a rule, create a determination rule action to make line-level reference Id fields Salesforce-compatible. You can add both the lineReferenceId determination action and parentLineReferenceId determination
action in a single rule.

Below are two determination scripts (transaction line level) for how the fields should be defined.

    // lineReferenceId Determination Action

    var original = txn.line.id;
    var result = "";
    for (var i = 0; i < original.length; i++) {
      if (original.charAt(i) !== "-") {
    	    result += original.charAt(i);
    	  }
    }
    return result;

    // parentLineReferenceId Determination Action

    var original = txn.line.parent.id;
    var result = "";
    if (txn.line.parent.id != txn.id) {
      for (var i = 0; i < original.length; i++) {
        if (original.charAt(i) !== "-") {
            result += original.charAt(i);
          }
      }
    }
    return result;

The rule should be configured as follows, with two determination actions to handle txn.line.custom.lineReferenceId and txn.line.custom.parentLineReferenceId:

Add Connection

The screenshot below shows the external connection as "Salesforce" in the POST integration.

If you want to create a new connection, see the "Creating a Connection" section in [ServiceNow Quote Experience Integrations](https://servicenow-prod.fluidtopics.net/tBzEdZNwazp3uQm5SWA28g "Use integrations to exchange data with third-party sources, including Salesforce.").

To POST data back to Salesforce, you need the Salesforce transaction record ID. If you have not yet set up the GET integration to fetch the transaction ID, see [ServiceNow Quote Experience Integration - GET](https://servicenow-prod.fluidtopics.net/96r0a71Pe3wMBhHOz2oMpQ "Learn how to access data from a third-party application such as Salesforce by using the GET integration.").

## Add integration {#transaction-manager-integration-post__Add-Integration}

1. Navigate to the Integrations section and create a new integration.
   * HTTP Method: POST
   * Additional Path:/services/data/vXX.X/composite/graph, where vXX.X is the latest composite graph version. You can check for the latest version [here](https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_graph.htm).
   * Line Item Details to Include: Selected Lines
   * Connection: Salesforce

   {#transaction-manager-integration-post__ul_q53_qhd_hhc}
2. In the Request Transformation section, add this sample transaction JSON (header and line-level fields may vary according to your preference):

{#transaction-manager-integration-post__ol_p53_qhd_hhc}

    {
      "graphs": [
        {
          "graphId": "graph0",
          "compositeRequest": [
            {
              "method": "PATCH",
              "url" : "/services/data/v61.0/sobjects/LGK__Transaction__c/LGK__TransactionUUID__c/{{txn.id}}",
              "referenceId": "parentTransaction",
              "body": {
                "LGK__Stage__c": "{{txn.stage}}",
                "LGK__NetTotal__c": "{{txn.pricing.total}}"
              }
            }
            {{#if lines}}
    				{{~#each lines~}}
    				{{#if txn.line.product.partnerId}}
    				,
            {
              "method": "PATCH",
              "url": "/services/data/v61.0/sobjects/LGK__TransactionLine__c/LGK__TransactionLineId__c/{{txn.line.id}}",
              "referenceId": "line_{{txn.line.custom.lineReferenceId}}",
              "body": {
                "LGK__TransactionId__c": "@{parentTransaction.id}",
                "LGK__ParentTransactionLineId__c": {{#if txn.line.custom.parentLineReferenceId}}"@{line_{{txn.line.custom.parentLineReferenceId}}.id}"{{else}}null{{/if}},
                "LGK__Product2Id__c": "{{txn.line.product.partnerId}}",
                "LGK__Quantity__c": "{{txn.line.quantity}}",
                "LGK__ListPrice__c": "{{txn.line.pricing.list}}",
                "LGK__NetPrice__c": "{{txn.line.pricing.net}}",
                "LGK__NetTotal__c": "{{txn.line.pricing.extendedNet}}"
              }
            }
            {{/if}}
    		{{/each}}
    		{{/if}}
          ]
        }
      ]
    }

This transformation template is added to the Transformation Template area of the Request Transformation section as follows:


For more information about Handlebar syntax, see [ServiceNow Quote Experience Integrations - Handlebars syntax](https://servicenow-prod.fluidtopics.net/oyP4ya8nUuBjpXHkfmg86A "You can use the Handlebars templating language when you build an integration transformation template.").

## Debugging the POST call {#transaction-manager-integration-post__Debugging-the-POST-Call}

To use the Integration Admin interface to debug a POST call that is not working as expected, follow these steps:

1. Copy the transaction ID for which the integration is not working, paste it in the small Transaction ID box, and then click Fetch JSON.

   The application populates the Sample Transaction JSON box.

2. Click Run Transformation. This processes the transaction information contained in the Sample Transaction JSON input through the transformation logic and generates a result that you can test using Postman.

   For more information about setting up Postman to interface with your Salesforce org, see [Connect Postman to Salesforce](https://quickstarts.postman.com/guide/connect-postman-to-salesforce/index.html).


{#transaction-manager-integration-post__ol_u53_qhd_hhc}
**Related concepts**   

* [ServiceNow Quote Experience Integration - GET](https://servicenow-prod.fluidtopics.net/96r0a71Pe3wMBhHOz2oMpQ "Learn how to access data from a third-party application such as Salesforce by using the GET integration.")

