Update Rule
curl --request PATCH \
--url https://api.paygentic.io/v0/sourceRules/{ruleId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"conditions": [
{
"value": "<string>"
}
],
"description": "<string>",
"enabled": true,
"name": "<string>",
"order": 123
}
'import requests
url = "https://api.paygentic.io/v0/sourceRules/{ruleId}"
payload = {
"conditions": [{ "value": "<string>" }],
"description": "<string>",
"enabled": True,
"name": "<string>",
"order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: [{value: '<string>'}],
description: '<string>',
enabled: true,
name: '<string>',
order: 123
})
};
fetch('https://api.paygentic.io/v0/sourceRules/{ruleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/sourceRules/{ruleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
[
'value' => '<string>'
]
],
'description' => '<string>',
'enabled' => true,
'name' => '<string>',
'order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/sourceRules/{ruleId}"
payload := strings.NewReader("{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paygentic.io/v0/sourceRules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/sourceRules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Sources
Update Rule
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": [
{
"value": "<string>"
}
],
"description": "<string>",
"enabled": true,
"name": "<string>",
"order": 123
}
'import requests
url = "https://api.paygentic.io/v0/sourceRules/{ruleId}"
payload = {
"conditions": [{ "value": "<string>" }],
"description": "<string>",
"enabled": True,
"name": "<string>",
"order": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
conditions: [{value: '<string>'}],
description: '<string>',
enabled: true,
name: '<string>',
order: 123
})
};
fetch('https://api.paygentic.io/v0/sourceRules/{ruleId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.paygentic.io/v0/sourceRules/{ruleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'conditions' => [
[
'value' => '<string>'
]
],
'description' => '<string>',
'enabled' => true,
'name' => '<string>',
'order' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.paygentic.io/v0/sourceRules/{ruleId}"
payload := strings.NewReader("{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.paygentic.io/v0/sourceRules/{ruleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paygentic.io/v0/sourceRules/{ruleId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"conditions\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"description\": \"<string>\",\n \"enabled\": true,\n \"name\": \"<string>\",\n \"order\": 123\n}"
response = http.request(request)
puts response.read_body{
"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"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}{
"message": "The requested resource was not found",
"error": "not_found"
}Body
application/json
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.
Was this page helpful?