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

# Overview

We support a wide range of spend controls that enable you to control the usage of your cards for appropriate expenses. Enfuce supports the implementation of spend control through rules and rulesets.

## What are Rules?

A rule determines whether a card transaction will be approved, partially approved, or declined, based on the regulation configured. For example, the **DAILY AMOUNT ATM** rule specifies a limit on the total ATM withdrawals allowed per day — any withdrawal that exceeds this limit is declined.

## What are Rulesets?

A **ruleset** is a collection of rules. You can link a ruleset to a card program, which associates every card in the program with the ruleset. However, a card can also be linked directly to a ruleset,when there is a need to support multiple rulesets within the same program.

<Note>During project onboarding, your customer support representative will share with you the rule and the ruleset IDs.</Note>

By default, a ruleset is linked to a card program. If you want to link a ruleset with a specific card, mention the following parameters:

* `entities.id`: Unique identifier of the entity (card).

* `entities.type`: This implies that the entity is a specific card type (credit/debit).

<Info><strong>Related API Endpoint</strong>: [Create Entity Bindings](/api/spend-control/rule-sets/create-entity-bindings)</Info>

## Types of Spend Controls

<AccordionGroup>
  <Accordion title="Spending Limit Per Transaction">
    <div style={{marginLeft: '20px'}}>
      You can set a maximum limit per transaction. Examples of spending limits per transaction are:

      <ul>
        <li>1000: SINGLE AMOUNT ALL</li>
        <li> 1010: SINGLE AMOUNT ATM (applicable only ATM transactions) </li>
        <li> 1020: SINGLE AMOUNT RETAIL (applicable only for retail transactions) </li>
      </ul>
    </div>
  </Accordion>

  <Accordion title="Cumulative Spending Limits">
    <div style={{marginLeft: '20px'}}>
      <p>You can set spending limits for specific time periods, such as, daily,weekly,monthly, or yearly.
      You can also configure **rolling** amounts applicable for specific periods, such as, **1500: ROLLING\_HOURLY\_24 AMOUNT ALL AMOUNT** — a cumulative spending limit that is calculated over a 24 hour period; hence after every transaction processed during the preceding 24 hour period, the total remaining amount is recalculated.</p>

      <p>Example of how a rolling cumulative spending limit is calculated:</p>

      <p>**1610: ROLLING\_DAILY\_365 ATM AMOUNT**</p>

      Where:

      <ul>
        <li>AMOUNT: Cumulative transaction amount (for example, €1000)</li>
        <li>365 days: Total calculation period; the count can start at any time within a 365 day period.</li>
        <li>ATM: Allowed transaction type</li>
        <li>ROLLING\_DAILY: After every day, the cumulative amount is recalculated, based on the amount spent in the preceding period.</li>
      </ul>

      Examples of pre-configured cumulative rules are:

      <ul>
        <li>1320: MONTHLY RETAIL AMOUNT</li>
        <li>1600: ROLLING\_DAILY\_365 ALL AMOUNT</li>
        <li>1610: ROLLING\_DAILY\_365 ATM AMOUNT</li>
        <li>1611: ROLLING\_DAILY\_365 ATM COUNT</li>
      </ul>
    </div>
  </Accordion>

  <Accordion title="Regional Spending Limits">
    <div style={{marginLeft: '20px'}}>
      You can set a couple of location specific rules — allowed and/or blocked countries. Transactions occurring at the specific geographic locations are either approved or declined, based on what you have configured. Examples of location-specific rules are:

      <ul>
        <li>1700: ALLOWED\_COUNTRIES</li>
        <li>1701: BLOCKED\_COUNTRIES</li>
      </ul>
    </div>
  </Accordion>

  <Accordion title="Card Usage Specific Spending Limits">
    <div style={{marginLeft: '20px'}}>
      You can configure rules that approve or decline a transaction, based on the type of card usage (card entry modes). Example of card entry mode specific rules:

      <ul>
        <li>1710: ALLOWED\_CARD\_ENTRY\_MODES</li>
        <li>1720: BLOCK\_CARD\_PRESENT</li>
      </ul>
    </div>
  </Accordion>

  <Accordion title="Transaction Type Spending Limits">
    <div style={{marginLeft: '20px'}}>
      You can set a spending rule that declines a transaction of specific types. Example of transaction type specific rule is:

      <ul>
        <li>1730: BLOCKED\_TRANSACTION\_TYPES</li>
      </ul>
    </div>
  </Accordion>
