Skip to main content
PATCH
/
v0
/
sourceRules
/
{ruleId}
Update Rule
curl --request PATCH \
  --url https://api.paygentic.io/v0/sourceRules/{ruleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "conditions": [
    {
      "operator": "equals",
      "type": "date",
      "value": "<string>"
    }
  ],
  "description": "<string>",
  "enabled": true,
  "name": "<string>",
  "order": 123
}
'
{
  "id": "rule_901234",
  "conditions": [
    {
      "operator": "lessThan",
      "type": "amount",
      "value": 100
    }
  ],
  "createdAt": "2024-03-05T12:00:00Z",
  "createdBy": "usr_merchant",
  "description": "Automatically approve events with amount less than $100",
  "enabled": false,
  "evaluationCount": 50,
  "lastEvaluatedAt": "2024-03-10T15:00:00Z",
  "matchCount": 10,
  "name": "Auto-approve small amounts",
  "order": 1,
  "sourceId": "src_x3y4z5a6b7c8d9e0",
  "updatedAt": "2024-03-10T16:00:00Z"
}

Authorizations

Authorization
string
header
required

API key authentication

Path Parameters

ruleId
string
required

Body

application/json
conditions
object[]

List of conditions that must ALL be met (AND logic)

description
string

Detailed description of what this source rule does

enabled
boolean

Whether this rule should be active

name
string

Human-readable name for the source rule

order
integer

Priority order for rule evaluation (lower numbers are evaluated first)

Response

Rule updated

An auto-acceptance rule that automatically approves source events matching specified conditions. Rules help automate the approval process for trusted customers or specific transaction patterns.

id
string
required

Unique identifier for the rule

conditions
object[]
required

List of conditions that must ALL be met (AND logic)

createdAt
string<date-time>
required

When the rule was created

description
string
required

Detailed description of what this source rule does

enabled
boolean
required

Whether this rule is currently active

evaluationCount
integer
required

Total number of times this rule has been evaluated

matchCount
integer
required

Number of times this rule has matched and auto-accepted an invoice

name
string
required

Human-readable name for the source rule

order
integer
required

Priority order for rule evaluation (lower numbers are evaluated first)

sourceId
string
required

ID of the source this rule belongs to

updatedAt
string<date-time>
required

When the rule was last updated

createdBy
string | null

User ID who created the rule

lastEvaluatedAt
string<date-time> | null

Last time this rule was evaluated against an invoice