Skip to main content
POST
/
v1
/
matching
/
simulate
Simulate a match rule against a context (read-only dry run)
curl --request POST \
  --url https://matcher.sandbox.lerian.net/v1/matching/simulate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "contextId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "ruleId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sampleLimit": 25
}
'
{
  "matchedGroups": 1,
  "ruleType": "<string>",
  "sample": [
    {
      "amountDelta": "<string>",
      "dateDeltaDays": 123,
      "left": {
        "amount": "<string>",
        "currency": "<string>",
        "date": "<string>",
        "id": "<string>",
        "sourceId": "<string>",
        "baseAmount": "<string>",
        "externalId": "<string>"
      },
      "right": {
        "amount": "<string>",
        "currency": "<string>",
        "date": "<string>",
        "id": "<string>",
        "sourceId": "<string>",
        "baseAmount": "<string>",
        "externalId": "<string>"
      },
      "score": 50,
      "why": {
        "amountMatch": true,
        "currencyMatch": true,
        "dateMatch": true,
        "referenceScore": 0.5,
        "matchedKeys": [
          {
            "agreed": true,
            "field": "<string>"
          }
        ]
      }
    }
  ],
  "sampleTruncated": true,
  "unmatchedLeft": 1,
  "unmatchedRight": 1,
  "ruleId": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Body

application/json
contextId
string<uuid>
required

Context ID whose transactions the rule is simulated against

rule
object

Inline candidate rule to preview. Provide this OR ruleId, not both.

ruleId
string<uuid>

Identifier of an existing configured rule to preview. Provide this OR rule, not both.

sampleLimit
integer<int64>
default:25

Maximum number of would-match pairs to return in the sample

Required range: 1 <= x <= 200

Response

OK

matchedGroups
integer<int64>
required

Number of 1:1 groups the rule would form across the context

Required range: x >= 0
Example:

12

ruleType
string
required

Strategy of the previewed rule

Example:

"EXACT"

sample
object[] | null
required

Bounded sample of would-match pairs (highest score first)

Maximum array length: 200
sampleTruncated
boolean
required

Whether matchedGroups exceeds the returned sample length

Example:

false

unmatchedLeft
integer<int64>
required

Left-side transactions that would remain unmatched

Required range: x >= 0
Example:

3

unmatchedRight
integer<int64>
required

Right-side transactions that would remain unmatched

Required range: x >= 0
Example:

5

ruleId
string

Identifier of the previewed rule. Empty for an inline candidate rule (not persisted).

Example:

"550e8400-e29b-41d4-a716-446655440000"