---
title: "Update a Ruleset"
method: PUT
path: "/merchant/rulesets/{rulesetId}"
tags: ["Rulesets"]
---

# Update a Ruleset

`PUT /merchant/rulesets/{rulesetId}`

Creates a new version of the merchant Ruleset.

## Path parameters

- `rulesetId` string, uuid, required

## Headers

- `x-idempotency-key` string, uuid, required

## Request body

- object
  - `rulesetConfig` object
    - `trigger` object, required — An action that determines when the rules should be evaluated.
      - `on` 'determinePaymentOptions' | 'determineProviderOptions' | 'repeat', required — Action name.
      - `filter` union — 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.
        - object — Fields from execution context when payment options should be determined.
          - `paymentMethodCode` 'alexBankMa7fazty' | 'amazonPay' | 'applePay' | 'audi2pay' | 'alfa' | 'alipay' | 'bankTransfer' | 'card' | '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' — Code of the payment method selected to perform the payment.
        - object — Fields from execution context when provider options should be determined.
          - `workflowNode` 'authorize' | 'startPaymentSession' — Workflow node.
          - `providerConfigId` string, uuid — Unique identifier of the provider config.
        - object — Fields from execution context when repeat should be determined.
          - `workflowNode` 'authorize' — Workflow node.
    - `rules` object[] — 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.
      - `condition` union, required — Condition to be fulfilled to execute the action.
        - object — A condition that checks whether a field is empty.
          - `field` string, required — An execution context field name.
          - `empty` boolean, required — Whether the field must be empty (`true`) or not empty (`false`).
        - object
        - object
        - object — A combination of other condition types.
          - `left` object, required — A condition, format of which is the same as `condition` field.
          - `operator` 'AND' | 'OR', required — A logical operator to combine 2 conditions.
          - `right` object, required — A condition, format of which is the same as `condition` field.
        - object — A combination of a condition with NOT operator.
          - `operator` 'NOT', required — A logical operator to negate a condition.
          - `condition` object — A condition, format of which is the same as `condition` field.
      - `action` union, required — Action to execute if the rule condition is fulfilled.
        - object
          - `type` 'setCaptureMode', required — Set the capture mode.
          - `params` object, required
            - `mode` 'Instant' | 'Delayed' | 'Manual', required — Capture mode to define if money is captured instantly, with delay or manually.
        - object
          - `type` 'setCancelMode', required — Set the cancel mode.
          - `params` object, required
            - `mode` 'Delayed' | 'Manual', required — Cancel mode to define if authorization is canceled manually or with delay.
        - object
          - `type` 'setDelay', required — Set delay for a target action (e.g. expiration, a capture in a 2 step authorization process, or a cancel).
          - `params` object, required
            - `delay` string, ISO 8601 — Delay.
        - object
          - `type` 'setPriority', required — Set a priority for a target element (e.g. for a payment method in the payment options).
          - `params` object, required
            - `priority` number, required — Priority number. Lower number is higher priority.
        - object
          - `type` 'skip', required — Skip action. When returned, the targeted element will be skipped (e.g. skipping a payment method in the payment options).
        - object
          - `type` 'stop', required — Stop action. When returned, the targeted action will be stopped (e.g. action retry attempt).
        - object
          - `type` 'setFutureUsage', required — Set the future usage.
          - `params` object, required
            - `futureUsage` 'Subscription' | 'CardOnFile' | 'UnscheduledCardOnFile', required — Future usage to define the payment flows that the stored instrument will be used for. For cards, it is necessary to optimize the authorization rates and comply with regional legislation (such as SCA in EU) and card network rules.
        - object
          - `type` 'addNextStep', required
          - `params` object, required — Parameters for adding a next step to the workflow queue.
            - `code` string, required — Code of the next workflow step to execute.
            - `mapping` object[] — Mapping allows to add a field to the next workflow step input from the previous step output or set static values.
              - …
        - object
          - `type` 'addWorkflowExecutionStatus', required
          - `params` object, required — Parameters for adding a workflow execution status.
            - `status` string, required — Workflow execution status to add.
    - `defaultAction` union, required — Default action to execute if none of rule conditions are fulfilled.
      - object
        - `type` 'setCaptureMode', required — Set the capture mode.
        - `params` object, required
          - `mode` 'Instant' | 'Delayed' | 'Manual', required — Capture mode to define if money is captured instantly, with delay or manually.
      - object
        - `type` 'setCancelMode', required — Set the cancel mode.
        - `params` object, required
          - `mode` 'Delayed' | 'Manual', required — Cancel mode to define if authorization is canceled manually or with delay.
      - object
        - `type` 'setDelay', required — Set delay for a target action (e.g. expiration, a capture in a 2 step authorization process, or a cancel).
        - `params` object, required
          - `delay` string, ISO 8601 — Delay.
      - object
        - `type` 'setPriority', required — Set a priority for a target element (e.g. for a payment method in the payment options).
        - `params` object, required
          - `priority` number, required — Priority number. Lower number is higher priority.
      - object
        - `type` 'skip', required — Skip action. When returned, the targeted element will be skipped (e.g. skipping a payment method in the payment options).
      - object
        - `type` 'stop', required — Stop action. When returned, the targeted action will be stopped (e.g. action retry attempt).
      - object
        - `type` 'setFutureUsage', required — Set the future usage.
        - `params` object, required
          - `futureUsage` 'Subscription' | 'CardOnFile' | 'UnscheduledCardOnFile', required — Future usage to define the payment flows that the stored instrument will be used for. For cards, it is necessary to optimize the authorization rates and comply with regional legislation (such as SCA in EU) and card network rules.
      - object
        - `type` 'addNextStep', required
        - `params` object, required — Parameters for adding a next step to the workflow queue.
          - `code` string, required — Code of the next workflow step to execute.
          - `mapping` object[] — Mapping allows to add a field to the next workflow step input from the previous step output or set static values.
            - `from` string — Source field path in the trigger request (optional if using static value).
            - `to` string, required — Destination field path in the next step input.
            - `value` unknown
      - object
        - `type` 'addWorkflowExecutionStatus', required
        - `params` object, required — Parameters for adding a workflow execution status.
          - `status` string, required — Workflow execution status to add.
  - `workspaceId` string, uuid — Workspace ID that the ruleset belongs to.

