> ## 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 Filter

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

<RequestExample>
  ```json Acquirer IDs body  theme={null}
  {
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "ACQUIRER_ID"
  }
  ```

  ```json Merchant Countries body  theme={null}
  {
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "MERCHANT_COUNTRY"
  }
  ```

  ```json Card Entry Modes body  theme={null}
  {
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "CARD_ENTRY_MODE"
  }
  ```

  ```json MCCs body  theme={null}
  {
    "parameters": {
      "items": [
        "integer"
      ]
    },
    "reversed": true,
    "type": "MCC"
  }
  ```

  ```json Amount body  theme={null}
  {
    "parameters": {
      "amount": 100
    },
    "reversed": true,
    "type": "AMOUNT"
  }
  ```

  ```json Cardholder Present body  theme={null}
  {
    "parameters": {
      "cardholderPresent": true
    },
    "reversed": true,
    "type": "CARDHOLDER_PRESENT"
  }
  ```

  ```json Cardholder Verification Modes body  theme={null}
  {
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "CARDHOLDER_VERIFICATION"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Acquirer IDs response  theme={null}
  {
    "id": "string",
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "ACQUIRER_ID"
  }
  ```

  ```json Merchant Countries response  theme={null}
  {
    "id": "string",
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "MERCHANT_COUNTRY"
  }
  ```

  ```json Card Entry Modes response  theme={null}
  {
    "id": "string",
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "CARD_ENTRY_MODE"
  }
  ```

  ```json MCCs response  theme={null}
  {
    "id": "string",
    "parameters": {
      "items": [
        "integer"
      ]
    },
    "reversed": true,
    "type": "MCC"
  }
  ```

  ```json Amount response  theme={null}
  {
    "id": "string",
    "parameters": {
      "amount": 100
    },
    "reversed": true,
    "type": "AMOUNT"
  }
  ```

  ```json Cardholder Present response  theme={null}
  {
    "id": "string",
    "parameters": {
      "cardholderPresent": true
    },
    "reversed": true,
    "type": "CARDHOLDER_PRESENT"
  }
  ```

  ```json Cardholder Verification Modes response  theme={null}
  {
    "id": "string",
    "parameters": {
      "items": [
        "string"
      ]
    },
    "reversed": true,
    "type": "CARDHOLDER_VERIFICATION"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml spend-control patch /v1/filters/{filter-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/filters/{filter-id}:
    patch:
      tags:
        - Rules Endpoints
      summary: Update Rule Filter
      description: >-
        This operation updates an existing filter. Only the properties present
        in the request are updated.
      operationId: updateRuleFilter
      parameters:
        - $ref: '#/components/parameters/filterId'
        - $ref: '#/components/parameters/auditUser'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FilterCreateRequestBody'
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FilterResponseBody'
        '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:
    filterId:
      name: filter-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:
    FilterCreateRequestBody:
      type: object
      oneOf:
        - $ref: '#/components/schemas/AcquirerIdFilterCreateRequestBody'
        - $ref: '#/components/schemas/MerchantCountryFilterCreateRequestBody'
        - $ref: '#/components/schemas/CardEntryModeFilterCreateRequestBody'
        - $ref: '#/components/schemas/MccModeFilterCreateRequestBody'
        - $ref: '#/components/schemas/AmountFilterCreateRequestBody'
        - $ref: '#/components/schemas/CardholderPresentFilterCreateRequestBody'
        - $ref: '#/components/schemas/CvmFilterCreateRequestBody'
        - $ref: '#/components/schemas/TransactionTypeFilterCreateRequestBody'
      properties:
        type:
          $ref: '#/components/schemas/FilterType'
        reversed:
          type: boolean
          default: false
      required:
        - type
      discriminator:
        propertyName: type
        mapping:
          ACQUIRER_ID:
            $ref: '#/components/schemas/AcquirerIdFilterCreateRequestBody'
          MERCHANT_COUNTRY:
            $ref: '#/components/schemas/MerchantCountryFilterCreateRequestBody'
          CARD_ENTRY_MODE:
            $ref: '#/components/schemas/CardEntryModeFilterCreateRequestBody'
          MCC:
            $ref: '#/components/schemas/MccModeFilterCreateRequestBody'
          AMOUNT:
            $ref: '#/components/schemas/AmountFilterCreateRequestBody'
          CARDHOLDER_PRESENT:
            $ref: '#/components/schemas/CardholderPresentFilterCreateRequestBody'
          CARDHOLDER_VERIFICATION:
            $ref: '#/components/schemas/CvmFilterCreateRequestBody'
          TRANSACTION_TYPE:
            $ref: '#/components/schemas/TransactionTypeFilterCreateRequestBody'
    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'
    Id:
      type: string
      format: biginteger
    AcquirerIdFilterCreateRequestBody:
      title: Acquirer IDs
      properties:
        parameters:
          $ref: '#/components/schemas/ListStringParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: ACQUIRER_ID
          default: ACQUIRER_ID
        reversed:
          type: boolean
          default: false
      required:
        - type
    MerchantCountryFilterCreateRequestBody:
      title: Merchant Countries
      properties:
        parameters:
          $ref: '#/components/schemas/CountriesParameterBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: MERCHANT_COUNTRY
          default: MERCHANT_COUNTRY
        reversed:
          type: boolean
          default: false
      required:
        - type
    CardEntryModeFilterCreateRequestBody:
      title: Card Entry Modes
      properties:
        parameters:
          $ref: '#/components/schemas/CardEntryModeParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: CARD_ENTRY_MODE
          default: CARD_ENTRY_MODE
        reversed:
          type: boolean
          default: false
      required:
        - type
    MccModeFilterCreateRequestBody:
      title: MCCs
      properties:
        parameters:
          $ref: '#/components/schemas/MccParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: MCC
          default: MCC
        reversed:
          type: boolean
          default: false
      required:
        - type
    AmountFilterCreateRequestBody:
      title: Amount
      properties:
        parameters:
          $ref: '#/components/schemas/AmountParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: AMOUNT
          default: AMOUNT
        reversed:
          type: boolean
          default: false
      required:
        - type
    CardholderPresentFilterCreateRequestBody:
      title: Cardholder Present
      properties:
        parameters:
          $ref: '#/components/schemas/CardholderPresentParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: CARDHOLDER_PRESENT
          default: CARDHOLDER_PRESENT
        reversed:
          type: boolean
          default: false
      required:
        - type
    CvmFilterCreateRequestBody:
      title: Cardholder Verification Modes
      properties:
        parameters:
          $ref: '#/components/schemas/CardholderVerificationParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: CARDHOLDER_VERIFICATION
          default: CARDHOLDER_VERIFICATION
        reversed:
          type: boolean
          default: false
      required:
        - type
    TransactionTypeFilterCreateRequestBody:
      title: Transaction Types
      properties:
        parameters:
          $ref: '#/components/schemas/TransactionTypeParametersBody'
        type:
          $ref: '#/components/schemas/FilterType'
          example: TRANSACTION_TYPE
          default: TRANSACTION_TYPE
        reversed:
          type: boolean
          default: false
      required:
        - type
    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'
    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
    ListStringParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            type: string
    CountriesParameterBody:
      type: object
      description: A valid ISO-3166-1 alpha-3 country code.
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/countryCode'
    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
    AmountParametersBody:
      type: object
      properties:
        amount:
          type: string
          format: biginteger
          example: 100
        shouldTriggerPartialApproval:
          type: boolean
          example: 'false'
      required:
        - amount
    CardholderPresentParametersBody:
      type: object
      properties:
        cardholderPresent:
          type: boolean
      required:
        - cardholderPresent
    CardholderVerificationParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/cardholderVerificationType'
    TransactionTypeParametersBody:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/transactionType'
    countryCode:
      type: string
      format: iso3166-1-countrycode
      description: A valid ISO-3166-1 alpha-3 country code.
      example: FIN
    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
    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'

````