> ## Documentation Index
> Fetch the complete documentation index at: https://direct-api.reap.global/llms.txt
> Use this file to discover all available pages before exploring further.

# Spend controls

> spendCap is a top-up card's total budget; spendControl limits throttle spending per transaction and per period; restriction limits the hours and merchant categories a card can be used in. Each is a full replacement.

Cards have two separate controls: a budget and throttles. A third, `restriction`, limits when and where a card can be used.

## `spendCap`: the budget

The total amount a `topUp` card can ever spend. Setting it via
[Update spend control](https://direct-api.reap.global/api-reference/cards/update-spend-control.md) replaces
the **total**, not an increment: to add USD 1,000 to a USD 1,500 cap, send
`2500.00`. A cap below what's already been spent fails with
`400 SPEND_CAP_TOO_LOW`.

## `spendControl.limits`: the throttles

Optional per-transaction and per-period limits, evaluated on top of the
budget:

| Key | Type | Notes |
| - | - | - |
| `transaction` | money | Maximum per single payment |
| `daily` | money | Maximum per day |
| `weekly` | money | Maximum per week |
| `monthly` | money | Maximum per month |
| `yearly` | money | Maximum per year |
| `lifetime` | money | Maximum over the card's life |

Each limit is an `{ "amount": "100.00", "currency": "USD" }` pair. The API
reports what each period has already used under `spendControl.spent`, so you
can compare `spent.monthly` against `limits.monthly`.

## Replace semantics

`PUT /cards/{cardId}/spend-control` replaces the whole object: send every
limit you want to keep; a limit you omit is removed.
`PUT /cards/{cardId}/restriction` works the same way. See
`restriction.category` below.

## `restriction.time`

Separately, `restriction.time` limits the **hours of day** a card can be
used, in UTC. For example `{ "start": "09:00", "end": "18:00" }`. Managed
with [Update restriction](https://direct-api.reap.global/api-reference/cards/update-card-usage-restriction.md).

## Card category and transaction category

Two different settings are called "category". Only one of them limits where a
card can be used.

| | Card category | Transaction category |
| - | - | - |
| What it describes | What the card is for, such as Travel or Software | The merchant of one charge, such as `advertising_and_marketing` |
| Who sets it | You, when you create the card. Pass `category` with an `id` from [List card categories](https://direct-api.reap.global/api-reference/cards/list-card-categories.md) | Reap maps each charge to one automatically, from the card network's merchant data |
| Can it change? | No, not after the card is created | Your team can correct it on a transaction in the dashboard |
| Limits where the card can be used? | No. It only labels the card | Yes, when you list it in `restriction.category` |

## `restriction.category`

`restriction.category` is an allowlist. The card can only be used at merchants
whose transaction category is in `values`. Set it with
[Update restriction](https://direct-api.reap.global/api-reference/cards/update-card-usage-restriction.md):

```json theme={"system"}
{ "category": { "allow": true, "values": ["advertising_and_marketing"] } }
```

Card responses show it as `restriction.category`: `{ allow, values }`, or
`null` when the card has none.

* `allow` is required. Only `true` is accepted for now.
* `values` holds `code` values from
  [List transaction categories](https://direct-api.reap.global/api-reference/cards/list-transaction-categories.md).
  Don't send the `id`.
* Allowing a category allows every charge Reap maps to it.
* `other` and `on_off_ramp_fees` are in the list, but you can't use them in
  `restriction.category`. They return `422 CATEGORY_NOT_FOUND`, as does any
  unknown code. `details.codes` in the error lists the codes that were not
  accepted.
* `allow: false`, `category: null`, and an empty or duplicate `values` list
  return `400`. To remove the category restriction, leave `category` out.
* The body accepts only `time` and `category`. Any other field, such as a
  misspelled `categroy`, returns `400` and changes nothing.
* Your business needs category restrictions enabled. If it doesn't, setting
  `category` returns `400 CATEGORY_RESTRICTIONS_NOT_ENABLED`. A request that
  sets only `time` still works.

### How the restriction behaves

* A new card has no category restriction. [Create card](https://direct-api.reap.global/api-reference/cards/create-card.md)
  takes only a card category, so set the restriction with the PUT before you
  hand out the card details.
* The PUT replaces the whole restriction. Leaving out `category` removes the
  category restriction. Leaving out `time` removes the time window. Send both
  when you want both.
* Correcting a transaction's category changes that transaction only. The next
  charge is checked the same way as before.

> [!WARNING]
>
> For now, editing a card in the Reap dashboard removes its category
> restriction. Set it again through the API after a dashboard edit.

For a worked example, see
[Cards for advertising at scale](https://direct-api.reap.global/guides/issue-cards-for-advertising.md).

## Related endpoints

* [Update spend control](https://direct-api.reap.global/api-reference/cards/update-spend-control.md)
* [Update restriction](https://direct-api.reap.global/api-reference/cards/update-card-usage-restriction.md)
* [List card categories](https://direct-api.reap.global/api-reference/cards/list-card-categories.md)
* [List transaction categories](https://direct-api.reap.global/api-reference/cards/list-transaction-categories.md)
* [Cards](https://direct-api.reap.global/concepts/cards.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.