# Card Controls
source: https://developer.mastercard.com/commercial-connect-api/documentation/use-cases/card-controls/index.md

Card controls can ensure that card usage is limited to specific use cases. A single control set or multiple sets of controls can be associated with any real or any virtual card.

Use a single set of card controls to limit the card usage to a specific use case only, such as:

* You want to use your card only for quarterly recurring payments. In this case, use the quarterly limit control and set the transactionCount = 1. Include controls such as countries and merchant category codes to limit countries and industry verticals.

Use the multiple sets of controls on a card to limit the card usage to multiple expenses within a limited scope. These examples show how you can use multiple sets of card controls on a single card:

* You want to use a card for booking and paying for a work trip. In this case, set up one set of controls with a validity period and other relevant controls for when hotel and airfare reservations are made. Set up a second set of controls with a validity period and other relevant controls so the card can be used for expenses during the business trip.

* You want to use the same card to pay multiple suppliers at different times in the quarter. In this case, set up a control set for each supplier using the merchant category control or merchantId control. Set up the validity period that matches the time frame when the payments need to happen.

Note: In the following diagrams, optional steps are denoted with dashed arrows instead of solid arrows.

## Manage real card authorization controls {#manage-real-card-authorization-controls}

Partners use these endpoints to update or remove the authorization controls of a real card.
Diagram rccontrols
API Reference: `PUT /accounts/real-cards/{account_id}/card-controls`


API Reference: `DELETE /accounts/real-cards/{account_id}/card-controls`

## Update virtual card controls {#update-virtual-card-controls}

Partners use this endpoint to modify virtual card authorization controls for a specific virtual card.
Diagram vcnupdatecontrols
API Reference: `PUT /accounts/virtual-cards/{account_id}/card-controls`

## How to use the aging limit and period limit controls {#how-to-use-the-aging-limit-and-period-limit-controls}

Both `agingLimit` and period limits (such as weekly or quarterly) have a `spendAmount` element that limits how much can be charged to a card. Determining when to use the `agingLimit.spendAmount` or period limit `spendAmount` depends on your use case.

The main difference between the `spendAmount` in the period limits and the `agingLimit` is the time frame that the `spendAmount` is evaluated for. For example, the system evaluates the `spendAmount` for a weekly limit within the context of each week. However, to use the `agingLimit.spendAmount`, you need to set `authorizationHoldDays`, which allows you set the number of days each authorization is counted against the `spendAmount` set in the control.

### Available balance {#available-balance}

Available balance is an element of both `agingLimit` and period limit controls. The system calculates the available balance based on the `spendAmount` limit and the duration of the limit that you have specified, and the amount spent.

The system evaluates the `agingLimit.availableBalance` in the context of the `agingLimit.authorizationHoldDays`, and in combination with the `agingLimit.spendAmount`. In this case, the available balance represents the amount that can be spent within the time frame that you have specified in `authorizationHoldDays`, before it resets to the amount you have specified in the `agingLimit.spendAmount`.

Consider this example:

|               If ...               |                And ...                 |                And ...                 |                            Then ...                            |
|------------------------------------|----------------------------------------|----------------------------------------|----------------------------------------------------------------|
| `agingLimit.spendAmount` = USD 100 | `agingLimit.authorizationHoldDays` = 5 | authorization is made today for USD 40 | `agingLimit.availableBalance` is USD 60 for the next five days |

If no other authorizations are made on the card, on the sixth day the available balance of USD 40 resets to USD 100, which is the value you have set in the `agingLimit.spendAmount`.

Available balance in the context of period limit controls represents the remaining balance within your period limit. For example, `weeklyLimit.availableBalance` represents the remaining balance within the current weekly period.

Consider this example:

|                 If ...                  |                                 Then ...                                  |
|-----------------------------------------|---------------------------------------------------------------------------|
| `weeklyLimit.availableBalance` = USD 50 | total authorizations in the current week can't add up to more than USD 50 |

In other words, `weeklyLimit.availableBalance` reflects the spendAmount for all authorizations in the current week.

### Example of when to use the aging limit spend amount {#example-of-when-to-use-the-aging-limit-spend-amount}

The `agingLimit.spendAmount` element allows you to set the maximum amount that can be spent on the card, either at one time or in multiple transactions within the time frame defined by `agingLimit.authorizationHoldDays`.

Consider this example:

|              If ...               |                And ...                 |                And ...                 |                            Then ...                            |
|-----------------------------------|----------------------------------------|----------------------------------------|----------------------------------------------------------------|
| `agingLimit.spendAmount` = USD 50 | `agingLimit.authorizationHoldDays` = 4 | authorization is made today for USD 35 | `agingLimit.availableBalance` is USD 15 for the next four days |

On the fifth day assuming no other authorizations have been made on the card, the USD 35 authorization will "age off" and the `agingLimit.availableBalance` will go back to USD 50.

### Example of when to use the aging limit with other controls {#example-of-when-to-use-the-aging-limit-with-other-controls}

Consider that you want to limit the weekly spending to USD 50 and also that each quarter or month, the spend is no more than USD 200.

|          If ...          |                 And ...                 |                              Then ...                               |
|--------------------------|-----------------------------------------|---------------------------------------------------------------------|
| weekly spending = USD 50 | quarterly spend is no more than USD 200 | set the weekly control to USD 50 and the quarterly limit to USD 200 |

To limit weekly authorizations to USD 50 and to ensure that no more than USD 200 was authorized in the same 30-day window, use the weekly and aging limit controls, as shown in this table:

|           If ...            |                         Then ...                         |
|-----------------------------|----------------------------------------------------------|
| USD 50 was authorized today | no more than USD 150 could be spent for the next 30 days |

The authorization will be declined if any of the limit controls in a set of card controls fail. As a result, if you set both the weekly and aging limit and one passes but the other one does not, the system will decline the authorization.
