Place Sales Transaction (POST)

Create a sales transaction, such as an order or a quote, with integrated pricing and configuration. Additionally, update an order or a quote, and insert and delete order or quote line items to calculate the estimated tax.

You can also group order or quote line items based on location, work types, or departments, if groups are enabled for your org. Groups provide a visualization of the products to view large quotes.

You can add up to 1000 quote line items for a quote, and 1000 order products for an order. For complex flows that involve a large volume of records, ensure that the number of line items that are sent to this API are within this limit.

Resource
/connect/rev/sales-transaction/actions/place
Resource example
https://yourInstance.salesforce.com/services/data/v64.0/connect/rev/sales-transaction/actions/place
Available version
63.0
HTTP methods
POST
Request body for POST
JSON example
This is a sample request to create a sales transaction for a quote.
{
  "pricingPref": "system", 
  "catalogRatesPref" "skip",
  "configurationPref": {
    "configurationMethod": "Skip",
    "configurationOptions": {
      "validateProductCatalog": true,
      "validateAmendRenewCancel": true,
      "executeConfigurationRules": true,
      "addDefaultConfiguration": true
    }
  },
  "contextDetails": {
    "contextId": "e055bb18-d4e8-41c3-881e-0132b9561708"
  },
  "graph": {
    "graphId": "createQuote",
    "records": [
      {
        "referenceId": "refQuote",
        "record": {
          "attributes": {
            "method": "POST",
            "type": "Quote"
          },
          "Name": "Quote_Acme",
          "Pricebook2Id": "01sDU000000JvhbYAC"
        }
      },
      {
        "referenceId": "refQuoteLine0",
        "record": {
          "attributes": {
            "type": "QuoteLineItem",
            "method": "POST"
          },
          "QuoteId": "@{refQuote.id}",
          "Product2Id": "01tDU000000F7b8YAC",
          "PricebookEntryId": "01uDU000000fxt2YAA",
          "UnitPrice": 100,
          "Quantity": "1",
          "StartDate": "2024-10-29",
          "EndDate": "2025-03-01",
          "PeriodBoundary": "Anniversary"
        }
      }
    ]
  }
}
This is a sample request to insert, update, or delete a quote line item.
{
  {
  "pricingPref": "system",
  "catalogRatesPref": "skip",
  "configurationPref": {
    "configurationMethod": "Skip",
    "configurationOptions": {
      "validateProductCatalog": true,
      "validateAmendRenewCancel": true,
      "executeConfigurationRules": true,
      "addDefaultConfiguration": true
    }
  },
  "contextDetails": {
    "contextId": "e055bb18-d4e8-41c3-881e-0132b9561708"
  },
  "graph": {
    "graphId": "updateQuote",
    "records": [
      {
        "referenceId": "refQuote",
        "record": {
          "attributes": {
            "method": "PATCH",
            "type": "Quote",
            "id": "801xx000003GZ9bAAG"
          }
        }
      },
      {
        "referenceId": "refQuoteLine0",
        "record": {
          "attributes": {
            "type": "QuoteLineItem",
            "method": "PATCH",
            "id": "402xx000003KY5vJGH"
          },
          "Quantity": "5"
        }
      }
    ]
  }
}
This is a sample request to define grouping of quote line items.
{
  "pricingPref": "Force",
  "catalogRatesPref" "skip",
  "configurationPref": {
    "configurationMethod": "Skip",
    "configurationOptions": {
      "validateProductCatalog": true,
      "validateAmendRenewCancel": true,
      "executeConfigurationRules": true,
      "addDefaultConfiguration": true
    }
  },
  "contextDetails": {
    "contextId": "e055bb18-d4e8-41c3-881e-0132b9561708"
  },
  "graph": {
    "graphId": "groupQuoteLines",
    "records": [
      {
        "referenceId": "refQuote",
        "record": {
          "attributes": {
            "method": "PATCH",
            "type": "Quote",
            "id": "801xx000003GZ9bAAG"
          }
        }
      },
      {
        "referenceId": "refQuoteLine0",
        "record": {
          "attributes": {
            "type": "QuoteLineItem",
            "method": "PATCH",
            "id": "402xx000003KY5vJGH"
          },
          "QuoteLineGroupId": "@{refQuote.id}"
        }
      }
    ]
  }
}
This is s a sample request for the initial grouping of the quote with all the quote lines assigned to the first group.
{
  "pricingPref": "Force",
  "catalogRatesPref" "skip",
  "graph": {
    "graphId": "groupQuote",
    "records": [
      {
        "referenceId": "refQuote",
        "record": {
          "attributes": {
            "type": "Quote",
            "method": "PATCH",
            "id": "0Q0xx0000004CAmCAM"
          }
        }
      },
      {
        "referenceId": "refQlg1",
        "record": {
          "attributes": {
            "type": "QuoteLineGroup",
            "method": "POST",
            "action": "GroupAll"
          },
          "Name": "From PST API Group",
          "QuoteId": "@{refQuote.id}"
        }
      }
    ]
  }
}
This is a sample request to ungroup a quote but retain the quote lines.
{
   "catalogRatesPref" "skip",
   "pricingPref": "Force",
   "graph": {
      "graphId": "ungroupQuote",
      "records": [
         {
            "referenceId": "refQuote", 
            "record": {
               "attributes": {
                  "type": "Quote",
                  "method": "PATCH",
                  "id":"0Q0xx0000004C99CAE"
               },
               "Name": "Grouped Quote with PST API"
            }
         },
         {
            "referenceId": "refQlg1",
            "record": {
               "attributes": {
                  "type": "QuoteLineGroup",
                  "method": "DELETE",
                  "id": "402xx000003KY5vJGH",
                  "action": "Ungroup"
               }
            }
         }
      ]
   }
}
This is a sample request to create a new group.
{
   "catalogRatesPref" "skip",
   "pricingPref": "Force",
   "graph": {
      "graphId": "createGroup",
      "records": [
         {
            "referenceId": "refQuote",
            "record": {
               "attributes": {
                  "type": "Quote",
                  "method": "PATCH",
                  "id":"0Q0xx0000004C99CAE"
               },
               "Name": "Grouped Quote with PST API"
            }
         },
         {
            "referenceId": "refQlg1",
            "record": {
               "attributes": {
                  "type": "QuoteLineGroup",
                  "method": "POST"
               },
               "Name": "From PQ API Group",
               "QuoteId": "@{refQuote.id}"
            }
         }
      ]
   }
}
This example shows a sample request to delete a group.
{
   "catalogRatesPref" "skip",
   "pricingPref": "Force",
   "graph": {
      "graphId": "deleteGroup",
      "records": [
         {
            "referenceId": "refQuote",
            "record": {
               "attributes": {
                  "type": "Quote",
                  "method": "PATCH",
                  "id":"0Q0xx0000004C99CAE"
               },
               "Name": "Grouped Quote with PST API"
            }
         },
         {
            "referenceId": "refQlg1",
            "record": {
               "attributes": {
                  "type": "QuoteLineGroup",
                  "method": "DELETE",
                  "id": "402xx000003KY5vJGH",
                  "action": "DeleteGroup"
               }
            }
         }
      ]
   }
}
This is a sample request to group order items based on criteria.
{
    "catalogRatesPref" "skip",
    "pricingPref": "Force",
    "graph": {
        "graphId": "groupOrderItems",
        "records": [
            {
                "referenceId": "refOrder",
                "record": {
                    "attributes": {
                        "type": "Order",
                        "method": "PATCH",
                        "id": "0Q0xx0000004C99CAE"
                    }
                }
            },
            {
                "referenceId": "refOlg1",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST",
                        "action": "GroupBy",
                        "criteria": {
                            "BillingFrequency2": null
                        }
                    },
                    "Name": "Billing Frequency: ",
                    "OrderId": "@{refOrder.id}"
                }
            },
            {
                "referenceId": "g1",
                "record": {
                    "attributes": {
                        "type": "OrderItemGroup",
                        "method": "POST",
                        "action": "GroupBy",
                        "criteria": {
                            "BillingFrequency2": "Monthly"
                        }
                    },
                    "Name": "Billing Frequency: Monthly",
                    "OrderId": "@{refOrder.id}"
                }
            }
        ]
    }
}
This is a sample request to save changes to a ramp deal by using context ID. The context ID is returned by the Ramp Deal APIs. See Create Ramp Deal (POST).
{
  "pricingPref": "force",
  "contextDetails": {
    "contextId": "f1c9e3e1c335f7959a88de09d3a867cc2b95e08709b99de8e2edeb8f5039e8ed",
    "scope": "Session"
  },
  "graph": {
    "graphId": "updateQuote",
    "records": [
      {
        "referenceId": "refQuote",
        "record": {
          "attributes": {
            "type": "Quote",
            "method": "PATCH",
            "id": "0Q0xx0000004DQ4CAM"
          }
        }
      }
    ]
  }
}
Properties
Name Type Description Required or Optional Available Version
catalogRates​Pref String Rate card entries defined in the catalog that must be fetched for sales items with usage-based pricing during the creation of the sales transaction. Valid values are:
  • Fetch—Retrieves the rate card entries defined in the catalog for sales items during the creation of the sales transaction.
  • Skip—Skips the retrieval of rate card entries for sales items during the creation of the sales transaction.

    The default value is Skip.

This property is available when the Usage-Based Selling feature is enabled.
Optional 63.0
configuration​Pref Configurator Preference Input Configuration preference during the quote process. These preferences ensure that quotes are defined as per the requirement. Optional 63.0
contextDetails Context Input Context details that are created for a sales transaction. Required if the graph property isn’t specified. 63.0
graph Object Graph Input

The sObject graph of the sales transaction to be ingested. You can perform create, update, or delete operations on objects from the Sales Transaction context definition by using this property. Additionally, perform create, update, or delete operations on custom objects and fields in your extended context definition.

To create custom objects that are at the grandchildren level from a line item, you must create the hierarchy of objects until the grandchild object in the same request.

Required if the contextDetails property isn’t specified. 63.0
pricingPref String Pricing preference during the creation of a sales transaction. Valid values are:
  • Force—Specifies to enforce pricing during the creation of sales transactions.
  • Skip—Specifies to skip pricing during the creation of sales transactions.
  • System—Specifies the system to determine whether a pricing calculation is required.

The default value is System.

Optional 63.0
Response body for POST
Place Sales Transaction