Search…
SDK and Frameworks
Rule Solver API
Request and response from API solving.

Solve Rule

This endpoint allows you to solve your rules according to input JSON data.
post
https://api.decisionrules.io
/rule/solve/:ruleId/:version
Solve Rule

Request example

URL
https://api.decisionrules.io/rule/solve/:ruleId/:version
Headers:
Content-Type: application/json
Authorization: Bearer DOZpz-h6xnOrKGIINlYvkd9hn41pRR3oG6cqH
This API Key. Generate your own here
{
"data": {
// INPUT OBJECT
}
}

Example request

{
"data": {
"package": {
"tariff": "basic",
"distance": 82
}
}
}

Example of simple solve

Rule

Simple request

{
"client": {
"age": 18
},
"productCount": {
"accountsAndCards": 4,
"Investments": 4
},
"portfolioAmount": 15000
}

Simple response

[
{
"totalProducts": 8,
"amountPerProduct": 1875,
"client": {
"segment": "senior affluent"
},
"profitability": 1
}
]

Example of bulk (array) solve

Rule

Bulk request

[
{
"product": {
"id": "P1",
"price": 400
},
"paymentMethod": {
"debitCard": true,
"creditCard": false,
"cash": {}
}
},
{
"product": {
"id": "P2",
"price": 300
},
"paymentMethod": {
"debitCard": true,
"creditCard": {},
"cash": {}
}
}
]

Bulk response

[
[
{
"suplier": "Amazon",
"amount": 400
}
],
[
{
"suplier": "Lenovo",
"amount": 300
}
]
]
Copy link
On this page
Solve Rule
post
Solve Rule
Example of simple solve
Example of bulk (array) solve