Search…
SDK and Frameworks
Business Intelligence
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

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

Example request

1
{
2
"data": {
3
"package": {
4
"tariff": "basic",
5
"distance": 82
6
}
7
}
8
}
Copied!

Example of simple solve

Rule

Simple request

1
{
2
"client": {
3
"age": 18
4
},
5
"productCount": {
6
"accountsAndCards": 4,
7
"Investments": 4
8
},
9
"portfolioAmount": 15000
10
}
Copied!

Simple response

1
[
2
{
3
"totalProducts": 8,
4
"amountPerProduct": 1875,
5
"client": {
6
"segment": "senior affluent"
7
},
8
"profitability": 1
9
}
10
]
Copied!

Example of bulk (array) solve

Rule

Bulk request

1
[
2
{
3
"product": {
4
"id": "P1",
5
"price": 400
6
},
7
"paymentMethod": {
8
"debitCard": true,
9
"creditCard": false,
10
"cash": {}
11
}
12
},
13
{
14
"product": {
15
"id": "P2",
16
"price": 300
17
},
18
"paymentMethod": {
19
"debitCard": true,
20
"creditCard": {},
21
"cash": {}
22
}
23
}
24
]
Copied!

Bulk response

1
[
2
[
3
{
4
"suplier": "Amazon",
5
"amount": 400
6
}
7
],
8
[
9
{
10
"suplier": "Lenovo",
11
"amount": 300
12
}
13
]
14
]
Copied!