curl --request PUT \
--url https://api.staging.payrails.io/merchant/rulesets/{rulesetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '{}'{
"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"
}
}Update a Ruleset
Creates a new version of the merchant Ruleset.
curl --request PUT \
--url https://api.staging.payrails.io/merchant/rulesets/{rulesetId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-idempotency-key: <x-idempotency-key>' \
--data '{}'{
"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"
}
}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.
Headers
Idempotency key to be used. Sending again the same key would return the same result without re-executing the update.
Path Parameters
Identifier of the resource in Payrails.
Body
Hide child attributes
Hide child attributes
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 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 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.
- Empty condition.
- Simple condition.
- Simple condition.
- Combination of conditions.
- Condition negation.
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 Workspace ID that the ruleset belongs to.
Response
Created.
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 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