# Enums & State Machines

The status values the API returns, and how a resource moves between them.

## Overview

Statuses are strings, and different resources use different words for similar states — `confirmed` for transactions, `completed` for the bank ramp deposits and payouts. Treat a value you don't recognise as not final, and read the resource again before showing an outcome to the user.

## Transaction

Values: `pending`, `confirmed`, `failed`, `cancelled`. A transaction starts as `pending` and is resolved from the chain to `confirmed` or `failed`; a custodial send that can't be submitted is stored as `failed`. `cancelled`: its operation was cancelled before anything was broadcast ([Cancel an Operation](https://docs.aureahub.com/docs/operation-cancel.md)), or a drop of it was mined ([Drop](https://docs.aureahub.com/docs/operation-drop.md)) — both act on recorded operations only ([Operations and Fees](https://docs.aureahub.com/docs/guide-operations.md)).

```text
pending ──► confirmed
     │
     ├──► failed
     └──► cancelled
```

## Swap

Swaps are stored as transactions with `type: "swap"`. Values: `pending` → `confirmed` | `failed`. Solana swaps and completed gasless swaps are returned already `confirmed`. An expired quote is not a status: the call fails with `400` and a message starting with `QUOTE_EXPIRED`.

```text
pending ──► confirmed
     │
     └──► failed
```

## Operation

Returned by [List Operations](https://docs.aureahub.com/docs/operations-list.md) and [Get an Operation](https://docs.aureahub.com/docs/operation-get.md) — empty until Aurea turns operation recording on ([Operations and Fees](https://docs.aureahub.com/docs/guide-operations.md), where every sub-state is listed). `state` only moves forward:

```text
SUBMITTED ─► PENDING_SCREENING ─► PENDING_ENRICHMENT ─► PENDING_POLICY ─► PENDING_AUTHORIZATION ─► QUEUED
  ─► PENDING_SIGNATURE ─► SIGNED ─► BROADCASTING ─► CONFIRMING ─► COMPLETED

  any state not final ─► FAILED or CANCELLING ─► CANCELLED, COMPLETED or FAILED
  up to SIGNED ─► CANCELLED      up to QUEUED ─► BLOCKED      up to PENDING_SIGNATURE ─► REJECTED
```

Final: `COMPLETED`, `CANCELLED`, `BLOCKED`, `REJECTED`, `FAILED`. An operation is `CANCELLED` when its initiator cancels it before anything was sent ([Cancel an Operation](https://docs.aureahub.com/docs/operation-cancel.md)) or a drop of its transaction is mined, and `CANCELLING` while that drop is on its way ([Drop](https://docs.aureahub.com/docs/operation-drop.md), switched off until Aurea turns it on). Only a tenant on the institutional security profile, whose policy is enforced, sees one `BLOCKED` (by its policy) or `REJECTED` (by an approver). `legacyStatus` — the transaction's `status` — is `confirmed` once `COMPLETED`, `failed` after `FAILED`, `BLOCKED` or `REJECTED`, `cancelled` after `CANCELLED`, and `pending` until then.

## Policy Set

Returned by the [policy set](https://docs.aureahub.com/docs/guide-policy-sets.md) routes. Only a draft's rules change; a submitted, active or archived version never does.

```text
draft ──► awaiting_quorum ──► active ──► archived   (another version published in its place)
  │              │
  └──────────────┴──► archived                     (withdrawn)
```

## Bank Ramp Onboarding (KYC)

Returned by [Onboarding Status](https://docs.aureahub.com/docs/payin-status.md) and [Sync KYC Status](https://docs.aureahub.com/docs/payin-sync-status.md).

- `kycStatus`: `not_started`, `pending`, `approved`, `rejected`.
- `onboardingStatus`: `not_started`, `pending`, `in_progress`, `completed`, `failed`.
- the bank ramp's verification result maps to Approved → `approved` / `completed`, Pending → `pending` / `pending`, Declined → `rejected` / `failed`.
- A status never moves back: an approved user stays approved when the bank ramp later reports Pending (as it does for another currency), and `rejected` is final.
- `canInitiateDeposit` is `true` only when `onboardingStatus` is `completed` and `kycStatus` is `approved`.
- `verification.nextStep`: `start_onboarding`, `continue_onboarding`, `wait_for_review`, `approved`, `rejected` — see [Onboarding Status](https://docs.aureahub.com/docs/payin-status.md).

```text
not_started ──► pending ──► approved ──► rejected   (onboardingStatus: completed, then failed)
                     │
                     └──► rejected                (onboardingStatus: failed)
```

## Bank Deposit

Returned by [Get Deposits](https://docs.aureahub.com/docs/payin-deposits.md). Values: `pending`, `completed`, `failed`, `under_review`, `refunded`. A deposit becomes `completed` when the bank ramp's `FiatDeposit` webhook reports it as settled, and `failed` when the bank ramp reports it failed; until then it stays `pending`.

## Bank Pay-in Transaction

Returned by [Get Transactions](https://docs.aureahub.com/docs/payin-transactions.md). `transactionType`: `purchase`, `withdrawal`, `refund`. `status`: `pending`, `completed`, `failed`, `cancelled`.

## Bank Payout

Returned by [Get Payout Transaction](https://docs.aureahub.com/docs/payout-get.md). A payout is `pending` from creation until the bank ramp reports progress; the other statuses are set by the bank ramp's `Transaction` events for the payout, whose `ExternalID` names it. A status never moves back. `cancelled` stays in the list of values, but no the bank ramp event sets it.

```text
pending ──► processing ──► completed      (Transaction Pending → processing, Settled → completed)
     │            │
     │            └──► failed          (Transaction Failed)
     └──► completed or failed          (a Settled or Failed that arrives first)
```

## EURe Onboarding

The card issuer's onboarding status, returned by `GET /v1/gnosis/local-status`: `pending` → `terms_accepted` → `kyc_completed` → `source_of_funds_completed` → `mobile_verified` → `active`.

---

Web version: https://docs.aureahub.com/#enums-states
