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

# State machines and freezing

> The four state sets in one place: the application state machine shared by companies, employees and cards; the merged company/employee status view; the 7-state card machine; and the set semantics of the 5 freeze capability domains.

## 📄 Guide

Onboarding, employee creation and issuing each have their own state machine; freezing is a capability-domain switch layered on top. This page covers them all, so the status fields in later endpoints map straight onto it.

## The application state machine

Company, employee and card applications share one state machine with three states: `PENDING` / `SUCCEED` / `REJECTED`. After a rejection, resubmit under the same the application ID (see [Compliance and KYC](./compliance-kyb-kyc)).

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/dcs-0bf7a937/_4q96txtGLVP3b4d/imgs/en/diagrams/corp-apply-states-light.svg?fit=max&auto=format&n=_4q96txtGLVP3b4d&q=85&s=8a56af2b01c82a17d33fd51fdb0c64af" alt="Application state machine" width="520" height="254" data-path="imgs/en/diagrams/corp-apply-states-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/dcs-0bf7a937/_4q96txtGLVP3b4d/imgs/en/diagrams/corp-apply-states-dark.svg?fit=max&auto=format&n=_4q96txtGLVP3b4d&q=85&s=d40cc4626accdf7666e1354164546641" alt="Application state machine" width="520" height="254" data-path="imgs/en/diagrams/corp-apply-states-dark.svg" />
</Frame>

## The company / employee state machine

Presented as one merged status field: a life-cycle state (`ACTIVE` / `TERMINATED`) overlaid with behavioral states (`FROZEN` / `SUSPENDED` / `RESTRICTED`). Whether an entity can open cards or spend is judged by whether it is `ACTIVE`.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/dcs-0bf7a937/oUoeUKtwWWK2o-Li/imgs/en/diagrams/corp-entity-states-light.svg?fit=max&auto=format&n=oUoeUKtwWWK2o-Li&q=85&s=2b42a5e302f0c81fbe87125aa6e587e3" alt="Company and employee state machine" width="781" height="218" data-path="imgs/en/diagrams/corp-entity-states-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/dcs-0bf7a937/oUoeUKtwWWK2o-Li/imgs/en/diagrams/corp-entity-states-dark.svg?fit=max&auto=format&n=oUoeUKtwWWK2o-Li&q=85&s=e3b5565c4e68093bf502bc0e99844738" alt="Company and employee state machine" width="781" height="218" data-path="imgs/en/diagrams/corp-entity-states-dark.svg" />
</Frame>

## The card state machine

7 states, shared by virtual and physical cards. Every state change pushes a card-status-change notification (activation is pushed separately as `CARD_ACTIVATED`); see the webhook event table in the API reference for event names.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/dcs-0bf7a937/-R6Uu859229Ion98/imgs/en/diagrams/corp-card-states-light.svg?fit=max&auto=format&n=-R6Uu859229Ion98&q=85&s=7b68264c790691093cdd51c6db7d91c9" alt="Card state machine" width="648" height="444" data-path="imgs/en/diagrams/corp-card-states-light.svg" />

  <img className="hidden dark:block" src="https://mintcdn.com/dcs-0bf7a937/-R6Uu859229Ion98/imgs/en/diagrams/corp-card-states-dark.svg?fit=max&auto=format&n=-R6Uu859229Ion98&q=85&s=46b1f32e11458f841f58add64800613a" alt="Card state machine" width="648" height="444" data-path="imgs/en/diagrams/corp-card-states-dark.svg" />
</Frame>

## Freeze capability domains

5 domains, applicable to companies and employees. Adding a state freezes, removing it unfreezes — idempotent set semantics; restricted states written by risk, regulatory or judicial action cannot be lifted this way.

| Domain code       | What freezing disables                                                                              |
| ----------------- | --------------------------------------------------------------------------------------------------- |
| `ACCOUNT_FROZEN`  | The account as a whole (login, password change, phone / email change, MFA binding, account closure) |
| `CASH_IN_FROZEN`  | Deposits / top-ups                                                                                  |
| `CASH_OUT_FROZEN` | Withdrawals / payouts / remittances                                                                 |
| `PAYMENT_FROZEN`  | Payments / spending (including card payments)                                                       |
| `CARD_FROZEN`     | Card management actions (applying, activating, changing PIN)                                        |

Freezing has two granularities: freezing a card stops only that card, while freezing an employee makes every card under them decline. The endpoints are in [Company status and alerts](../how-to-use/company-maintenance) and [Employee information and status](../how-to-use/employee-maintenance).

## Next steps

* A transaction's full journey from hold to posting: [The transaction life cycle](./transaction-lifecycle)
* KYB / KYC subjects, resubmission and uniqueness rules: [Compliance and KYC](./compliance-kyb-kyc)
