curl --request GET \
--url https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version}"
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/{rulesetId}/versions/{version}', 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/{rulesetId}/versions/{version}",
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/{rulesetId}/versions/{version}"
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/{rulesetId}/versions/{version}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version}")
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{
"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"
}
}{
"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.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"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"
}
]
}Get a Ruleset
Fetches a Ruleset by a given ID and version.
curl --request GET \
--url https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version}"
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/{rulesetId}/versions/{version}', 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/{rulesetId}/versions/{version}",
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/{rulesetId}/versions/{version}"
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/{rulesetId}/versions/{version}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.staging.payrails.io/merchant/rulesets/{rulesetId}/versions/{version}")
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{
"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"
}
}{
"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.not-found",
"detail": "The requested resource was not found",
"docUrl": "https://docs.payrails.com/docs/resources/error-codes#requestnot-found"
}
]
}{
"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.
Path Parameters
Identifier of the resource in Payrails.
Ruleset version.
Response
OK.
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