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

# State Machine

> How a collect moves through its possible states from creation to a terminal outcome

Every collect moves through a defined set of states from the moment funds are detected to the point where they are credited (or returned). Understanding these states helps you build robust reconciliation, alerting, and customer-facing flows.

***

## Possible Paths

A collect can take one of the following paths:

### Virtual Accounts and Wallets

* **Incoming Payment → Succeeded** — credited directly.
* **Incoming Payment → Failed** — failed directly.
* **Incoming Payment → Compliance Hold → Succeeded** — placed on hold, then credited.
* **Incoming Payment → Compliance Hold → Failed** — placed on hold, then rejected.

### Wallets Only

* **Incoming Payment → Compliance Hold → Detected → Succeeded** — placed on hold, detected on-chain, then credited.
* **Incoming Payment → Compliance Hold → Detected → Failed** — placed on hold, detected on-chain, then rejected.

The `Detected` state is specific to stablecoin wallets and indicates that the blockchain transaction has been seen but is awaiting final confirmation.

***

## Diagram — Virtual Accounts

<Frame>
  <img src="https://mintcdn.com/tazapay-58ae360f/HgUgkiM58uq4iY2C/images/diagrams/collect-state-virtual-accounts.png?fit=max&auto=format&n=HgUgkiM58uq4iY2C&q=85&s=29fa8975af98d57ac50e4f71e4cab918" alt="Collect state machine for Virtual Accounts" width="1960" height="728" data-path="images/diagrams/collect-state-virtual-accounts.png" />
</Frame>

## Diagram — Stablecoin Wallets

`Detected` is optional — Compliance Hold can transition directly to Succeeded or Failed without going through Detected.

<Frame>
  <img src="https://mintcdn.com/tazapay-58ae360f/HgUgkiM58uq4iY2C/images/diagrams/collect-state-stablecoin-wallets.png?fit=max&auto=format&n=HgUgkiM58uq4iY2C&q=85&s=96c36cb18c61813dd7ccda337d1bb1c7" alt="Collect state machine for Stablecoin Wallets" width="1960" height="728" data-path="images/diagrams/collect-state-stablecoin-wallets.png" />
</Frame>

***

## What Each State Means

The states below describe where an individual **collect** (incoming payment) is in its lifecycle.

| State               | Meaning                                                                                                                                                                                           |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Compliance Hold** | The collect is paused while Tazapay completes compliance and screening checks. It can resolve to Succeeded or Failed (or to Detected first, for stablecoin wallets).                              |
| **Detected**        | *(Stablecoin wallets only)* The blockchain transaction has been seen on-chain but is awaiting final confirmation before the funds are credited.                                                   |
| **Succeeded**       | *(Terminal)* The funds have cleared all checks and have been credited to the balance.                                                                                                             |
| **Failed**          | *(Terminal)* The collect could not be completed — for example, it was rejected during compliance — and the funds are returned. See [Reversals](/collection-accounts/incoming-payments/reversals). |

***

## See Also

<CardGroup cols={3}>
  <Card title="Compliance Holds" icon="shield-halved" href="/collection-accounts/incoming-payments/compliance-holds">
    How compliance holds work and how to subscribe to them.
  </Card>

  <Card title="Reversals" icon="rotate-left" href="/collection-accounts/incoming-payments/reversals">
    What happens when a collect fails.
  </Card>

  <Card title="Webhooks" icon="bell" href="/collection-accounts/incoming-payments/webhooks">
    Track state transitions via webhook events.
  </Card>
</CardGroup>
