Pricefx REST API Reference
- List Elements
The Pricefx Backend API
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 } }
Request
Executes a logic that is assigned to the given product (specified by sku or typedId) and calculates the result. The result content is defined partially by the visibility flags that are part of the logic master data.
- Mock serverhttps://api.pricefx.com/_mock/openapi/reference/pricefx-server_openapi/formulamanager.execute/{sku}
- URL:https://companynode.pricefx.com/pricefx/companypartition/formulamanager.execute/{sku}
- 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.execute/{sku}' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"priority": "high",
"quantity": 14,
"map": {
"key": "value"
}
}
}'{ "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