# Logics ## Execute an Assigned Logic - [POST /formulamanager.execute/{sku}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/products/post-formulamanager.execute-sku.md): 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. ## Execute a Logic - [POST /formulamanager.execute/{sku}/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/products/post-formulamanager.execute-sku-uniquename.md): Executes a logic (specified by uniqueName) 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. ## Get a Logic - [POST /formulamanager.fetch/{id}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.fetch-id.md): Returns full details of the logic, including all sub-elements. > Information: > The id is the typedId without the F suffix. For example, the id attribute of the logic with typedId = 2147484823.F is 2147484823. --- Required Permission| Roles with the Required Permission | ---------|----------| PRICINGFORMULA_FETCH | Administer Policy Records (PO_MODELRECORDS_ADMIN), Manage PA Calculation Logics (PA_FORMULAS), Manage Contracts Calculation Logics (CM_FORMULAS), Manage Rebate Agreement Templates (RM_RAT), Administer PriceOptimizer (PO_MANAGER), Investigate for Support (SUPPORT), Administer Plasma (PLASMA), Manage PromotionManager (CM_CONTRACTMANAGER), Administer RebateManager (RM_REBATEMANAGER), Administer QuoteConfigurator (PRICESHOP_QUOTEADMIN), Manage Calculation Logics (PB_FORMULAS), Manage Claims (CLM_CLAIMMANAGER), Manage Rebate Calculation Logics (RM_FORMULAS) ## Get a Default Pricing Logic Name - [POST /formulamanager.getdefault](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.getdefault.md): Retrieves uniqueName of the default pricing logic. ## Set a Default Pricing Logic - [POST /formulamanager.setdefault/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.setdefault-uniquename.md): Sets the default pricing logic. To clear the default pricing logic, use /formulamanager.setdefault without the uniqueName path parameter. ## Update a Logic - [POST /formulamanager.update/{id}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.update-logicid.md): Updates the given logic. >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}/compileOnly) for optimal performance. ## Update a Logic (Partial) - [POST /formulamanager.update/{id}/incremental](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.update-id-incremental.md): 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. ## Update a Logic (No syntax check) - [POST /formulamanager.update/{id}/compileOnly](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.update-logicid-compileonly.md): 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. ## List Elements - [POST /formulamanager.getelementnames/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.getelementnames-uniquename.md): Returns all logic element names and labels, except elements where the Display Mode (displayOptions) is set to Never. ## Execute an Assigned Logic - [POST /formulamanager.execute/{sku}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.execute-sku.md): 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. ## Execute a Logic - [POST /formulamanager.execute/{sku}/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.execute-sku-uniquename.md): Executes a logic (specified by uniqueName) 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. ## Delete a Logic - [POST /formulamanager.delete/{id}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.delete-id.md): Deletes a logic, including all elements. ## List Logics - [POST /formulamanager.getnames](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.getnames.md): Retrieves a list (uniqueName and label) of all logics in the partition you are currently authenticated for. ## Generate Parameters - [POST /formulamanager.testparams](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.testparams.md): Retrieves a list of parameters and their Nature for a given formula. ## Syntax Check - [POST /formulamanager.check](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.check.md): Checks syntax for the provided logic fragment. As logic fragments (i.e. calculation schema entries or logic elements) can also reference previous logic element results, the parameter knownElements is available to declare a number of “names” as valid for the purpose of the syntax check. ## List Logic Parameters (Input Fields) - [POST /formulamanager.params/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.params-uniquename.md): Retrieves a list of parameters (input fields) and their properties for the specified logic. ## List Libraries - [POST /formulamanager.libraries](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.libraries.md): Retrieves active Groovy libraries, including elements and functions. ## Execute a Logic (Without a Context) - [POST /formulamanager.executeformula/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.executeformula-uniquename.md): Executes a logic and returns results. Use the output=rawjson parameter in the URL, for example /formulamanager.executeformula/QuoteLogic?output=rawjson in order to return the result in the simple JSON format as "resultName":result. ## Execute a Logic Without a Context in a Service - [POST /formulamanager.executeformulaservice/{uniqueName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.executeformulaservice-uniquename.md): Executes a logic and returns results. The main difference between this command and the executeformula command is, that in this formulamanager.executeformulaservice command, the logic context is preserved and reused. This allows the formula to build and maintain a cache, as elements like api.global persist between calls. Each thread operates with its own formula context and api.global instance. The system maintains a fixed number of service threads, with a predefined lifespan for each. Parallel API requests are queued and executed on these threads in sequence. If a request cannot be processed within a short timeframe, it will fail. For this reason, it is crucial that subsequent requests execute efficiently, leveraging caching whenever possible. Be aware that during long cache warm-up periods (e.g., when new threads are initialized), there is a higher risk of request failures. Use the output=rawjson parameter in the URL, for example /formulamanager.executeformula/QuoteLogic?output=rawjson in order to return the result in the simple JSON format as "resultName":result. ## Execute a Logic (Read-Only) - [POST /formulamanager.executeformula/{uniqueName}/readonly](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.executeformula-uniquename-readonly.md): Executes the formula with disabled object modification capabilities. Use the output=rawjson parameter in the URL, for example /formulamanager.executeformula/QuoteLogic?output=rawjson in order to return the result in the simple JSON format as "resultName":result. ## Execute a Logic Without a Context in a Service (Read-Only) - [POST /formulamanager.executeformulaservice/{uniqueName}/readonly](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.executeformulaservice-uniquename-readonly.md): Executes the logic without an explicit product context in a service with disabled object modification capabilities. Use the output=rawjson parameter in the URL, for example /formulamanager.executeformulaservice/QuoteLogic?output=rawjson in order to return the result in the simple JSON format as "resultName":result. ## Copy a Logic - [POST /formulamanager.copy/{id}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.copy-id).md): Creates a copy of the specified logic. The validAfter value is set to today's date, all other values and sub-elements are exact copies. ## List Functions - [POST /formulamanager.librarymethods](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.librarymethods.md): Retrieves a list of functions in an active Groovy library. ## Test a Logic - [POST /formulamanager.testexec](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.testexec.md): Executes a draft logic for a given approvable and calculates the result. This command is used to test a logic during editing (the "Test Logic" button in IntelliJ Pricefx Studio). The backend will compile and execute the test logic (specified in the testFormula property) without persisting it in the database. ## Execute Library Function - [POST /formulamanager.executelibraryfunction/{formulaName}/{elementName}/{functionName}](https://api.pricefx.com/openapi/reference/pricefx-server_openapi/logics/post-formulamanager.executelibraryfunction.md): Executes a specific function from a formula library element without requiring a full formula logic implementation. Parameters are provided via the request payload and the calculated result is returned. >Note: >- This endpoint does not work with inputs bindings. Provide ordered function arguments instead. >- Used by the Pricefx MCP server to enable Groovy-configured MCP Tools. >- Requires the PRICINGFORMULA_EXECUTE permission.