# Transactions

## <mark style="color:blue;">Transaction Object</mark>

The following endpoints (`POST Transfers` and `POST Transaction Details`) use a shared **Transaction Object** for their responses. Below is the structure of the **Transaction Object**:

**Fields:**

| Field                | Type                                                                          | Description                                                |
| -------------------- | ----------------------------------------------------------------------------- | ---------------------------------------------------------- |
| fromAddress          | string                                                                        | Sending address                                            |
| toAddress            | string                                                                        | Receiving address                                          |
| layer                | [TransactionLayer](https://docs.akashicpay.com/references#transactionlayer)   | Transaction layer (`L1Transaction` or `L2Transaction`)     |
| initiatedAt          | string                                                                        | Date in ISO8601 format                                     |
| confirmededAt        | string                                                                        | Confirmed date in ISO8601 format                           |
| amount               | string                                                                        | Transaction amount (as a string to avoid precision issues) |
| coinSymbol           | [NetworkSymbol](https://docs.akashicpay.com/references#networksymbol)         | Network (L1) of the transaction (e.g., `ETH`)              |
| status               | [TransactionStatus](https://docs.akashicpay.com/references#transactionstatus) | Transaction status (`Pending`, `Confirmed`, or `Failed`)   |
| txHash               | string                                                                        | Network's hash for L1 transactions (optional for L2)       |
| feesPaid             | string                                                                        | Gas fee paid on network (optional for L2)                  |
| l2TxnHash            | string                                                                        | Akashic transaction hash (for both L1 and L2)              |
| tokenSymbol          | [TokenSymbol](https://docs.akashicpay.com/references#tokensymbol)             | Token symbol for token transactions (optional)             |
| reason               | string                                                                        | Reason for failure (if status is `Failed`)                 |
| internalFee          | object                                                                        | Akashic fee details (optional)                             |
| internalFee.deposit  | string                                                                        | Deposit fee (optional)                                     |
| internalFee.withdraw | string                                                                        | Withdraw fee (optional)                                    |
| identifier           | string                                                                        | User identifier for deposits (optional)                    |

Example:

```json
{
  "fromAddress": "string",
  "toAddress": "string",
  "layer": "string",
  "initiatedAt": "string",
  "confirmededAt": "string",
  "amount": "string",
  "coinSymbol": "string",
  "status": "string",
  "txHash": "string",
  "feesPaid": "string",
  "l2TxnHash": "string",
  "tokenSymbol": "string",
  "reason": "string",
  "internalFee": {
    "deposit": "string",
    "withdraw": "string"
  },
  "identifier": "string"
}

```

## <mark style="color:blue;">Get Transaction Details</mark>

**Endpoint:** `POST /getTransactionDetails`

**Description:** Retrieves details of an individual transaction. Returns `null` if no transaction is found for the queried hash.

**Request Parameters:**

| Parameter | Type   | Required | Description                             |
| --------- | ------ | -------- | --------------------------------------- |
| l2TxHash  | string | Yes      | L2 AkashicChain hash of the transaction |

Response: Returns a single Transaction Object or `null`.

## <mark style="color:blue;">Get Transfers</mark>

**Endpoint:** `POST /getTransfers`

**Description:** Retrieves all or a subset of transactions, optionally filtered by `layer`, `status`, `startDate`, `endDate`, or `hideSmallTransactions`. Supports pagination with `page` and `limit`. The `hideSmallTransactions` parameter excludes transactions with values below 1 USD.

**Request Parameters:**

| Parameter             | Type                                                                          | Required | Description                                                        |
| --------------------- | ----------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------ |
| page                  | number                                                                        | No       | Page number for pagination                                         |
| limit                 | number                                                                        | No       | Number of transactions per page                                    |
| layer                 | [TransactionLayer](https://docs.akashicpay.com/references#transactionlayer)   | No       | Filter by transaction layer (`L1Transaction` or `L2Transaction`)   |
| status                | [TransactionStatus](https://docs.akashicpay.com/references#transactionstatus) | No       | Filter by transaction status (`Pending`, `Confirmed`, or `Failed`) |
| startDate             | string                                                                        | No       | Start date in ISO8601 format                                       |
| endDate               | string                                                                        | No       | End date in ISO8601 format                                         |
| hideSmallTransactions | boolean                                                                       | No       | Excludes transactions with values below 1 USD                      |
| identifier            | string                                                                        | No       | Filter by identifier                                               |
| referenceId           | string                                                                        | No       | Filter by identifier                                               |

> Note: Minimum `limit` is 10 and the default behaviour of `hideSmallTransactions` .

Response: Returns an array of Transaction Objects.

```json
[
  {
    "fromAddress": "string",
    "toAddress": "string",
    "layer": "string",
    "initiatedAt": "string",
    "confirmededAt": "string",
    "amount": "string",
    "coinSymbol": "string",
    "status": "string",
    "txHash": "string",
    "feesPaid": "string",
    "l2TxnHash": "string",
    "tokenSymbol": "string",
    "reason": "string",
    "internalFee": {
      "deposit": "string",
      "withdraw": "string"
    },
    "identifier": "string"
  }
]

```