</AccordionGroup>

<Note>To comply with fraud regulations, Enfuce provides you with specific spend controls that are configured during onboarding. As per the current implementation, you cannot override them. Discuss with your customer support representative to discuss the details.</Note>

## Rule IDs

Here is the entire list of rules pre-configured for your usage:

<Note>The third column represents the parameters that you can override for each rule.</Note>

| Code | Rule Name                         | Parameters Allowed for Overrides                                                                                                                                                                                                                                            |
| ---- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1000 | SINGLE AMOUNT ALL                 | Specific **amount** (for example, 100) allowed for all transaction types                                                                                                                                                                                                    |
| 1010 | SINGLE AMOUNT ATM                 | Specific **amount** (for example, 100) allowed for ATM transactions                                                                                                                                                                                                         |
| 1020 | SINGLE AMOUNT RETAIL              | Specific **amount** (for example, 100) allowed for Retail transactions                                                                                                                                                                                                      |
| 1100 | DAILY ALL AMOUNT                  | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                                       |
| 1101 | DAILY ALL COUNT                   | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                        |
| 1110 | DAILY ATM AMOUNT                  | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                                       |
| 1111 | DAILY ATM COUNT                   | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                        |
| 1120 | DAILY RETAIL AMOUNT               | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                                       |
| 1121 | DAILY RETAIL COUNT                | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: DAILY</li></ul>                                                                                                                                                        |
| 1200 | WEEKLY ALL AMOUNT                 | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                                      |
| 1201 | WEEKLY ALL COUNT                  | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                       |
| 1210 | WEEKLY ATM AMOUNT                 | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                                      |
| 1211 | WEEKLY ATM COUNT                  | <ul><li>First parameter: specific number of transactions (for example, 10) </li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                      |
| 1220 | WEEKLY RETAIL AMOUNT              | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                                      |
| 1221 | WEEKLY RETAIL COUNT               | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: WEEKLY</li></ul>                                                                                                                                                       |
| 1300 | MONTHLY ALL AMOUNT                | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                                     |
| 1301 | MONTHLY ALL COUNT                 | <ul><li>First parameter: specific number of transactions (for example, 10) (for example, 10)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                    |
| 1310 | MONTHLY ATM AMOUNT                | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                                     |
| 1311 | MONTHLY ATM COUNT                 | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                      |
| 1320 | MONTHLY RETAIL AMOUNT             | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                                     |
| 1321 | MONTHLY RETAIL COUNT              | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                      |
| 1400 | YEARLY ALL AMOUNT                 | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: YEARLY</li></ul>                                                                                                                                                                      |
| 1401 | YEARLY ALL COUNT                  | <ul><li>First parameter: specific number of transactions (for example, 10) </li><li>Second parameter: YEARLY</li></ul>                                                                                                                                                      |
| 1410 | YEARLY ATM AMOUNT                 | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: MONTHLY</li></ul>                                                                                                                                                                     |
| 1411 | YEARLY ATM COUNT                  | <ul><li>First parameter: specific number of transactions (for example, 10) </li><li>Second parameter: YEARLY</li></ul>                                                                                                                                                      |
| 1420 | YEARLY RETAIL AMOUNT              | <ul><li>First parameter: specific amount (for example, 100)</li><li>Second parameter: YEARLY</li></ul>                                                                                                                                                                      |
| 1421 | YEARLY RETAIL COUNT               | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: YEARLY</li></ul>                                                                                                                                                       |
| 1500 | ROLLING\_HOURLY\_24 ALL AMOUNT    | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the rolling period (for example, 24 hours)</li></ul>                                                                            |
| 1501 | ROLLING\_HOURLY\_24 ALL COUNT     | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the rolling period</li></ul>                                                                                      |
| 1510 | ROLLING\_HOURLY\_24 ATM AMOUNT    | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the total period</li></ul>                                                                                                      |
| 1511 | ROLLING\_HOURLY\_24 ATM COUNT     | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the total period</li></ul>                                                                                        |
| 1520 | ROLLING\_HOURLY\_24 RETAIL AMOUNT | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the total period</li></ul>                                                                                                      |
| 1521 | ROLLING\_HOURLY\_24 RETAIL COUNT  | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_HOURLY</li><li>Third parameter: Duration of the total period</li></ul>                                                                                        |
| 1600 | ROLLING\_DAILY\_365 ALL AMOUNT    | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the total period</li></ul>                                                                                                       |
| 1601 | ROLLING\_DAILY\_365 ALL COUNT     | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the total period (for example, 365 days)</li></ul>                                                                 |
| 1610 | ROLLING\_DAILY\_365 ATM AMOUNT    | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the total period (for example, 365 days)</li></ul>                                                                               |
| 1611 | ROLLING\_DAILY\_365 ATM COUNT     | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the total period (for example, 365 days)</li></ul>                                                                 |
| 1620 | ROLLING\_DAILY\_365 RETAIL AMOUNT | <ul><li>First parameter: specific amount (for example, 100) </li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the rolling period (for example, 365 days)</li></ul>                                                                             |
| 1621 | ROLLING\_DAILY\_365 RETAIL COUNT  | <ul><li>First parameter: specific number of transactions (for example, 10)</li><li>Second parameter: ROLLING\_DAILY</li><li>Third parameter: Duration of the rolling period (for example, 365 days)</li></ul>                                                               |
| 1700 | ALLOWED\_COUNTRIES                | ISO 3166-1 numeric codes to denote allowed countries                                                                                                                                                                                                                        |
| 1701 | BLOCKED\_COUNTRIES                | ISO 3166-1 numeric codes to denote countries where transactions are not allowed                                                                                                                                                                                             |
| 1710 | ALLOWED\_CARD\_ENTRY\_MODES       | Mention specific allowed card entry modes. Values are:<ul><li>UNKNOWN</li><li>MANUAL\_ENTRY</li><li>MAGNETIC\_STRIPE</li><li>CHIP</li><li>CHIP\_CONTACTLESS</li><li>ECOMMERCE</li><li>WALLET\_CONTACTLESS</li><li>WALLET\_ECOMMERCE</li><li>CREDENTIALS\_ON\_FILE</li></ul> |
| 1720 | BLOCK\_CARD\_PRESENT              | No specific parameter to mention                                                                                                                                                                                                                                            |
| 1730 | BLOCKED\_TRANSACTION\_TYPES       | Mention specific transaction types that are not allowed. Values are: <ul><li>RETAIL</li><li>ATM</li><li>UNIQUE</li><li>CASH\_DISBURSEMENT</li><li>BALANCE\_INQUIRY</li><li>P2P\_DEBIT</li><li>P2P\_CREDIT</li><li>CREDIT</li><li>CASHBACK</li><li>AFT</li></ul>             |

