> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enfuce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Rule

> This operation updates an existing rule. Only the properties present in the request are updated.

<RequestExample>
  ```json Amount body  theme={null}
  {
    "defaultParameters": {
      "amount": 100
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "AMOUNT"
  }
  ```

  ```json Allowed merchants body  theme={null}
  {
    "defaultParameters": {
      "items": [
        {
          "acquirerId": "string",
          "merchantId": "string"
        }
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "ALLOWED_MERCHANT_ID"
  }
  ```

  ```json Blocked merchants body  theme={null}
  {
    "defaultParameters": {
      "items": [
        {
          "acquirerId": "string",
          "merchantId": "string"
        }
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "BLOCKED_MERCHANT_ID"
  }
  ```

  ```json Allowed Card Entry Modes body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "ALLOWED_CARD_ENTRY_MODES"
  }
  ```

  ```json Blocked Card Entry Modes body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "BLOCKED_CARD_ENTRY_MODES"
  }
  ```

  ```json Allowed MCCs body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "integer"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "ALLOWED_MCC"
  }
  ```

  ```json Blocked MCCs body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "integer"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "BLOCKED_MCC"
  }
  ```

  ```json Allowed CVMs body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "ALLOWED_CVM"
  }
  ```

  ```json Blocked CVMs body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "BLOCKED_CVM"
  }
  ```

  ```json Allowed Merchant Countries body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "ALLOWED_MERCHANT_COUNTRY"
  }
  ```

  ```json Blocked Merchant Countries body  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "BLOCKED_MERCHANT_COUNTRY"
  }
  ```

  ```json Cardholder Present body  theme={null}
  {
    "defaultParameters": {
      "cardholderPresent": true
    },
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "CARDHOLDER_PRESENT"
  }
  ```

  ```json Decline body  theme={null}
  {
    "filterOperatorType": "ANY",
    "name": "string",
    "ruleType": "DECLINE"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Amount response  theme={null}
  {
    "defaultParameters": {
      "amount": 100
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "AMOUNT"
  }
  ```

  ```json Allowed merchants response  theme={null}
  {
    "defaultParameters": {
      "items": [
        {
          "acquirerId": "string",
          "merchantId": "string"
        }
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "ALLOWED_MERCHANT_ID"
  }
  ```

  ```json Blocked merchants response  theme={null}
  {
    "defaultParameters": {
      "items": [
        {
          "acquirerId": "string",
          "merchantId": "string"
        }
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "BLOCKED_MERCHANT_ID"
  }
  ```

  ```json Allowed Card Entry Modes response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "ALLOWED_CARD_ENTRY_MODES"
  }
  ```

  ```json Blocked Card Entry Modes response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "BLOCKED_CARD_ENTRY_MODES"
  }
  ```

  ```json Allowed MCCs response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "integer"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "ALLOWED_MCC"
  }
  ```

  ```json Blocked MCCs response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "integer"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "BLOCKED_MCC"
  }
  ```

  ```json Allowed CVMs response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "ALLOWED_CVM"
  }
  ```

  ```json Blocked CVMs response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "BLOCKED_CVM"
  }
  ```

  ```json Allowed Merchant Countries response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "ALLOWED_MERCHANT_COUNTRY"
  }
  ```

  ```json Blocked Merchant Countries response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "BLOCKED_MERCHANT_COUNTRY"
  }
  ```

  ```json Cardholder Present response  theme={null}
  {
    "defaultParameters": {
      "cardholderPresent": true
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "CARDHOLDER_PRESENT"
  }
  ```

  ```json Decline response  theme={null}
  {
    "defaultParameters": {
      "items": [
        "string"
      ]
    },
    "filterOperatorType": "ANY",
    "filters": [
      {
        "id": "string",
        "reversed": true,
        "type": "MCC"
      }
    ],
    "id": "string",
    "name": "string",
    "ruleType": "DECLINE"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml spend-control patch /v1/rules/{rule-id}
openapi: 3.0.3
info:
  version: '1'
  title: Spend Control API
  description: >
    # Rules

    Rules define specific conditions that control how spending should be
    managed. These conditions can be based on various factors such as merchant
    category, transaction amount, merchant location, etc. The rules are applied
    to transactions to determine whether they should be approved or declined.

    # Filters and Filter Operator Types

    Filters define specific criteria that must be met for a rule to be applied.
    They help refine the conditions under which a rule operates. Filter operator
    types define how multiple filters within a rule should be evaluated.

    # Example Usage

    A rule might be configured to decline transactions if the MCC is in a
    specified list of blocked codes and the transaction amount exceeds a certain
    limit. Filters can be applied to ensure that the rule only evaluates
    transactions that meet specific criteria, such as transactions from a
    certain country or transactions above a certain amount.

    ### Disclaimer

    This feature is sold separately. Please contact our sales department for
    more information.
  contact:
    name: Enfuce Financial Services
    url: https://enfuce.com
    email: info@enfuce.com
  x-logo:
    url: https://developer.enfuce.com/images/enfuce.svg
    altText: Enfuce logo
servers:
  - url: >-
      https://integration-api-cat2.{{environment}}.ext.{{realm}}.cia.enfuce.com/spend-control
  - url: https://integration-api-cat2.live.ext.prod.cia.enfuce.com/spend-control
    description: Live environment
security: []
paths:
  /v1/rules/{rule-id}:
    patch:
      tags:
        - Rules Endpoints
      summary: Update Rule
      description: >-
        This operation updates an existing rule. Only the properties present in
        the request are updated.
      operationId: updateRule
      parameters:
        - $ref: '#/components/parameters/ruleId'
        - $ref: '#/components/parameters/auditUser'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleUpdateRequestBody'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleResponseBody'
        '400':
          $ref: '#/components/responses/error400'
        '401':
          $ref: '#/components/responses/error401'
        '403':
          $ref: '#/components/responses/error403'
        '404':
          $ref: '#/components/responses/error404'
        '500':
          $ref: '#/components/responses/error500'
components:
  parameters:
    ruleId:
      name: rule-id
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/Id'
    auditUser:
      name: auditUser
      in: query
      description: The audit user to log the request
      required: true
      schema:
        type: string
  schemas:
    RuleUpdateRequestBody:
      type: object
      oneOf:
        - $ref: '#/components/schemas/AmountRuleUpdateBody'
        - $ref: '#/components/schemas/AllowedMerchantRuleUpdateBody'
        - $ref: '#/components/schemas/BlockedMerchantRuleUpdateBody'
        - $ref: '#/components/schemas/AllowedCardEntryModeRuleUpdateBody'
        - $ref: '#/components/schemas/BlockedCardEntryModeRuleUpdateBody'
        - $ref: '#/components/schemas/AllowedMccRuleUpdateBody'
        - $ref: '#/components/schemas/BlockedMccRuleUpdateBody'
        - $ref: '#/components/schemas/AllowedCvmRuleUpdateBody'
        - $ref: '#/components/schemas/BlockedCvmRuleUpdateBody'
        - $ref: '#/components/schemas/AllowedMerchantCountryRuleUpdateBody'
        - $ref: '#/components/schemas/BlockedMerchantCountryRuleUpdateBody'
        - $ref: '#/components/schemas/CardholderPresentRuleUpdateBody'
        - $ref: '#/components/schemas/DeclineRuleUpdateBody'
        - $ref: '#/components/schemas/ExternalBalanceCheckRuleUpdateBody'
        - $ref: '#/components/schemas/CumulativeAmountIndividualLimitsRuleUpdateBody'
        - $ref: '#/components/schemas/CumulativeCountIndividualLimitsRuleUpdateBody'
        - $ref: '#/components/schemas/EnfuceInternalPsd2PinCountRuleUpdateBody'
        - $ref: '#/components/schemas/EnfuceInternalPsd2PinAmountRuleUpdateBody'
      properties:
        ruleType:
          $ref: '#/components/schemas/RuleType'
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
      required:
        - ruleType
      discriminator:
        propertyName: ruleType
        mapping:
          AMOUNT:
            $ref: '#/components/schemas/AmountRuleUpdateBody'
          ALLOWED_MERCHANT_ID:
            $ref: '#/components/schemas/AllowedMerchantRuleUpdateBody'
          BLOCKED_MERCHANT_ID:
            $ref: '#/components/schemas/BlockedMerchantRuleUpdateBody'
          ALLOWED_CARD_ENTRY_MODES:
            $ref: '#/components/schemas/AllowedCardEntryModeRuleUpdateBody'
          BLOCKED_CARD_ENTRY_MODES:
            $ref: '#/components/schemas/BlockedCardEntryModeRuleUpdateBody'
          ALLOWED_MCC:
            $ref: '#/components/schemas/AllowedMccRuleUpdateBody'
          BLOCKED_MCC:
            $ref: '#/components/schemas/BlockedMccRuleUpdateBody'
          ALLOWED_CVM:
            $ref: '#/components/schemas/AllowedCvmRuleUpdateBody'
          BLOCKED_CVM:
            $ref: '#/components/schemas/BlockedCvmRuleUpdateBody'
          ALLOWED_MERCHANT_COUNTRY:
            $ref: '#/components/schemas/AllowedMerchantCountryRuleUpdateBody'
          BLOCKED_MERCHANT_COUNTRY:
            $ref: '#/components/schemas/BlockedMerchantCountryRuleUpdateBody'
          CARDHOLDER_PRESENT:
            $ref: '#/components/schemas/CardholderPresentRuleUpdateBody'
          DECLINE:
            $ref: '#/components/schemas/DeclineRuleUpdateBody'
          EXTERNAL_BALANCE_CHECK:
            $ref: '#/components/schemas/ExternalBalanceCheckRuleUpdateBody'
          CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS:
            $ref: >-
              #/components/schemas/CumulativeAmountIndividualLimitsRuleUpdateBody
          CUMULATIVE_COUNT_INDIVIDUAL_LIMITS:
            $ref: '#/components/schemas/CumulativeCountIndividualLimitsRuleUpdateBody'
          ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE:
            $ref: '#/components/schemas/EnfuceInternalPsd2PinCountRuleUpdateBody'
          ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE:
            $ref: '#/components/schemas/EnfuceInternalPsd2PinAmountRuleUpdateBody'
    RuleResponseBody:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        ruleType:
          $ref: '#/components/schemas/RuleType'
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FilterResponseBody'
      required:
        - name
        - filterOperatorType
      discriminator:
        propertyName: ruleType
        mapping:
          AMOUNT:
            $ref: '#/components/schemas/AmountRuleResponseBody'
          ALLOWED_MERCHANT_ID:
            $ref: '#/components/schemas/AllowedMerchantRuleResponseBody'
          BLOCKED_MERCHANT_ID:
            $ref: '#/components/schemas/BlockedMerchantRuleResponseBody'
          ALLOWED_CARD_ENTRY_MODES:
            $ref: '#/components/schemas/AllowedCardEntryModeRuleResponseBody'
          BLOCKED_CARD_ENTRY_MODES:
            $ref: '#/components/schemas/BlockedCardEntryModeRuleResponseBody'
          ALLOWED_MCC:
            $ref: '#/components/schemas/AllowedMccRuleResponseBody'
          BLOCKED_MCC:
            $ref: '#/components/schemas/BlockedMccRuleResponseBody'
          ALLOWED_CVM:
            $ref: '#/components/schemas/AllowedCvmRuleResponseBody'
          BLOCKED_CVM:
            $ref: '#/components/schemas/BlockedCvmRuleResponseBody'
          ALLOWED_MERCHANT_COUNTRY:
            $ref: '#/components/schemas/AllowedMerchantCountryRuleResponseBody'
          BLOCKED_MERCHANT_COUNTRY:
            $ref: '#/components/schemas/BlockedMerchantCountryRuleResponseBody'
          CARDHOLDER_PRESENT:
            $ref: '#/components/schemas/CardholderPresentRuleResponseBody'
          DECLINE:
            $ref: '#/components/schemas/DeclineRuleResponseBody'
          EXTERNAL_BALANCE_CHECK:
            $ref: '#/components/schemas/ExternalBalanceCheckRuleResponseBody'
          CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS:
            $ref: >-
              #/components/schemas/CumulativeAmountIndividualLimitsRuleResponseBody
          CUMULATIVE_COUNT_INDIVIDUAL_LIMITS:
            $ref: >-
              #/components/schemas/CumulativeCountIndividualLimitsRuleResponseBody
          ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE:
            $ref: '#/components/schemas/EnfuceInternalPsd2PinCountRuleResponseBody'
          ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE:
            $ref: '#/components/schemas/EnfuceInternalPsd2PinAmountRuleResponseBody'
    Id:
      type: string
      format: biginteger
    AmountRuleUpdateBody:
      title: Amount
      properties:
        defaultParameters:
          $ref: '#/components/schemas/AmountParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: AMOUNT
          default: AMOUNT
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    AllowedMerchantRuleUpdateBody:
      title: Allowed Merchants
      properties:
        defaultParameters:
          $ref: '#/components/schemas/MerchantsParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ALLOWED_MERCHANT_ID
          default: ALLOWED_MERCHANT_ID
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    BlockedMerchantRuleUpdateBody:
      title: Blocked Merchants
      properties:
        defaultParameters:
          $ref: '#/components/schemas/MerchantsParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: BLOCKED_MERCHANT_ID
          default: BLOCKED_MERCHANT_ID
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    AllowedCardEntryModeRuleUpdateBody:
      title: Allowed Card Entry Modes
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CardEntryModeParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ALLOWED_CARD_ENTRY_MODES
          default: ALLOWED_CARD_ENTRY_MODES
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    BlockedCardEntryModeRuleUpdateBody:
      title: Blocked Card Entry Modes
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CardEntryModeParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: BLOCKED_CARD_ENTRY_MODES
          default: BLOCKED_CARD_ENTRY_MODES
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    AllowedMccRuleUpdateBody:
      title: Allowed MCCs
      properties:
        defaultParameters:
          $ref: '#/components/schemas/MccParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ALLOWED_MCC
          default: ALLOWED_MCC
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    BlockedMccRuleUpdateBody:
      title: Blocked MCCs
      properties:
        defaultParameters:
          $ref: '#/components/schemas/MccParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: BLOCKED_MCC
          default: BLOCKED_MCC
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    AllowedCvmRuleUpdateBody:
      title: Allowed CVMs
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CardholderVerificationParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ALLOWED_CVM
          default: ALLOWED_CVM
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    BlockedCvmRuleUpdateBody:
      title: Blocked CVMs
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CardholderVerificationParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: BLOCKED_CVM
          default: BLOCKED_CVM
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    AllowedMerchantCountryRuleUpdateBody:
      title: Allowed Merchant Countries
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CountriesParameterBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ALLOWED_MERCHANT_COUNTRY
          default: ALLOWED_MERCHANT_COUNTRY
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    BlockedMerchantCountryRuleUpdateBody:
      title: Blocked Merchant Countries
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CountriesParameterBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: BLOCKED_MERCHANT_COUNTRY
          default: BLOCKED_MERCHANT_COUNTRY
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    CardholderPresentRuleUpdateBody:
      title: Cardholder Present
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CardholderPresentParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: CARDHOLDER_PRESENT
          default: CARDHOLDER_PRESENT
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    DeclineRuleUpdateBody:
      title: Decline
      properties:
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: DECLINE
          default: DECLINE
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    ExternalBalanceCheckRuleUpdateBody:
      title: External balance check
      properties:
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: EXTERNAL_BALANCE_CHECK
          default: EXTERNAL_BALANCE_CHECK
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    CumulativeAmountIndividualLimitsRuleUpdateBody:
      title: Cumulative amount individual limits
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CumulativeAmountIndividualLimitsParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS
          default: CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    CumulativeCountIndividualLimitsRuleUpdateBody:
      title: Cumulative count individual limits
      properties:
        defaultParameters:
          $ref: '#/components/schemas/CumulativeCountIndividualLimitsParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: CUMULATIVE_COUNT_INDIVIDUAL_LIMITS
          default: CUMULATIVE_COUNT_INDIVIDUAL_LIMITS
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    EnfuceInternalPsd2PinCountRuleUpdateBody:
      title: Enfuce internal PSD2 pin count rule
      properties:
        defaultParameters:
          $ref: '#/components/schemas/ListStringParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE
          default: ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    EnfuceInternalPsd2PinAmountRuleUpdateBody:
      title: Enfuce internal PSD2 pin amount rule
      properties:
        defaultParameters:
          $ref: '#/components/schemas/ListStringParametersBody'
        ruleType:
          $ref: '#/components/schemas/RuleType'
          example: ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE
          default: ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE
        name:
          type: string
        filterOperatorType:
          $ref: '#/components/schemas/FilterOperatorType'
    RuleType:
      type: string
      enum:
        - DECLINE
        - ALLOWED_MCC
        - BLOCKED_MCC
        - ALLOWED_MERCHANT_ID
        - BLOCKED_MERCHANT_ID
        - AMOUNT
        - ALLOWED_MERCHANT_COUNTRY
        - BLOCKED_MERCHANT_COUNTRY
        - ALLOWED_CARD_ENTRY_MODES
        - BLOCKED_CARD_ENTRY_MODES
        - ALLOWED_CVM
        - BLOCKED_CVM
        - CARDHOLDER_PRESENT
        - EXTERNAL_BALANCE_CHECK
        - CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS
        - CUMULATIVE_COUNT_INDIVIDUAL_LIMITS
        - ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE
        - ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE
      description: >
        ### DECLINE

        Always declines. Should be used together with filters.

        Parameters: None


        ### ALLOWED_MCC

        Approves if MCC in request is in parameter list. Otherwise declines.

        Parameters: List of MCC codes


        ### BLOCKED_MCC

        Declines if MCC in request is in parameter list. Otherwise approves.

        Parameters: List of MCC codes


        ### ALLOWED_MERCHANT_ID

        Approves if merchant id in request is in parameter list. Otherwise
        declines.

        Parameters: List of merchant ids


        ### BLOCKED_MERCHANT_ID

        Declines if merchant id in request is in parameter list. Otherwise
        approves.

        Parameters: List of merchant ids


        ### AMOUNT

        Declines if amount in request is greater than the parameter. Otherwise
        approves.

        Parameters: Single element containing floating number


        ### ALLOWED_MERCHANT_COUNTRY

        Approves if country code in request is not present or is in parameter
        list. Otherwise declines.

        Parameters: List of country codes


        ### BLOCKED_MERCHANT_COUNTRY

        Declines if country code in request is present and is in parameter list.
        Otherwise approves.

        Parameters: List of country codes


        ### BLOCKED_CARD_ENTRY_MODES

        Declines if card entry mode code in request is present and is in
        parameter list. Otherwise approves.

        Parameters: List of card entry mode codes


        ### ALLOWED_CARD_ENTRY_MODES

        Approves if card entry mode code in request is present and is in
        parameter list. Otherwise declines.

        Parameters: List of card entry mode codes


        ### ALLOWED_CVM

        Approves if cardholder verification code in request is present and is in
        parameter list. Otherwise declines.

        Parameters: List of cardholder verification codes


        ### BLOCKED_CVM

        Declines if cardholder verification code in request is present and is in
        parameter list. Otherwise approves.

        Parameters: List of cardholder verification codes


        ### EXTERNAL_BALANCE_CHECK

        Declines if account balance is lower than transaction amount. Otherwise
        approves.

        Parameters: None


        ### CUMULATIVE_AMOUNT_INDIVIDUAL_LIMITS - Work in Progress

        Declines if cumulative amount over the defined period of time exceeds
        the parameter. Otherwise approves.

        Parameters: Single element containing floating number (limit),
        enumerated period of time string and single element elaborating on the
        period length for rolling periods


        ### CUMULATIVE_COUNT_INDIVIDUAL_LIMITS - Work in Progress

        Declines if cumulative count over the defined period of time exceeds the
        parameter. Otherwise approves.

        Parameters: Single element containing floating number (limit),
        enumerated period of time string and single element elaborating on the
        period length for rolling periods


        ### ENFUCE_INTERNAL_PSD2_PIN_COUNT_RULE

        This ruleType is for internal enfuce use only


        ### ENFUCE_INTERNAL_PSD2_PIN_AMOUNT_RULE

        This ruleType is for internal enfuce use only
    FilterOperatorType:
      type: string
      description: >-
        Defines whether all filters should match or if it's for just one filter
        to pass.
      enum:
        - ANY
        - ALL
    FilterResponseBody:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        type:
          $ref: '#/components/schemas/FilterType'
        reversed:
          type: boolean
      discriminator:
        propertyName: type
        mapping:
          ACQUIRER_ID:
            $ref: '#/components/schemas/AcquirerIdFilterResponseBody'
          MERCHANT_COUNTRY:
            $ref: '#/components/schemas/MerchantCountryFilterResponseBody'
          CARD_ENTRY_MODE:
            $ref: '#/components/schemas/CardEntryModeFilterResponseBody'
          MCC:
            $ref: '#/components/schemas/MccModeFilterResponseBody'
          AMOUNT:
            $ref: '#/components/schemas/AmountFilterResponseBody'
          CARDHOLDER_PRESENT:
            $ref: '#/components/schemas/CardholderPresentFilterResponseBody'
          CARDHOLDER_VERIFICATION:
            $ref: '#/components/schemas/CvmFilterResponseBody'
          TRANSACTION_TYPE:
            $ref: '#/components/schemas/TransactionTypeFilterResponseBody'
    AmountRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/AmountParametersBody'
    AllowedMerchantRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/MerchantsParametersBody'
    BlockedMerchantRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/MerchantsParametersBody'
    AllowedCardEntryModeRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CardEntryModeParametersBody'
    BlockedCardEntryModeRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CardEntryModeParametersBody'
    AllowedMccRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/MccParametersBody'
    BlockedMccRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/MccParametersBody'
    AllowedCvmRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CardholderVerificationParametersBody'
    BlockedCvmRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CardholderVerificationParametersBody'
    AllowedMerchantCountryRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CountriesParameterBody'
    BlockedMerchantCountryRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CountriesParameterBody'
    CardholderPresentRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/CardholderPresentParametersBody'
    DeclineRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/ListStringParametersBody'
    ExternalBalanceCheckRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/ListStringParametersBody'
    CumulativeAmountIndividualLimitsRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: >-
                #/components/schemas/CumulativeAmountIndividualLimitsParametersBody
    CumulativeCountIndividualLimitsRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: >-
                #/components/schemas/CumulativeCountIndividualLimitsParametersBody
    EnfuceInternalPsd2PinCountRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/ListStringParametersBody'
    EnfuceInternalPsd2PinAmountRuleResponseBody:
      allOf:
        - $ref: '#/components/schemas/RuleResponseBody'
        - properties:
            defaultParameters:
              $ref: '#/components/schemas/ListStringParametersBody'
    errorResponse:
      type: object
      properties:
        code:
          type: string
          description: An error code indicating what kind of error. I.e. HTTP error code
        message:
          type: string
          description: Error message in human-readable format
        id:
          type: string
          format: uuid
          description: Unique error identifier
        errorCode:
          type: string
          description: Enfuce code for a specific error type
        errorType:
          type: string
          description: Error type
          enum:
            - STATIC_VALIDATION_ERROR
            - DYNAMIC_VALIDATION_ERROR
            - INTEGRATION_ERROR
            - SECURITY_ERROR
            - UNEXPECTED_ERROR
        errorReason:
          type: string
          description: Free-form text explaining the error reason
        timestamp:
          type: string
          format: date-time
          description: Datetime when error occurred
    AmountParametersBody:
      type: object
      properties:
        amount:
          type: string
          format: biginteger
          example: 100
        shouldTriggerPartialApproval:
          type: boolean
          example: 'false'
      required:
        - amount
    MerchantsParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            type: object
            properties:
              merchantId:
                type: string
              acquirerId:
                type: string
                description: >-
                  Acquirer id which can be used as additional parameter to
                  specify merchant
              subMerchantId:
                type: string
                description: >-
                  SubMerchantId id which can be used as additional parameter to
                  specify merchant
            required:
              - merchantId
    CardEntryModeParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/cardEntryMode'
    MccParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            type: integer
            minimum: 0
            maximum: 9999
    CardholderVerificationParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/cardholderVerificationType'
    CountriesParameterBody:
      type: object
      description: A valid ISO-3166-1 alpha-3 country code.
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/countryCode'
    CardholderPresentParametersBody:
      type: object
      properties:
        cardholderPresent:
          type: boolean
      required:
        - cardholderPresent
    CumulativeAmountIndividualLimitsParametersBody:
      type: object
      properties:
        limitCumulativeAmount:
          type: string
          format: biginteger
          example: 100
          description: The maximum cumulative amount allowed in the reset period
        resetPeriod:
          $ref: '#/components/schemas/ResetPeriod'
        rollingResetPeriodAmount:
          type: string
          format: biginteger
          example: 100
          description: The number of hours/days for rolling resets
      required:
        - resetPeriod
      description: >
        Parameters for cumulative individual limits rule.

        At least one limit type must be specified (either amount or transaction
        count).
    CumulativeCountIndividualLimitsParametersBody:
      type: object
      properties:
        limitTransactionCount:
          type: string
          format: biginteger
          example: 100
          description: The maximum number of transactions allowed in the reset period
        resetPeriod:
          $ref: '#/components/schemas/ResetPeriod'
        rollingResetPeriodAmount:
          type: string
          format: biginteger
          example: 100
          description: The number of hours/days for rolling resets
      required:
        - resetPeriod
      description: >
        Parameters for cumulative individual limits rule.

        At least one limit type must be specified (either amount or transaction
        count).
    ListStringParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            type: string
    FilterType:
      type: string
      enum:
        - MCC
        - AMOUNT
        - MERCHANT_COUNTRY
        - CARDHOLDER_VERIFICATION
        - CARD_ENTRY_MODE
        - CARDHOLDER_PRESENT
        - ACQUIRER_ID
        - TRANSACTION_TYPE
      description: |
        ### MCC
        Matches if MCC in request is in parameter list.
        Parameters: List of MCC codes

        ### Amount
        Matches if amount is greater than the parameter.
        Parameters: Single element containing floating number

        ### MERCHANT_COUNTRY
        Matches if country code is in parameter list.
        Parameters: List of country codes

        ### CARDHOLDER_VERIFICATION
        Matches if cardholder verification is in parameter list.
        Parameters: List of cardholder verifications

        ### CARD_ENTRY_MODE
        Matches if card entry mode is in parameter list.
        Parameters: List of card entry modes

        ### CARDHOLDER_PRESENT
        Parameters: boolean value

        ### ACQUIRER_ID
        Matches if acquirer id is in parameter list.
        Parameters: List of acquirer ids

        ### TRANSACTION_TYPE
        Matches if transaction type is in parameter list.
        Parameters: List of transaction types
    AcquirerIdFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/ListStringParametersBody'
    MerchantCountryFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/CountriesParameterBody'
    CardEntryModeFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/CardEntryModeParametersBody'
    MccModeFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/MccParametersBody'
    AmountFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/AmountParametersBody'
    CardholderPresentFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/CardholderPresentParametersBody'
    CvmFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/CardholderVerificationParametersBody'
    TransactionTypeFilterResponseBody:
      allOf:
        - $ref: '#/components/schemas/FilterResponseBody'
        - properties:
            parameters:
              $ref: '#/components/schemas/TransactionTypeParametersBody'
    cardEntryMode:
      description: |
        Describes how the card credentials were captured. Possible values:
          * `UNKNOWN` - the message from the merchant did not include a distinct method.
          * `MANUAL_ENTRY` - the card credentials were manually entered by the merchant.
          * `MAGNETIC_STRIPE_READ` - the magnetic stripe of the card was read by a terminal.
          * `CHIP_READ` - the EMV chip of the card was read by a terminal
          * `CONTACTLESS` - contactless transactions, i.e. the card credentials were read with near field communication (NFC) either from chip or digital wallet.
          * `ELECTRONIC_COMMERCE` - the cardholder entered the card credentials as an e-com merchant.
      type: string
      enum:
        - UNKNOWN
        - MANUAL_ENTRY
        - MAGNETIC_STRIPE_READ
        - CHIP_READ
        - CONTACTLESS
        - ELECTRONIC_COMMERCE
    cardholderVerificationType:
      description: >
        Describes what method was used to verify the cardholder. The
        verification methods are limited to verification methods that are
        considered as valid verification methods according to strong customer
        authentication principles.  Possible values: * `WALLET` - cardholder has
        been verified with the digital wallet device.  * `PIN` - cardholder has
        entered the correct PIN of the card to the payment terminal. * `BIO` -
        cardholder has successfully been verified through a biometric method
        (e.g. fingerprint reader on card). * `THREE_DS` - cardholder has
        successfully been verified through 3DS.
      type: string
      enum:
        - WALLET
        - PIN
        - BIO
        - THREE_DS
    countryCode:
      type: string
      format: iso3166-1-countrycode
      description: A valid ISO-3166-1 alpha-3 country code.
      example: FIN
    ResetPeriod:
      type: string
      enum:
        - DAILY
        - WEEKLY
        - MONTHLY
        - QUARTERLY
        - YEARLY
        - ROLLING_HOURLY
        - ROLLING_DAILY
      description: >
        Period after which the cumulative amount is reset.

        * DAILY - Resets at 00:00 every day

        * WEEKLY - Resets at 00:00 every Monday

        * MONTHLY - Resets at 00:00 every first day of the month

        * QUARTERLY - Resets at 00:00 every first day of the quarter (Jan 1, Apr
        1, Jul 1, Oct 1)

        * YEARLY - Resets at 00:00 every first day of the year

        * ROLLING_HOURLY - Rolling reset period based on specified number of
        hours from transaction time

        * ROLLING_DAILY - Rolling reset period based on specified number of days
        from transaction time
    TransactionTypeParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/transactionType'
    transactionType:
      description: |
        The transaction type. 
      type: string
      enum:
        - RETAIL
        - ATM
        - UNIQUE
        - CASH_DISBURSEMENT
        - BALANCE_INQUIRY
        - P2P_DEBIT
        - P2P_CREDIT
        - CREDIT
        - CASHBACK
      x-enum-varnames:
        - RETAIL
        - ATM
        - UNIQUE
        - CASH_DISBURSEMENT
        - BALANCE_INQUIRY
        - P2P_DEBIT
        - P2P_CREDIT
        - CREDIT
        - CASHBACK
  responses:
    error400:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error404:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'
    error500:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/errorResponse'

````