# 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` is accepted as a filter value, but the transactions module never sets it.

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

## 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
```

## 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

Gnosis Pay 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
