Skip to main content
POST
/
sourceRules
Create a new source rule
curl --request POST \
  --url https://api.paygentic.io/v0/sourceRules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "sourceId": "<string>",
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "conditions": [
    {
      "type": "date",
      "operator": "equals",
      "value": "<string>"
    }
  ],
  "order": 0
}'
{
  "id": "<string>",
  "sourceId": "<string>",
  "name": "<string>",
  "description": "<string>",
  "enabled": true,
  "conditions": [
    {
      "type": "date",
      "operator": "equals",
      "value": "<string>"
    }
  ],
  "order": 123,
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "lastEvaluatedAt": "2023-11-07T05:31:56Z",
  "evaluationCount": 123,
  "matchCount": 123
}

Authorizations

Authorization
string
header
required

API key authentication

Body

application/json
sourceId
string
required

Unique identifier for a source

name
string
required

Human-readable name for the source rule

conditions
object[]
required

Conditions that must ALL be met (AND logic) for auto-acceptance. For example, customerEmail domain='@trusted.com' AND amount lessThan=1000

Required array length: 1 - 10 elements
description
string

Detailed description of what this source rule does

enabled
boolean
default:true

Whether this rule should be active immediately

order
integer
default:0

Evaluation priority (0-999). Lower numbers are evaluated first. First matching rule triggers auto-acceptance.

Required range: x >= 0

Response

Rule created

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

Unique identifier for the rule

sourceId
string

ID of the source this rule belongs to

name
string

Human-readable name for the source rule

description
string

Detailed description of what this source rule does

enabled
boolean

Whether this rule is currently active

conditions
object[]

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

order
integer

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

createdAt
string<date-time>

When the rule was created

updatedAt
string<date-time>

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

evaluationCount
integer

Total number of times this rule has been evaluated

matchCount
integer

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