## Use Cases

<AccordionGroup>
  <Accordion title="Override Monthly ATM Spend">
    <div style={{marginLeft: `20px`}}>
      <ul>
        <li>**Rule ID and Name**: 1310 MONTHLY ATM AMOUNT</li>

        <li>**Operation**: Mention a specific monthly limit allowed for ATM transactions.</li>
      </ul>

      <div style={{marginLeft: '35px'}}>
        Send a request to the [Add Parameters by Rule ID Endpoint](/api/spend-control/rules/create-parameters-by-rule-id):

        ```

         POST /v1/rules/1310/parameters
         
          "entity" : {
          "id" : "<cardId>",
          "type" : "card"
          },
          "parameters" : [
         "1000", "MONTHLY"
         ]
        ```
      </div>
    </div>
  </Accordion>

  <Accordion title="Override to Block ATM and Cash Disbursements">
    <div style={{marginLeft: `20px`}}>
      <ul>
        <li>**Rule ID and Name**: 1730 BLOCKED\_TRANSACTION\_TYPES</li>

        <li>**Operation**: Block ATM and cash withdrawal transaction types.</li>
      </ul>

      <div style={{marginLeft: '35px'}}>
        Send a request to the [Add Parameters by Rule ID Endpoint](/api/spend-control/rules/create-parameters-by-rule-id):

        ```

         POST /v1/rules/1730/parameters
         
          "entity" : {
          "id" : "<cardId>",
          "type" : "card"
           },
          "parameters" : [
          "ATM", "CASH_DISBURSEMENT"
          ]

        ```
      </div>
    </div>
  </Accordion>

  <Accordion title="Retrieve Ruleset Details by Ruleset ID">
    <div style={{marginLeft: `20px`}}>
      Send a request to the [Get Ruleset by Ruleset ID Endpoint](/api/spend-control/rule-sets/get-rule-set-by-rule-set-id). Here is the endpoint response that you receive:

      ```

       {
       "id" :  "<rule-set-id>",
       "name" : "Standard Spend Control",
       "operatorType": "ALL",
       "rules" : [
         {
         "id" : 1310,
         "name" : "Monthly ATM cumulative amount",
         "type" : "CUMULATIVE_AMOUNT",
         "defaultParameters" : [
         "500", "MONTHLY"
         ],
          "filterType" : "ANY",
         "filters" : [
          {
           "id" : "<atm-filter-id>",
           "type" : "TRANSACTION_TYPE",
           "parameters" : [
             "ATM", "CASH_DISBURSEMENT"
           ],
           "reversed" : false
          }
         ]
       },
      {
       "id" : 1730,
       "name" : "Blocked transaction types",
       "type" : "BLOCKED_TRANSACTION_TYPES",
       "defaultParameters" : [],
       "filterType" : "ANY",
       "filters" : []
      }
      ...
      ...
      ...
      ]
      }
      ```
    </div>
  </Accordion>
