Get Started with Revenue Management Developer Resources
Revenue Management Settings
Run Salesforce Headless Pricing Action
Run Salesforce Pricing Action
Previous Versions
Invoke the Pricing Connect API by providing the pricing data and details of a context, pricing procedure, and price waterfall.
This action is available in API version 60.0 and later.
The Run Salesforce Headless Pricing action is available in Enterprise, Unlimited, and Developer Editions where Salesforce Pricing is enabled.
URI: /services/data/vXX.X/actions/standard/runSalesforceHeadlessPricing
Where XX.X is the latest API version.
Formats: JSON, XML
HTTP Methods: POST
Authentication: Authorization: Bearer TOKEN
Where TOKEN is a variable.
| Input | Type | Description |
|---|---|---|
contextDefinitionId | string | Required. ID of the context definition record that’s used to build the pricing data. |
contextMappingId | string | Required. ID of the context-mapping record that identifies which Salesforce object and mappings to use to build the pricing data. |
discoveryProcedure | string | Name of the discovery procedure that’s used to execute the discovery process. |
displayContext | boolean | Indicates whether to display the context structure for pricing (true) or not (false). |
effectiveDate | string | Date when the pricing rules, as specified in the pricing procedure, are applied. The effectiveDate parameter determines which pricing procedure to execute when multiple active versions of pricing procedures are available with different date ranges. |
isHighVolumeLineItems | boolean | Indicates whether the pricing API returns pricing details for more than 100 line items (true) or not (false). |
isSkipWaterfall | boolean | Indicates whether to generate the price waterfall data (true) or not (false). |
persistContext | boolean | Indicates whether to store the context (true) or not (false). If set to true, the user must have edit access to all sObject fields used in the context mapping. |
pricingData | string | Required. JSON data that’s used to build the pricing data. The JSON must be escaped. If you’re using this data within a Flow, then the JSON data must not be escaped. Also, make sure that the businessObjectType value within the pricingData property node is set to the sObject used in the context mappings. |
pricingProcedureId | string | Required. ID or API name of the pricing procedure used for calculating the prices. A pricing procedure is represented as an Expression Set Definition in the system. If you’re an Experience Cloud user, specify the name of the pricing procedure. |
skipDiscovery | boolean | Indicates whether to skip executing the discovery procedure (true) or not (false). |
taggedData | boolean | Indicates whether the associated context node contains a key (true) or not (false). |
useSessionScopedContext | boolean | Indicates whether to store the context in a session (true) or a request (false). |
| Output | Type | Description |
|---|---|---|
contextDetails | string | Context structure for pricing that’s generated when the displayContext parameter is set to true. |
executionId | string | ID of the executed pricing data. |
pricingProcessErrors | string | Errors that are generated due to context tags in a pricing process. |
pricingProcessStatus | string | Status of the pricing process, which is executed as an API call. |
pricingResult | string | Outcome of the executed pricing process that’s based on the output tags defined in the associated context definition. |
POST
This sample request is for the Run Salesforce Headless Pricing action.
1{
2 "inputs": [
3 {
4 "contextMappingId": "11jSB000002Bn13YAC",
5 "contextDefinitionId": "11OSB0000000WSv2AM",
6 "pricingProcedureId": "9QLSB0000001lT74AI",
7 "discoveryProcedure": "ES1",
8 "displayContext": true,
9 "effectiveDate": "2023-11-16T12:20:00.000Z",
10 "isHighVolumeLineItems": true,
11 "skipDiscovery": true,
12 "taggedData": false,
13 "pricingData": "{\"SalesTransaction\":{\"businessObjectType\":\"SalesTransaction\",\"Pricebook\":\"01sDE0000000LoeYAE\",\"CurrencyIsoCode\":\"USD\",\"SalesTransactionItem\":[{\"businessObjectType\":\"SalesTransactionItem\",\"Product\":\"01tDE000000FU99YAG\",\"ProductSellingModel\":\"0jPDE000000042K2AQ\",\"Quantity\":5,\"StartDate\":\"2023-11-16T12:20:00.000Z\",\"SalesTransactionItemSource\":\"LINE_ITEM1\"}]}}",
14 "isSkipWaterfall": false,
15 "persistContext": true,
16 "useSessionScopedContext": false
17 }
18 ]
19}This sample response is for the Run Salesforce Headless Pricing action.
1{
2 "actionName": "runSalesforceHeadlessPricing",
3 "errors": null,
4 "isSuccess": true,
5 "outputValues": {
6 "contextDetails": {
7 "SalesTransaction": [
8 {
9 "PriceBooks": "01sxx0000005q3VAAQ",
10 "Subtotal": 587.2095,
11 "PriceAdjustmentSchedule": "84Xxx0000004CMxEAM",
12 "EffectiveDate": "2024-02-12T00:00:00.000Z",
13 "SalesTransactionItem": [
14 {
15 "LineItemQuantity": 5,
16 "ProductSellingModel": "0jPxx000000009hEAA",
17 "DerivedPricingAttribute": false,
18 "Product": "01txx0000006iLwAAI",
19 "LineItem": "LineItem1",
20 "NetUnitPrice": 117.4419,
21 "SalesTrxnAdjustmentGroup": [
22 {
23 "AdjustmentType": "Percentage",
24 "AdjustmentValue": 10
25 }
26 ]
27 }
28 ]
29 }
30 ]
31 },
32 "executionId": "1708488641379821",
33 "pricingProcessStatus": "Completed",
34 "pricingResult": {
35 "StartDate": [
36 {
37 "value": 1700137200000,
38 "dataPath": [
39 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
40 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
41 ],
42 "errors": [],
43 "isSuccess": true
44 }
45 ],
46 "NetUnitPrice": [
47 {
48 "value": 115,
49 "dataPath": [
50 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
51 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
52 ],
53 "errors": [],
54 "isSuccess": true
55 }
56 ],
57 "ProductSellingModel": [
58 {
59 "value": "0jPDE000000042K2AQ",
60 "dataPath": [
61 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
62 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
63 ],
64 "errors": [],
65 "isSuccess": true
66 }
67 ],
68 "Pricebook": [
69 {
70 "value": "01sDE0000000LoeYAE",
71 "dataPath": [
72 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5"
73 ],
74 "errors": [],
75 "isSuccess": true
76 }
77 ],
78 "NetTotalPrice": [
79 {
80 "value": 1150,
81 "dataPath": [
82 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
83 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
84 ],
85 "errors": [],
86 "isSuccess": true
87 }
88 ],
89 "Subtotal": [
90 {
91 "value": 1150,
92 "dataPath": [
93 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5"
94 ],
95 "errors": [],
96 "isSuccess": true
97 }
98 ],
99 "Quantity": [
100 {
101 "value": 10,
102 "dataPath": [
103 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
104 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
105 ],
106 "errors": [],
107 "isSuccess": true
108 }
109 ],
110 "Product": [
111 {
112 "value": "01tDE000000FU99YAG",
113 "dataPath": [
114 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5",
115 "CTX_d3b9ffd5-2be7-4366-92d8-c2bcf03b69ed"
116 ],
117 "errors": [],
118 "isSuccess": true
119 }
120 ],
121 "CurrencyIsoCode": [
122 {
123 "value": "USD",
124 "dataPath": [
125 "CTX_ece1667e-7a09-40ab-9718-23bdc179a0a5"
126 ],
127 "errors": [],
128 "isSuccess": true
129 }
130 ]
131 }
132 },
133 "version": 1
134}