# Transactions

> A Transaction records any financial activity, including deposits, withdrawals, buys and sells, with its status and amounts.

## Overview

In the Business API, a `Transaction` represents a record of any financial activity, including deposits, withdrawals, buys, and sells.

The `Transaction` enables you to track and manage the details of the activities, once they have occurred.

You can find an overview of all transactions against your Business account in the [Business Dashboard](../getting-started/business-dashboard.md) and subscribe to [Transaction events](../api-concepts/webhooks/transactions) for updates on the status.

The Hosted Checkout experience guides your customers through Noah's user interface to complete transactions. To use this as a payment gateway for your customers, visit the [Hosted Checkout Journey](../recipes/payout/hosted-checkout).

## Transaction Lifecycle

### Status Transitions

A transaction progresses through the following statuses:

```
Pending --> Settled    (success - transaction is final)
Pending --> Failed     (failure - may trigger a refund)
```

| Status    | Meaning                                                                                                                                                                                                                                                                                                       | Finality                                                          |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `Pending` | Transaction has been created and is being processed. For payouts, this means the crypto-to-fiat conversion is underway. For payins, this means the fiat deposit has been received and compliance screening has started. While `Pending`, `SubStatus` and `RFI` may update and each change can emit a webhook. | Not final - status will change.                                   |
| `Settled` | Transaction completed successfully. Funds have been delivered to the destination.                                                                                                                                                                                                                             | **Final** - no further status changes under normal circumstances. |
| `Failed`  | Transaction could not be completed. For payins, a refund is initiated automatically. For payouts, funds are returned to your account. Check the `Refunds` array in the webhook payload for refund tracking.                                                                                                   | **Final** - check refund status for fund recovery.                |

:::tip
`Settled` represents transaction finality. Once a transaction reaches `Settled`, it is complete. In rare cases, a settled payout can later be reversed by a banking-level return. A reversal creates a **new** transaction (with a `Reverses` field linking to the original) delivered via webhook — the original transaction is not modified. See [Compliance Freezes, Refunds & Reversals](./compliance-freezes-refunds-reversals.md).
:::

### Transaction Types

Transactions are classified by `Direction` and `Network`:

| Direction | Network      | What It Represents                                                                    |
| --------- | ------------ | ------------------------------------------------------------------------------------- |
| `In`      | `OffNetwork` | Fiat-to-crypto conversion - fiat was received and crypto was credited to your account |
| `In`      | Chain name   | On-chain crypto deposit received from an external wallet                              |
| `Out`     | `OffNetwork` | Crypto-to-fiat payout - crypto was sold and fiat was sent to a bank account           |
| `Out`     | Chain name   | On-chain crypto withdrawal to an external wallet address                              |

### Correlating Related Events

In orchestrated flows (e.g., a payin that triggers automatic conversion and withdrawal), multiple transactions and webhooks are generated. Use these fields to correlate them:

| Field                                 | Purpose                                                        |
| ------------------------------------- | -------------------------------------------------------------- |
| `Orchestration.RuleExecutionID`       | Links all webhooks in a single orchestrated flow               |
| `FiatPayment.FiatDepositID`           | Links a conversion transaction to its originating fiat deposit |
| `AdjustmentFor.AdjustedTransactionID` | Links a refund transaction to the original                     |

For full webhook payload details, see [Transaction Event](./webhooks/transactions.md) and [FiatDeposit Event](./webhooks/fiat-deposits.md).

## Using Transactions

### Get Details of a Transaction

To retrieve details of a specific transaction, use the [`GET /transactions/:TransactionID`](../api-reference/transaction-by-id) endpoint in the Business API. This endpoint provides information about individual transactions, including their status and transaction details.

```typescript
curl -L 'https://api.sandbox.noah.com/v1/transactions/:TransactionID' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>'
```

To use this endpoint, supply the `TransactionID` obtained from the `/transactions/sell` or `/transactions/buy` endpoints, the [Transactions events](../api-concepts/webhooks/transactions), or from the [Business Dashboard](../getting-started/business-dashboard.md).

### Get All Transactions

Additionally, to view a list of all the transactions on your account, the [`GET /transactions`](../api-reference/transactions) endpoint offers paginated transaction history.

```typescript
curl -L 'https://api.sandbox.noah.com/v1/transactions' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>'
```

As described in the [`GET /transactions`](../api-reference/transactions) documentation, you can finetune the returned payload, such as by overriding the default sort order,
as shown below.

```typescript
curl -L 'https://api.sandbox.noah.com/v1/transactions?SortDirection=ASC' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>'
```

You can also filter by creation time with optional `CreatedFrom` and/or `CreatedTo` query parameters.

```typescript
curl -L 'https://api.sandbox.noah.com/v1/transactions?CreatedFrom=2024-01-01T00:00:00Z&CreatedTo=2024-01-31T23:59:59Z' \
-H 'Accept: application/json' \
-H 'X-Api-Key: <X-Api-Key>'
```

:::tip

For updates on transaction status, you are strongly recommended to subscribe to [Transactions events](../api-concepts/webhooks/transactions).

:::
