# Transaction History

## Transaction History

<mark style="color:blue;">`GET`</mark> `https://api.cngn.co/v1/api/transactions`

Returns paginated transaction records for your merchant account.

#### Query Parameters

| Name  | Type    | Description                                    |
| ----- | ------- | ---------------------------------------------- |
| page  | integer | Page number for pagination. Default: `1`       |
| limit | integer | Number of transactions per page. Default: `10` |

{% tabs %}
{% tab title="200 Transactions fetched successfully" %}

```json
{
  "status": 200,
  "message": "Transactions fetched successfully",
  "data": {
    "data": [
      {
        "id": "clx1abc123def456",
        "from": "Convexity",
        "receiver": {
          "address": "0x5678901234abcdef5678901234abcdef56789012"
        },
        "amount": "10000.00",
        "description": "Withdrawal to external wallet",
        "createdAt": "2025-06-15T10:30:00.000Z",
        "trx_ref": "TRX-20250615-ABC123",
        "trx_type": "withdraw",
        "network": "bsc",
        "asset_type": "cNGN",
        "asset_symbol": "CNGN",
        "base_trx_hash": "0xabc123def456...",
        "extl_trx_hash": "0xdef456abc789...",
        "explorer_link": "https://bscscan.com/tx/0xdef456abc789...",
        "status": "completed"
      },
      {
        "id": "clx2def456ghi789",
        "from": "Convexity",
        "receiver": {
          "bank": "Access Bank",
          "accountNumber": "0123456789"
        },
        "amount": "50000.00",
        "description": "Fiat redemption",
        "createdAt": "2025-06-14T08:15:00.000Z",
        "trx_ref": "TRX-20250614-DEF456",
        "trx_type": "fiat_redeem",
        "network": "xbn",
        "asset_type": "cNGN",
        "asset_symbol": "NGN",
        "base_trx_hash": null,
        "extl_trx_hash": null,
        "explorer_link": null,
        "status": "pending_redeem"
      }
    ],
    "pagination": {
      "count": 100,
      "pages": 10,
      "isLastPage": false,
      "nextPage": 2,
      "previousPage": null
    }
  }
}
```

{% endtab %}

{% tab title="400 Bad Request" %}

```json
{
  "status": 400,
  "message": "Bad Request Error"
}
```

{% endtab %}
{% endtabs %}

#### Transaction Object Fields (Decrypted)

| Field           | Type        | Description                                                |
| --------------- | ----------- | ---------------------------------------------------------- |
| `id`            | string      | Unique transaction identifier                              |
| `from`          | string      | Sender name or identifier                                  |
| `receiver`      | object      | Receiver details — see Receiver Object below               |
| `amount`        | string      | Transaction amount                                         |
| `description`   | string      | Transaction description                                    |
| `createdAt`     | string      | ISO 8601 timestamp                                         |
| `trx_ref`       | string      | Unique transaction reference                               |
| `trx_type`      | string      | Type: `withdraw`, `swap`, `fiat_redeem`, `fiat_buy`        |
| `network`       | string      | Blockchain network identifier (see Networks Enum)          |
| `asset_type`    | string      | Type of asset transacted                                   |
| `asset_symbol`  | string      | Asset symbol (`CNGN`, `NGN`)                               |
| `base_trx_hash` | string/null | Base layer transaction hash                                |
| `extl_trx_hash` | string/null | External blockchain transaction hash                       |
| `explorer_link` | string/null | Block explorer URL for the transaction                     |
| `status`        | string      | Status: `pending`, `completed`, `pending_redeem`, `failed` |

#### Receiver Object

**For crypto transactions (withdraw, swap):**

```json
{
  "address": "0x5678901234abcdef5678901234abcdef56789012"
}
```

**For fiat transactions (fiat\_redeem):**

```json
{
  "bank": "Access Bank",
  "accountNumber": "0123456789"
}
```

#### Pagination Object

| Field          | Type        | Description                                 |
| -------------- | ----------- | ------------------------------------------- |
| `count`        | number      | Total number of transactions                |
| `pages`        | number      | Total number of pages                       |
| `isLastPage`   | boolean     | Whether the current page is the last page   |
| `nextPage`     | number/null | Next page number (`null` if last page)      |
| `previousPage` | number/null | Previous page number (`null` if first page) |

#### Example Request

```bash
curl -X GET "https://api.cngn.co/v1/api/transactions?page=1&limit=20" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cngn.co/integrations/endpoints/transaction-history.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
