Pular para o conteúdo principal
POST
/
v1
/
config
/
contexts
/
{contextId}
/
fee-rules
Create a fee rule
curl --request POST \
  --url https://matcher.sandbox.lerian.net/v1/config/contexts/{contextId}/fee-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "feeScheduleId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "BB Right-Side Rule",
  "side": "RIGHT",
  "priority": 0,
  "predicates": [
    {
      "field": "institution",
      "operator": "EQUALS",
      "value": "Banco do Brasil",
      "values": [
        "<string>"
      ]
    }
  ]
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "contextId": "550e8400-e29b-41d4-a716-446655440000",
  "feeScheduleId": "550e8400-e29b-41d4-a716-446655440000",
  "name": "BB Right-Side Rule",
  "side": "RIGHT",
  "priority": 0,
  "predicates": [
    {
      "field": "institution",
      "operator": "EQUALS",
      "value": "Banco do Brasil",
      "values": [
        "<string>"
      ]
    }
  ],
  "createdAt": "2025-01-15T10:30:00Z",
  "updatedAt": "2025-01-15T10:30:00Z"
}

Autorizações

Authorization
string
header
obrigatório

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

Cabeçalhos

X-Request-Id
string

A unique identifier for tracing the request across services.

X-Idempotency-Key
string

Optional idempotency key for safe retries. Also accepts Idempotency-Key as an alternative header name. If the same key is sent again and the original request was already processed, the cached response is returned with X-Idempotency-Replayed: true.

See Retries and idempotency for details.

Parâmetros de caminho

contextId
string<uuid>
obrigatório

The unique identifier of the reconciliation context.

Corpo

application/json

Fee rule creation payload

Request payload for creating a fee rule

feeScheduleId
string
obrigatório

The fee schedule to apply when this rule matches

Exemplo:

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

name
string
obrigatório

Display name for the fee rule

Required string length: 1 - 100
Exemplo:

"BB Right-Side Rule"

side
enum<string>
obrigatório

Which transaction side this rule applies to

Opções disponíveis:
LEFT,
RIGHT,
ANY
Exemplo:

"RIGHT"

priority
integer

Evaluation priority (must be unique within the context; LEFT, RIGHT, and ANY rules share the same priority space)

Intervalo obrigatório: x >= 0
Exemplo:

0

predicates
object[]

Conditions that must all match for this rule to apply

Maximum array length: 50

Resposta

Successfully created fee rule.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See Retries and idempotency for more details.

A fee rule that maps transaction metadata to a fee schedule within a reconciliation context

id
string<uuid>

Unique identifier for the fee rule

Exemplo:

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

contextId
string<uuid>

Reconciliation context this rule belongs to

Exemplo:

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

feeScheduleId
string<uuid>

Fee schedule applied when this rule matches

Exemplo:

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

name
string

Display name for the fee rule

Exemplo:

"BB Right-Side Rule"

side
enum<string>

Which transaction side this rule applies to

Opções disponíveis:
LEFT,
RIGHT,
ANY
Exemplo:

"RIGHT"

priority
integer

Evaluation priority (lower numbers are evaluated first; LEFT, RIGHT, and ANY rules share the same priority space)

Exemplo:

0

predicates
object[]

Conditions that must all match for this rule to apply

createdAt
string<date-time>

Creation timestamp in RFC 3339 format

Exemplo:

"2025-01-15T10:30:00Z"

updatedAt
string<date-time>

Last update timestamp in RFC 3339 format

Exemplo:

"2025-01-15T10:30:00Z"