---
updatedAt: 2026-10-01T00:21:11.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Flex controls examples

The following examples show common flex control implementation scenarios that can be created with the [Create account flex control](https://developers.pismo.io/pismo-docs/reference/post-v1-accounts-flex-controls)  and [Create customer flex control](https://developers.pismo.io/pismo-docs/reference/post-v1-customers-flex-controls)  endpoints.

## Deny purchase by merchant category

This example denies purchases by merchant category code (MCC) for airlines carriers (4511) and travel agencies/tour operators (4722). The flex control evaluates and restricts a purchase when the `4511` and `4722` values are present in the request.

In this type of restrictive flex control,`type` is set to `restriction` and the following `conditions` are defined.

* `"attribute": "merchant_category_code"`
* `"operator": "in"` means "include". This setting causes the Pismo platform to return `true` if  `merchant_category_code` is equal to any of the MCC codes listed  in `value`.
* `"value": "4511, 4722"` lists applicable MCC codes.

```json JSON
{
    "id": "ecd6a1e7-a283-49d6-aa88-d8f4a9601f7b",
    "type": "restriction",
    "name": "restrict_airlines_and_travel",
    "conditions": [
        {
            "id": "950b76b9-eefb-41be-bde7-ef82a8c11821",
            "attribute": "merchant_category_code",
            "operator": "in",
            "value": "4511,4722"
        }
    ],
    "deny_code": "RESTRICT_BY_MCC",
    "active": true,
    "customized": true
}
```

## Deny purchase by entry mode

This example denies purchases by entry mode for contactless purchases on a terminal that is not capable of receiving a password. The entry mode in this case is `072`, where the first two characters `07` indicate contactless mode, and the third character `2` indicates that the terminal doesn't have PIN entry capability.

```json JSON
{
    "type": "restriction",
    "name": "restrict_purchase_contactless",
    "conditions": [
        {
            "attribute": "entry_mode",
            "operator": "eq",
            "value": "072"
        }
    ],
    "deny_code": "RESTRICT_BY_ENTRY_MODE",
    "active": true
}
```

## Define maximum usage limit

This example creates a maximum usage flex control for limiting the quantity of purchases per month to 100 transactions. The processing code `00` references purchase transactions.

```json
{
  "type": "usage_limit",
  "name": "limit_purchase_per_month",
  "processing_codes": [
    "00"
  ],
  "max_limit": 100,
  "limit_duration": "P1M",
  "deny_code": "MAX_USAGE_P1M",
  "active": true
}
```

## Restrict purchase authorizations within a time window

This example denies purchases made between 11:00 PM and 07:00 AM.

```json
{
  "type": "restriction",
  "name": "restrict_purchase",
  "description": "Deny purchases between 11:00 PM and 07:00 AM",
  "processing_codes": [
    "00"
  ],
  "conditions": [
     {
      "attribute": "time_now",
      "operator": "in",
      "value": "11:00PM-07:00AM"
    }
  ],
  "deny_code": "RESTRICT_BY_TIME",
  "active": true
}
```

## Limit the quantity of purchase transactions within a time window

This example limits the number of purchases to 10 transactions between 11:00 PM to 07:00 AM.

```json
{
  "type": "usage_limit",
  "name": "limit_purchase_night",
  "description": "Limit purchases to 10 transactions between 11:00 PM to 07:00 AM",
  "processing_codes": [
    "00"
  ],
  "conditions": [
    {
      "attribute": "time_now",
      "operator": "in",
      "value": "11:00PM-07:00AM"
    }
  ],
  "max_limit": 10,
  "limit_duration": "P1D", 
  "reset_period": 
    { 
       "time": "10:59PM" 
    },
  "deny_code": "MAX_USAGE_PURCHASE_NIGHT",
  "active": true
}
```

## Create flex control per transaction type

Use the `processing_codes` filter for the following purposes.

* Evaluate a flex control for a certain transaction type.
* Apply a flex control to several transaction types.
* Create different flex controls for different transaction types.

The following example creates a flex control for purchase (`00`) and withdrawal (`01`) transactions.

```json
{
  "type": "spending_limit",
  "name": "limit_amount_purchase",
  "processing_codes": [
    "00", "01"
  ],
  "max_limit": 49999,
  "limit_duration": "P1M",
  "deny_code": "MAX_VALUE_AMOUNT_P1M",
  "active": true
}
```

## Create flex control for a beneficiary overriding existing controls

This example does the following.

* Creates flex control for an account.
* Defines a beneficiary.
* Lists existing controls that the new spending control overrides.

```json
{
  "type": "spending_limit",
  "name": "Purchase 1 Month credit card",
  "beneficiary_id": "a10efbf9-e67c-4c3c-b52c-d1218427a81b",
  "override_controls": [
    "9186bafe-a077-4cab-bc42-08db41410d52",
    "12565ce9-050f-41d5-8c63-8d1a13c817ae"
  ],
  "processing_codes": [
    "007000"
  ],
  "max_limit": 49999,
  "limit_duration": "P1M",
  "deny_code": "MAX_VALUE_P1M",
  "active": true
}
```

## Pix and accounts

If you want to enable a different time range and limit for each account, set up the following control using the [Update account flex control](https://developers.pismo.io/pismo-docs/reference/patch-v1-accounts-flex-control) endpoint. In this example, the start time is changed from 8 PM to 10 PM and the limit is decreased from R$1,000 to R$500 for a specific account:

```json
{  
    "conditions": [  
        {  
            "id": "1c61caa5-ab07-48dd-9f56-8419090116d6",  
            "attribute": "time_now",  
            "operator": "in",  
            "value": "10:00PM-6:00AM"  
        }  
    ],  
    "max_limit": 50000,  
    "active": true,  
    "customized": true  
}
```

## Related topics

[Flexible transaction controls](https://developers.pismo.io/pismo-docs/docs/flex-controls)

[Simulate flex control creation](https://developers.pismo.io/pismo-docs/docs/simulate-flex-control-creation)

<br />