curl --request GET \
--url https://api.staging.payrails.io/merchant/rulesets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/rulesets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.payrails.io/merchant/rulesets', 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.staging.payrails.io/merchant/rulesets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.staging.payrails.io/merchant/rulesets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.staging.payrails.io/merchant/rulesets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/rulesets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"links": {
"self": "https://api.staging.payrails.io/merchant/rulesets?page[after]=qf7pnbyfrr&page[size]=2",
"prev": "https://api.staging.payrails.io/merchant/rulesets?page[before]=hbe66nh8i8&page[size]=2",
"next": "https://api.staging.payrails.io/merchant/rulesets?page[after]=xk2h55zsy5&page[size]=2",
"first": "https://api.staging.payrails.io/merchant/rulesets?page[size]=2",
"last": "https://api.staging.payrails.io/merchant/rulesets?page[before]=9wkueqcavq&page[size]=2"
},
"results": [
{
"id": "670e7a35-c282-469f-b77f-336b75bcbe55",
"version": 1,
"createdAt": "2022-11-02T12:27:22.73972022Z",
"trigger": {
"on": "determinePaymentOptions",
"filter": {
"paymentMethodCode": "card"
}
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"rules": [
{
"condition": {
"left": {
"field": "customer.country.code",
"operator": "IS ONE OF",
"value": [
"AR",
"CL"
]
},
"operator": "AND",
"right": {
"field": "clientContext.osType",
"operator": "=",
"value": "ios"
}
},
"action": {
"type": "setPriority",
"params": {
"priority": 1
}
}
},
{
"condition": {
"field": "clientContext.osType",
"operator": "=",
"value": "web"
},
"action": {
"type": "setPriority",
"params": {
"priority": 2
}
}
}
],
"defaultAction": {
"type": "skip"
}
},
{
"id": "1f3cb3c4-3d8d-4f3c-94ad-30a0a17fde6d",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"version": 1,
"createdAt": "2022-11-10T14:13:01.85472022Z",
"trigger": {
"on": "determineProviderOptions",
"filter": {
"providerConfigId": "5eb08624-ecce-4cbc-9a8a-61d484172815"
}
},
"defaultAction": {
"type": "setPriority",
"params": {
"priority": 1
}
}
},
{
"id": "0dcaf001-32a0-40ee-972c-523f5070e5e3",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"version": 1,
"createdAt": "2022-11-10T14:13:01.85472022Z",
"trigger": {
"on": "determineProviderOptions",
"filter": {
"workflowNode": "authorize",
"providerConfigId": "1f3cb3c4-3d8d-4f3c-94ad-30a0a17fde6d"
}
},
"rules": [
{
"condition": {
"field": "customer.country.code",
"operator": "=",
"value": "DE"
},
"action": {
"type": "setPriority",
"params": {
"priority": 3
}
}
}
],
"defaultAction": {
"type": "setPriority",
"params": {
"priority": 2
}
}
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}List Rulesets
Fetch a list of rulesets for the given query parameters.
curl --request GET \
--url https://api.staging.payrails.io/merchant/rulesets \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/rulesets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.staging.payrails.io/merchant/rulesets', 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.staging.payrails.io/merchant/rulesets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.staging.payrails.io/merchant/rulesets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.staging.payrails.io/merchant/rulesets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/rulesets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"links": {
"self": "https://api.staging.payrails.io/merchant/rulesets?page[after]=qf7pnbyfrr&page[size]=2",
"prev": "https://api.staging.payrails.io/merchant/rulesets?page[before]=hbe66nh8i8&page[size]=2",
"next": "https://api.staging.payrails.io/merchant/rulesets?page[after]=xk2h55zsy5&page[size]=2",
"first": "https://api.staging.payrails.io/merchant/rulesets?page[size]=2",
"last": "https://api.staging.payrails.io/merchant/rulesets?page[before]=9wkueqcavq&page[size]=2"
},
"results": [
{
"id": "670e7a35-c282-469f-b77f-336b75bcbe55",
"version": 1,
"createdAt": "2022-11-02T12:27:22.73972022Z",
"trigger": {
"on": "determinePaymentOptions",
"filter": {
"paymentMethodCode": "card"
}
},
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"rules": [
{
"condition": {
"left": {
"field": "customer.country.code",
"operator": "IS ONE OF",
"value": [
"AR",
"CL"
]
},
"operator": "AND",
"right": {
"field": "clientContext.osType",
"operator": "=",
"value": "ios"
}
},
"action": {
"type": "setPriority",
"params": {
"priority": 1
}
}
},
{
"condition": {
"field": "clientContext.osType",
"operator": "=",
"value": "web"
},
"action": {
"type": "setPriority",
"params": {
"priority": 2
}
}
}
],
"defaultAction": {
"type": "skip"
}
},
{
"id": "1f3cb3c4-3d8d-4f3c-94ad-30a0a17fde6d",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"version": 1,
"createdAt": "2022-11-10T14:13:01.85472022Z",
"trigger": {
"on": "determineProviderOptions",
"filter": {
"providerConfigId": "5eb08624-ecce-4cbc-9a8a-61d484172815"
}
},
"defaultAction": {
"type": "setPriority",
"params": {
"priority": 1
}
}
},
{
"id": "0dcaf001-32a0-40ee-972c-523f5070e5e3",
"workspaceId": "7f9f1882-a103-408d-ac96-46a7021e537a",
"version": 1,
"createdAt": "2022-11-10T14:13:01.85472022Z",
"trigger": {
"on": "determineProviderOptions",
"filter": {
"workflowNode": "authorize",
"providerConfigId": "1f3cb3c4-3d8d-4f3c-94ad-30a0a17fde6d"
}
},
"rules": [
{
"condition": {
"field": "customer.country.code",
"operator": "=",
"value": "DE"
},
"action": {
"type": "setPriority",
"params": {
"priority": 3
}
}
}
],
"defaultAction": {
"type": "setPriority",
"params": {
"priority": 2
}
}
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.malformed",
"detail": "The request has malformed syntax",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestmalformed"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.unauthorized",
"detail": "The request lacks necessary credentials to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestunauthorized"
}
]
}{
"errors": [
{
"id": "e7db22b3-914e-4975-928e-9edfb0885bea",
"code": "request.forbidden",
"detail": "The request credentials lack the required permissions to perform the specified action",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestforbidden"
}
]
}{
"errors": [
{
"id": "a24bc325-3929-4d9d-9c08-b3aa532685b7",
"code": "request.rate-limit",
"detail": "Too many requests",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestrate-limit"
}
]
}Authorizations
You can use an OAuth2 JWT bearer token in the Authorization header of your API requests for supported endpoints: Authorization: Bearer <YOUR_JWT_HERE>.
These tokens are valid for 10 minutes and can be requested via the access token endpoint endpoint.
Query Parameters
Search collection items after that cursor. Cursor for paging results.
Search collection items before that cursor. Cursor for paging results.
Length of the collection to search.
Filter by createdAt field using interval notation.
1973-02-03T04:32:11.596Z - exact date value
(1973-02-03T04:32:11.596Z - after the date excluding it
[1973-02-03T04:32:11.596Z - after the date including it
1973-02-03T04:32:11.596Z) - before the date excluding it
1973-02-03T04:32:11.596Z] - before the date including it
(1973-02-03T04:32:11.596Z,1973-04-03T03:20:11.436Z) - between two dates excluding both
(1973-02-03T04:32:11.596Z,1973-04-03T03:20:11.436Z] - between two dates excluding on the left
[1973-02-03T04:32:11.596Z,1973-04-03T03:20:11.436Z) - between two dates excluding on the right
[1973-02-03T04:32:11.596Z,1973-04-03T03:20:11.436Z] - between two dates including both.
"[2026-04-01T00:00:00Z,2026-05-01T00:00:00Z)"
Filter for a list of rulesets by id.
Filter by Workspace ID.
Response
Success.
Hide child attributes
Hide child attributes
ID of Ruleset.
Ruleset version.
An action that determines when the rules should be evaluated.
Hide child attributes
Hide child attributes
Action name.
determinePaymentOptions, determineProviderOptions, repeat A map of fields from the execution context and their expected values, which allows to trigger rules evaluation when all context field values match the expected ones.
- Action `determinePaymentOptions` filter.
- Action `determineProviderOptions` filter.
- Action `repeat` filter.
Hide child attributes
Hide child attributes
Code of the payment method selected to perform the payment.
alexBankMa7fazty, amazonPay, applePay, audi2pay, alfa, alipay, bankTransfer, card, 2c2p, capitecPay, cibSmartWallet, easypaisa, etisalatCash, fawryMobileWallet, fawryPay, googlePay, jazzCash, mercadoPago, monoDirectDebit, nbePhoneCash, orangeCash, oPayWallet, pagaWallet, payflex, payjustnow, payPal, pix, konnect, qnbEWallet, wafaCashWallet, weCash, genericRedirect, eftPro, upi, cashFreeWallet, paytmMWallet, netBanking, meezaWallet, vodafoneCash, alipayQRCode, sepaDirectDebit, dcb, bankAccount, modo, ach, payzoneCash, revolutPay, lean, tabby, boleto, oxxo, spei, promptPay, qris, momoVN, vietQR, konbini, touchNGo, gCash, maya, pse, pagoEfectivo, napas, duitNowQR, grabPay, shopeePay, nequi, picPay, ovo, trueMoney, iDeal, bancontact, khipu, razerGold, webPay, smartPix, venmo, klarnaPayLater, klarnaPayNow, klarnaPayOverTime, knet, scalapay, bizum Default action to execute if none of rule conditions are fulfilled.
- Set capture mode.
- Set cancel mode.
- Set delay.
- Set priority.
- Skip.
- Stop.
- Set instrument future usage.
- Add Next Step.
- Add Workflow Execution Status.
Hide child attributes
Hide child attributes
Set the capture mode.
setCaptureMode Creation date of the ruleset.
Rules what need to be evaluated to execute or an action defined by a rule, which condition is fulfilled, or default action if none of conditions are fulfilled.
Hide child attributes
Hide child attributes
A condition that checks whether a field is empty.
Action to execute if the rule condition is fulfilled.
- Set capture mode.
- Set cancel mode.
- Set delay.
- Set priority.
- Skip.
- Stop.
- Set instrument future usage.
- Add Next Step.
- Add Workflow Execution Status.
Hide child attributes
Hide child attributes
Set the capture mode.
setCaptureMode