# Transactions

## List transactions by organization

`TransactionListResponse Transactions.List(TransactionListParamsparameters, CancellationTokencancellationToken = default)`

**get** `/api/v1/transactions`

List transactions by organization

### Parameters

- `TransactionListParams parameters`

  - `required string organizationID`

  - `Long page`

  - `Long perPage`

### Returns

- `class TransactionListResponse:`

  - `required IReadOnlyList<Data> Data`

    - `required string ID`

    - `required Long Amount`

      Amount in minor units

    - `required DateTimeOffset CreatedAt`

    - `required string Currency`

    - `required string FromAccountID`

    - `required string OrganizationID`

    - `required Status Status`

      - `"pending"Pending`

      - `"posted"Posted`

      - `"failed"Failed`

    - `required string ToAccountID`

    - `required TransactionKind TransactionKind`

      - `"deposit"Deposit`

      - `"withdraw"Withdraw`

      - `"transfer"Transfer`

    - `required DateTimeOffset UpdatedAt`

    - `string? Environment`

    - `string? FailureReason`

    - `string IdempotencyKey`

  - `required Pagination Pagination`

    - `required Long Page`

    - `required Long PerPage`

    - `required Long TotalCount`

    - `required Long TotalPages`

### Example

```csharp
TransactionListParams parameters = new()
{
    OrganizationID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

var transactions = await client.Transactions.List(parameters);

Console.WriteLine(transactions);
```

#### Response

```json
{
  "data": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "amount": 0,
      "created_at": "2019-12-27T18:11:19.117Z",
      "currency": "currency",
      "from_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "organization_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "status": "pending",
      "to_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "transaction_kind": "deposit",
      "updated_at": "2019-12-27T18:11:19.117Z",
      "environment": "environment",
      "failure_reason": "failure_reason",
      "idempotency_key": "idempotency_key"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 1,
    "total_count": 0,
    "total_pages": 0
  }
}
```

## List account transactions

`IReadOnlyList<Transaction> Transactions.ListByAccount(TransactionListByAccountParamsparameters, CancellationTokencancellationToken = default)`

**get** `/api/v1/accounts/{account_id}/transactions`

List account transactions

### Parameters

- `TransactionListByAccountParams parameters`

  - `required string accountID`

  - `Long limit`

### Example

```csharp
TransactionListByAccountParams parameters = new()
{
    AccountID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

var transactions = await client.Transactions.ListByAccount(parameters);

Console.WriteLine(transactions);
```

#### Response

```json
[
  {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "amount": "amount",
    "balance_after": "balance_after",
    "created_at": "2019-12-27T18:11:19.117Z",
    "currency": "currency",
    "status": "pending",
    "transaction_type": "deposit",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "description": "description",
    "external_recipient_id": "external_recipient_id",
    "recipient_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "reference_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
]
```

## Retrieve transaction

`Transaction Transactions.Retrieve(TransactionRetrieveParamsparameters, CancellationTokencancellationToken = default)`

**get** `/api/v1/transactions/{id}`

Retrieve transaction

### Parameters

- `TransactionRetrieveParams parameters`

  - `required string id`

### Returns

- `class Transaction:`

  - `required string ID`

  - `required string AccountID`

  - `required string Amount`

  - `required string BalanceAfter`

  - `required DateTimeOffset CreatedAt`

  - `required string Currency`

  - `required Status Status`

    - `"pending"Pending`

    - `"completed"Completed`

    - `"failed"Failed`

    - `"cancelled"Cancelled`

  - `required TransactionType TransactionType`

    - `"deposit"Deposit`

    - `"withdrawal"Withdrawal`

    - `"transfer"Transfer`

    - `"recurring_payment"RecurringPayment`

    - `"savings_withdraw"SavingsWithdraw`

  - `required DateTimeOffset UpdatedAt`

  - `string? Description`

  - `string? ExternalRecipientID`

  - `string? RecipientAccountID`

  - `string? ReferenceID`

### Example

```csharp
TransactionRetrieveParams parameters = new()
{
    ID = "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
};

var transaction = await client.Transactions.Retrieve(parameters);

Console.WriteLine(transaction);
```

#### Response

```json
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "amount": "amount",
  "balance_after": "balance_after",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "currency",
  "status": "pending",
  "transaction_type": "deposit",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "description": "description",
  "external_recipient_id": "external_recipient_id",
  "recipient_account_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "reference_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
```
