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

# Get rule set by entity id

> Returns rule sets by entity.



## OpenAPI

````yaml json-files/standard-spend-control-v1.openapi.json get /v1/rule-sets/by-entity/{entity-id}/{entity-type}
openapi: 3.0.3
info:
  title: Standard Spend Control API
  description: API for managing standard spend control rules
  version: 1.0.0
servers:
  - url: https://api.{{tenant}}.ext-uat1-sandbox.mycore.enfuce.com/processor
    description: UAT Sandbox
  - url: https://api.{{tenant}}.eu.live.prod.mycore.enfuce.com/processor
    description: Production
security: []
tags:
  - name: RuleSets
    description: Rule Sets are collections of rules bound the entities.
  - name: Rules
    description: >
      Rules define the actual spend control rule that is applied to request.
      Rules can have filter that determine if  the rule should be processed.
  - name: Parameters
paths:
  /v1/rule-sets/by-entity/{entity-id}/{entity-type}:
    get:
      tags:
        - RuleSets
      description: Returns rule sets by entity.
      operationId: getRuleSetsByEntity
      parameters:
        - name: entity-id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/EntityId'
        - name: entity-type
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/EntityType'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RuleSet'
components:
  schemas:
    EntityId:
      type: string
      description: >-
        Either the card id or a concatenation of the program id with the card
        configuration code in the form of "{programId}:{cardConfigurationCode}".
      example: a8d8374f-0fd2-444d-a331-c345bf4948da:DEBIT
    EntityType:
      type: string
      format: enum
      enum:
        - card
        - program_application
      x-enum-varnames:
        - card
        - program_application
    RuleSet:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        name:
          type: string
          example: rule_set_for_a_product
        operatorType:
          $ref: '#/components/schemas/RuleSetOperatorType'
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RuleSetRule'
    Id:
      type: integer
      format: int64
    RuleSetOperatorType:
      type: string
      description: >-
        Defines whether all rules should pass or if it's enough for just one
        rule to pass.
      enum:
        - ANY
        - ALL
      example: ALL
    RuleSetRule:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        name:
          type: string
          example: daily_atm_amount
        type:
          type: string
        defaultParameters:
          $ref: '#/components/schemas/RuleParameterList'
        filterType:
          $ref: '#/components/schemas/FilterType'
        appliesTo:
          $ref: '#/components/schemas/EntityType'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/RuleFilter'
    RuleParameterList:
      type: array
      description: >
        List of parameters. Type of parameters is validated dynamically based on
        the rule they are applied to:

        - AMOUNT: ["100"] - the first parameter is the amount to limit for a
        single transaction

        - CUMULATIVE_AMOUNT (non-rolling / over a fixed period) : ["100",
        "DAILY"] - the first parameter is the cumulative amount to limit for the
        period provided as the second parameter, which must be one of DAILY,
        WEEKLY, MONTHLY, QUARTERLY, YEARLY

        - CUMULATIVE_AMOUNT (rolling / over a moving window):  - ["100",
        "ROLLING_DAILY", "24"] - the first parameter is the cumulative amount to
        limit for the period provided as the second parameter, which must be one
        of ROLLING_HOURLY, ROLLING_DAILY; the third is the duration of the
        period

        - ALLOWED_COUNTRIES: ["246", "752"] - the countries are represented by
        ISO 3166-1 numeric codes

        - BLOCKED_COUNTRIES: ["364", "643"] - the countries are represented by
        ISO 3166-1 numeric codes

        - ALLOWED_CARD_ENTRY_MODES: ["CHIP"] - at least one of UNKNOWN,
        MANUAL_ENTRY, MAGNETIC_STRIPE, CHIP, CHIP_CONTACTLESS, ECOMMERCE,
        WALLET_CONTACTLESS, WALLET_ECOMMERCE, CREDENTIALS_ON_FILE

        - BLOCK_CARD_PRESENT: no parameters

        - BLOCKED_TRANSACTION_TYPES: ["ATM"] - at least one of RETAIL, ATM,
        UNIQUE, CASH_DISBURSEMENT, BALANCE_INQUIRY, P2P_DEBIT, P2P_CREDIT,
        CREDIT, CASHBACK, AFT
      items:
        type: string
      example:
        - '100'
        - MONTHLY
    FilterType:
      type: string
      description: >-
        Defines whether all filters should match or if it's for just one filter
        to pass.
      enum:
        - ANY
        - ALL
      example: ALL
    RuleFilter:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/Id'
        type:
          type: string
          example: TRANSACTION_TYPE
        parameters:
          $ref: '#/components/schemas/FilterParameterList'
        reversed:
          type: boolean
    FilterParameterList:
      type: array
      description: >-
        List of parameters. Type of parameters is validated dynamically based on
        the filter they are applied to.
      items:
        type: string
      example:
        - ATM

````