## Response `201`

Created.

- object
  - `createdAt` string, date-time — Creation date of the ruleset.
  - `id` string, uuid, required — ID of Ruleset.
  - `version` number, required — Ruleset version.
  - `trigger` object, required — An action that determines when the rules should be evaluated.
    - `on` 'determinePaymentOptions' | 'determineProviderOptions' | 'repeat', required — Action name.
    - `filter` union — 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.
      - object — Fields from execution context when payment options should be determined.
        - `paymentMethodCode` 'alexBankMa7fazty' | 'amazonPay' | 'applePay' | 'audi2pay' | 'alfa' | 'alipay' | 'bankTransfer' | 'card' | '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' — Code of the payment method selected to perform the payment.
      - object — Fields from execution context when provider options should be determined.
        - `workflowNode` 'authorize' | 'startPaymentSession' — Workflow node.
        - `providerConfigId` string, uuid — Unique identifier of the provider config.
      - object — Fields from execution context when repeat should be determined.
        - `workflowNode` 'authorize' — Workflow node.
  - `rules` object[] — 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.
    - `condition` union, required — Condition to be fulfilled to execute the action.
      - object — A condition that checks whether a field is empty.
        - `field` string, required — An execution context field name.
        - `empty` boolean, required — Whether the field must be empty (`true`) or not empty (`false`).
      - object
      - object
      - object — A combination of other condition types.
        - `left` object, required — A condition, format of which is the same as `condition` field.
        - `operator` 'AND' | 'OR', required — A logical operator to combine 2 conditions.
        - `right` object, required — A condition, format of which is the same as `condition` field.
      - object — A combination of a condition with NOT operator.
        - `operator` 'NOT', required — A logical operator to negate a condition.
        - `condition` object — A condition, format of which is the same as `condition` field.
    - `action` union, required — Action to execute if the rule condition is fulfilled.
      - object
        - `type` 'setCaptureMode', required — Set the capture mode.
        - `params` object, required
          - `mode` 'Instant' | 'Delayed' | 'Manual', required — Capture mode to define if money is captured instantly, with delay or manually.
      - object
        - `type` 'setCancelMode', required — Set the cancel mode.
        - `params` object, required
          - `mode` 'Delayed' | 'Manual', required — Cancel mode to define if authorization is canceled manually or with delay.
      - object
        - `type` 'setDelay', required — Set delay for a target action (e.g. expiration, a capture in a 2 step authorization process, or a cancel).
        - `params` object, required
          - `delay` string, ISO 8601 — Delay.
      - object
        - `type` 'setPriority', required — Set a priority for a target element (e.g. for a payment method in the payment options).
        - `params` object, required
          - `priority` number, required — Priority number. Lower number is higher priority.
      - object
        - `type` 'skip', required — Skip action. When returned, the targeted element will be skipped (e.g. skipping a payment method in the payment options).
      - object
        - `type` 'stop', required — Stop action. When returned, the targeted action will be stopped (e.g. action retry attempt).
      - object
        - `type` 'setFutureUsage', required — Set the future usage.
        - `params` object, required
          - `futureUsage` 'Subscription' | 'CardOnFile' | 'UnscheduledCardOnFile', required — Future usage to define the payment flows that the stored instrument will be used for. For cards, it is necessary to optimize the authorization rates and comply with regional legislation (such as SCA in EU) and card network rules.
      - object
        - `type` 'addNextStep', required
        - `params` object, required — Parameters for adding a next step to the workflow queue.
          - `code` string, required — Code of the next workflow step to execute.
          - `mapping` object[] — Mapping allows to add a field to the next workflow step input from the previous step output or set static values.
            - `from` string — Source field path in the trigger request (optional if using static value).
            - `to` string, required — Destination field path in the next step input.
            - `value` unknown
      - object
        - `type` 'addWorkflowExecutionStatus', required
        - `params` object, required — Parameters for adding a workflow execution status.
          - `status` string, required — Workflow execution status to add.
  - `defaultAction` union, required — Default action to execute if none of rule conditions are fulfilled.
    - object
      - `type` 'setCaptureMode', required — Set the capture mode.
      - `params` object, required
        - `mode` 'Instant' | 'Delayed' | 'Manual', required — Capture mode to define if money is captured instantly, with delay or manually.
    - object
      - `type` 'setCancelMode', required — Set the cancel mode.
      - `params` object, required
        - `mode` 'Delayed' | 'Manual', required — Cancel mode to define if authorization is canceled manually or with delay.
    - object
      - `type` 'setDelay', required — Set delay for a target action (e.g. expiration, a capture in a 2 step authorization process, or a cancel).
      - `params` object, required
        - `delay` string, ISO 8601 — Delay.
    - object
      - `type` 'setPriority', required — Set a priority for a target element (e.g. for a payment method in the payment options).
      - `params` object, required
        - `priority` number, required — Priority number. Lower number is higher priority.
    - object
      - `type` 'skip', required — Skip action. When returned, the targeted element will be skipped (e.g. skipping a payment method in the payment options).
    - object
      - `type` 'stop', required — Stop action. When returned, the targeted action will be stopped (e.g. action retry attempt).
    - object
      - `type` 'setFutureUsage', required — Set the future usage.
      - `params` object, required
        - `futureUsage` 'Subscription' | 'CardOnFile' | 'UnscheduledCardOnFile', required — Future usage to define the payment flows that the stored instrument will be used for. For cards, it is necessary to optimize the authorization rates and comply with regional legislation (such as SCA in EU) and card network rules.
    - object
      - `type` 'addNextStep', required
      - `params` object, required — Parameters for adding a next step to the workflow queue.
        - `code` string, required — Code of the next workflow step to execute.
        - `mapping` object[] — Mapping allows to add a field to the next workflow step input from the previous step output or set static values.
          - `from` string — Source field path in the trigger request (optional if using static value).
          - `to` string, required — Destination field path in the next step input.
          - `value` unknown
    - object
      - `type` 'addWorkflowExecutionStatus', required
      - `params` object, required — Parameters for adding a workflow execution status.
        - `status` string, required — Workflow execution status to add.

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Insufficient Scope.
- `404` — Not Found.
- `429` — Too Many Requests.

---

[API](https://skmtc.net/payrails/apis/payrails-api-reference.md) · [All operations](https://skmtc.net/payrails/apis/payrails-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/payrails/payrails-api-reference/versions/9dd2f0158582/schema)
