Pricefx REST API Reference
- Update a Logic (No syntax check)
The Pricefx Backend API
Request
Performs a partial update of the specified logic. Recompiles only those logic elements whose formulaExpression has been changed.
Information: If changes in the code (in the particular Groovy code) of some elements are made, it is highly recommended to use the update endpoint with compileOnly (/formulamanager.update/{logicId}/incremental/compileOnly) for optimal performance.
- Mock serverhttps://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.update/{id}/incremental
- URL:https://companynode.pricefx.com/pricefx/companypartition/formulamanager.update/{id}/incremental
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.update/2147484837/incremental \
-H 'Content-Type: application/json' \
-d '{
"data": {
"version": 6,
"typedId": "2147484837.F",
"uniqueName": "PriceList",
"label": "Price List",
"validAfter": "2021-07-12",
"status": "ACTIVE",
"simulationSet": null,
"userGroupEdit": null,
"userGroupViewDetails": null,
"formulaNature": null,
"lastUpdateByName": "admin",
"elements": [
{
"version": 9,
"typedId": "2147494038.FE",
"elementName": "BasePrice",
"elementLabel": "Base Price",
"elementDescription": null,
"elementGroups": [],
"conditionElementName": null,
"hideWarnings": false,
"excludeFromExport": false,
"protectedExpression": false,
"elementTimeout": 0,
"displayOptions": 21,
"formatType": "MONEY_EUR",
"elementSuffix": null,
"allowOverride": false,
"summarize": false,
"hideOnNull": false,
"userGroup": null,
"cssProperties": null,
"resultGroup": null,
"combinationType": "FUNCTION",
"criticalAlert": null,
"redAlert": null,
"yellowAlert": null,
"labelTranslations": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696,
"formulaExpression": "def avgCost = api.productExtension(\"pcost\")?.find()?.attribute1\nif(avgCost == null){\n api.addWarning(\"Could not find Average Cost in PX table ProductCost\")\n}\nreturn avgCost"
},
{
"version": 9,
"typedId": "2147494043.FE",
"elementName": "ListPrice",
"elementLabel": "List Price",
"elementDescription": null,
"elementGroups": [],
"conditionElementName": null,
"hideWarnings": false,
"excludeFromExport": false,
"protectedExpression": false,
"elementTimeout": 0,
"displayOptions": 5,
"formatType": null,
"elementSuffix": null,
"allowOverride": false,
"summarize": false,
"hideOnNull": false,
"userGroup": null,
"cssProperties": null,
"resultGroup": null,
"combinationType": "FUNCTION",
"criticalAlert": null,
"redAlert": null,
"yellowAlert": null,
"labelTranslations": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696,
"formulaExpression": "def listPrice = out.BasePrice\n\n\nreturn listPrice"
}
],
"inputDescriptors": [],
"formulaType": "PRICING",
"createdByName": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696
}
}'{ "response": { "node": "node", "data": [ … ], "status": 0 } }
Request
Updates the given logic. Skips the syntax check. Groovy compilation errors will still surface, but regular syntax errors could go unnoticed. Use with care!
Information: Skipping the syntax check is useful for better performance when the logic does not contain any inputs. If the logic contains inputs, the syntax check is needed.
- Mock serverhttps://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.update/{id}/compileOnly
- URL:https://companynode.pricefx.com/pricefx/companypartition/formulamanager.update/{id}/compileOnly
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.update/2147484837/compileOnly \
-H 'Content-Type: application/json' \
-d '{
"data": {
"version": 6,
"typedId": "2147484837.F",
"uniqueName": "PriceList",
"label": "Price List",
"validAfter": "2021-07-12",
"status": "ACTIVE",
"simulationSet": null,
"userGroupEdit": null,
"userGroupViewDetails": null,
"formulaNature": null,
"lastUpdateByName": "admin",
"elements": [
{
"version": 9,
"typedId": "2147494038.FE",
"elementName": "BasePrice",
"elementLabel": "Base Price",
"elementDescription": null,
"elementGroups": [],
"conditionElementName": null,
"hideWarnings": false,
"excludeFromExport": false,
"protectedExpression": false,
"elementTimeout": 0,
"displayOptions": 21,
"formatType": "MONEY_EUR",
"elementSuffix": null,
"allowOverride": false,
"summarize": false,
"hideOnNull": false,
"userGroup": null,
"cssProperties": null,
"resultGroup": null,
"combinationType": "FUNCTION",
"criticalAlert": null,
"redAlert": null,
"yellowAlert": null,
"labelTranslations": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696,
"formulaExpression": "def avgCost = api.productExtension(\"pcost\")?.find()?.attribute1\nif(avgCost == null){\n api.addWarning(\"Could not find Average Cost in PX table ProductCost\")\n}\nreturn avgCost"
},
{
"version": 9,
"typedId": "2147494043.FE",
"elementName": "ListPrice",
"elementLabel": "List Price",
"elementDescription": null,
"elementGroups": [],
"conditionElementName": null,
"hideWarnings": false,
"excludeFromExport": false,
"protectedExpression": false,
"elementTimeout": 0,
"displayOptions": 5,
"formatType": null,
"elementSuffix": null,
"allowOverride": false,
"summarize": false,
"hideOnNull": false,
"userGroup": null,
"cssProperties": null,
"resultGroup": null,
"combinationType": "FUNCTION",
"criticalAlert": null,
"redAlert": null,
"yellowAlert": null,
"labelTranslations": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696,
"formulaExpression": "def listPrice = out.BasePrice\n\n\nreturn listPrice"
}
],
"inputDescriptors": [],
"formulaType": "PRICING",
"createdByName": null,
"createDate": "2021-11-04T14:56:11",
"createdBy": 2147490696,
"lastUpdateDate": "2021-11-04T18:16:42",
"lastUpdateBy": 2147490696
}
}'{ "response": { "node": "node", "data": [ … ], "status": 0 } }
- Mock serverhttps://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.getelementnames/{uniqueName}
- URL:https://companynode.pricefx.com/pricefx/companypartition/formulamanager.getelementnames/{uniqueName}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
'https://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.getelementnames/{uniqueName}'{ "response": { "node": "string", "data": {}, "status": 0 } }
See the Key-Value Database Storage Knowledge Base article for more details.
Here you can find all fields of the corresponding entity (represented by the type code).
Use the /metadata.describe endpoint to find out the correct data type of the field that is used in your partition.
Comments