</AccordionGroup>

## Additional Reference Information | Filters

<Accordion title="Filters">
  <div style={{marginLeft: '20px'}}>
    Filters determine the conditions when a rule is applicable, such as the transaction type. A rule can have multiple filters (`filters object`).

    <ul>
      <li>`filterType` determines whether a transaction must pass all filters or any filter (enums: `ANY`/`ALL`).</li>

      <li>`filters.type`: This determines the type of a specific filter, such as `TRANSACTION_TYPE`.</li>
    </ul>

    <Accordion title="Parameters">
      <div style={{marginLeft: "35px"}}>
        Filters include **parameters**. Parameters define the limits, thresholds, and configuration values. A rule can have a default set of parameters (`parameters`).

        <ul>
          <li>`filters.parameters`: Based on the type of each filter, it includes a list of parameters, such as , if the `filter.type` is `TRANSACTION_TYPE`, the `filters.parameters` can be `RETAIL` and `ATM`.</li>

          <li>`defaultParameters`: A rule can have a default set of parameters (`defaultParameters`). <Info>You can add, update, or delete the parameters included in a rule. The relevant endpoints are: <ul><li>[Add Parameters to Rule](/api/spend-control/rules/create-parameters-by-rule-id)</li><li>[Update Parameters](/api/spend-control/rules/update-parameters-for-rules)</li><li>[Delete Parameters](/api/spend-control/rules/delete-parameters-for-rules)</li></ul></Info></li>

          <li>`parameters.entity`: A parameter can either be associated with a card or a card program.</li>
        </ul>
      </div>
    </Accordion>

    <Callout icon="lightbulb" color="#FFC107" iconType="regular">When you are retrieving details of a rule, in the endpoint response, you can view details relevant to filters. However, these values are applicable only for Advanced Spend Control.</Callout>

    **Example**:

    1210: WEEKLY ATM AMOUNT

    * `id`: `1210`
    * `type`: `AMOUNT`
    * `filters.type`: `TRANSACTION_TYPE`
    * `filters.parameters`: `ATM`

    <Note>You can send a request to the [Add Parameters by Rule ID Endpoint](/api/spend-control/rules/create-parameters-by-rule-id) to mention a specific weekly amount allowed for ATM transactions, such as €100.</Note>
  </div>
</Accordion>
