> For the complete documentation index, see [llms.txt](https://www.notbank.com/learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.notbank.com/learn/api-reference/websocket-api/account.md).

# Account

### GetAccountTransactions

**Permissions:** NotbankTrading, NotbankReadOnly\
**Call Type:** Synchronous

Gets a list of transactions for an account.

Results can be filtered using different search parameters such as **TransactionType** and **ProductId**.

**Note:** In this API method, “Depth” refers not to the depth of the order book, but to the count of trades to report.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// connection code ...

await client.getAccountService().getAccountTransactions({
  AccountId: 7,
  TransactionReferenceTypes: ["Deposit", "Withdraw"],
  ProductId: 3,
});

// parameters:
{
  AccountId: number;
  Depth?: number;
  ProductId?: number;
  TransactionId?: number;
  ReferenceId?: number;
  TransactionTypes?: TransactionTypes[]; // <-- Enum array
  TransactionReferenceTypes?: TransactionReferenceTypes[]; // <-- Enum array
  StartTimestamp?: number;
  EndTimeStamp?: number;
}

enum TransactionTypes {
  Fee = "Fee",
  Trade = "Trade",
  Other = "Other",
  Reverse = "Reverse",
  Hold = "Hold",
  Rebate = "Rebate",
  MarginAcquisition = "MarginAcquisition",
  MarginRelinquishByTrade = "MarginRelinquishByTrade",
  MarginInterestTransfer = "MarginInterestTransfer",
  MarginOperatorTransferToMarginAccount = "MarginOperatorTransferToMarginAccount",
  MarginOperatorTransferToAssetAccount = "MarginOperatorTransferToAssetAccount",
  MarginUserTransfer = "MarginUserTransfer",
  MarginRelinquishByTransfer = "MarginRelinquishByTransfer",
  MarginRelinquishByReverseTrade = "MarginRelinquishByReverseTrade",
  Distribution = "Distribution",
  Payment = "Payment",
  OperatorLend = "OperatorLend",
  OperatorReceived = "OperatorReceived",
  Rebalance = "Rebalance",
  Commission = "Commission",
  AirDrop = "AirDrop"
}

enum TransactionReferenceTypes {
  Trade = "Trade",
  Deposit = "Deposit",
  Withdraw = "Withdraw",
  Transfer = "Transfer",
  OrderHold = "OrderHold",
  WithdrawHold = "WithdrawHold",
  DepositHold = "DepositHold",
  MarginHold = "MarginHold",
  ManualHold = "ManualHold",
  ManualEntry = "ManualEntry",
  MarginAcquisition = "MarginAcquisition",
  MarginRelinquish = "MarginRelinquish",
  MarginInterestNetting = "MarginInterestNetting",
  MarginOperatorTransferToMarginAccount = "MarginOperatorTransferToMarginAccount",
  MarginOperatorTransferToAssetAccount = "MarginOperatorTransferToAssetAccount",
  MarginUserTransfer = "MarginUserTransfer",
  MarginPositionReverseTrade = "MarginPositionReverseTrade",
  AffiliateRebate = "AffiliateRebate",
  DistributionEntry = "DistributionEntry",
  TransferHold = "TransferHold",
  AirDrop = "AirDrop"
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.account.paramBuilders.GetAccountTransactionsParamBuilder;
import exchange.notbank.users.constants.ReferenceType;
import exchange.notbank.users.constants.TransactionType;

var response = client.getAccountService().getAccountTransactions(new GetAccountTransactionsParamBuilder()
    .accountId(7)
    .transactionReferenceTypes(List.of(ReferenceType.DEPOSIT, ReferenceType.WITHDRAW))
    .productId(3)).get();
```

{% endtab %}

{% tab title="Python" %}

```python

from notbank_python_sdk.models.account_transaction import (
    TransactionType,
    TransactionReferenceType,
)
from notbank_python_sdk.requests_models import GetAccountTransactionsRequest

response = client.get_account_transactions(GetAccountTransactionsRequest(
    account_id=7,
    transaction_reference_types=[TransactionReferenceType.DEPOSIT,TransactionReferenceType.WITHDRAW],
    product_id=3
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetAccountTransactions",
  "o": "{
    \"OMSId\": 1,
    \"AccountId\": 7
  }"
}
```

{% endtab %}
{% endtabs %}

| Key                       | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OMSId                     | **integer**. The ID of the OMS on which the account transactions will be returned. **required**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| AccountId                 | **integer**. The ID of the account for which transactions will be returned. **required**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Depth                     | **integer**. The number of transactions that will be returned, starting with the most recent transaction. If not defined, all transactions of the account will be returned (assuming not other search parameters are defined). **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ProductId                 | **integer**. Can be used to filter results. If set, only transactions for the specific product id specified will be returned, else, all transactions regardless of the product will be returned (assuming not other search parameters are defined). **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| TransactionId             | **integer**. Can be used to filter results. If set, only transaction with the specific id specified will be returned, else, all transactions regardless of the transaction id will be returned (assuming not other search parameters are defined). **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ReferenceId               | **integer**. Can be used to filter results. If set, only transaction with the specific id specified will be returned, else, all transactions regardless of the reference id will be returned (assuming not other search parameters are defined). **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| TransactionTypes          | <p><strong>array of string or array of integer</strong>. Can be used to filter results according to transaction type/s (can filter with either just 1 or more). If not set, transactions with any transaction type will be returned. A list of:<br>- <strong>1</strong> Fee<br>- <strong>2</strong> Trade<br>- <strong>3</strong> Other<br>- <strong>4</strong> Reverse<br>- <strong>5</strong> Hold<br>- <strong>6</strong> Rebate<br>- <strong>7</strong> MarginAcquisition<br>- <strong>8</strong> MarginRelinquishByTrade<br>- <strong>9</strong> MarginInterestTransfer<br>- <strong>10</strong> MarginOperatorTransferToMarginAccount<br>- <strong>11</strong> MarginOperatorTransferToAssetAccount<br>- <strong>12</strong> MarginUserTransfer<br>- <strong>13</strong> MarginRelinquishByTransfer<br>- <strong>14</strong> MarginRelinquishByReverseTrade<br>- <strong>15</strong> Distribution<br>- <strong>16</strong> Payment<br>- <strong>21</strong> OperatorLend<br>- <strong>22</strong> OperatorReceived<br>- <strong>23</strong> Rebalance<br>- <strong>24</strong> Commission<br>- <strong>25</strong> AirDrop<br><strong>optional</strong>.</p>                      |
| TransactionReferenceTypes | <p><strong>array of string or array of integer</strong>. Can be used to filter results according to transaction reference type/s (can filter with either just 1 or more). If not set, transactions with any transaction reference type will be returned. A list of:<br>- <strong>1</strong> Trade<br>- <strong>2</strong> Deposit<br>- <strong>3</strong> Withdraw<br>- <strong>4</strong> Transfer<br>- <strong>5</strong> OrderHold<br>- <strong>6</strong> WithdrawHold<br>- <strong>7</strong> DepositHold<br>- <strong>8</strong> MarginHold<br>- <strong>9</strong> ManualHold<br>- <strong>10</strong> ManualEntry<br>- <strong>11</strong> MarginAcquisition<br>- <strong>12</strong> MarginRelinquish<br>- <strong>13</strong> MarginInterestNetting<br>- <strong>14</strong> MarginOperatorTransferToMarginAccount<br>- <strong>15</strong> MarginOperatorTransferToAssetAccount<br>- <strong>16</strong> MarginUserTransfer<br>- <strong>17</strong> MarginPositionReverseTrade<br>- <strong>18</strong> AffiliateRebate<br>- <strong>19</strong> DistributionEntry<br>- <strong>20</strong> TransferHold<br>- <strong>21</strong> AirDrop<br><strong>optional</strong>.</p> |
| StartTimestamp            | **long integer**. Can be used to filter results based on timestamp the transaction has happened. This filter will return transactions that happened on or after (earliest possible time) the specified timestamp value, if not set, transactions that happened any time will be returned. **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| EndTimeStamp              | **long integer**. Can be used to filter results based on timestamp the transaction has happened. This filter will return transactions that happened on or before (latest possible time) the specified timestamp value, if not set, transactions that happened any time will be returned. **optional**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetAccountTransactions",
  "o": "[
    {
      \"TransactionId\": 24214,
      \"ReferenceId\": 294,
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"CR\": 0.01247667,
      \"DR\": 0.0,
      \"Counterparty\": 3,
      \"TransactionType\": \"Other\",
      \"ReferenceType\": \"Deposit\",
      \"ProductId\": 3,
      \"Balance\": 1.138154399436,
      \"TimeStamp\": 1678904016338
    },
    {
      \"TransactionId\": 24021,
      \"ReferenceId\": 293,
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"CR\": 0.01247667,
      \"DR\": 0.0,
      \"Counterparty\": 3,
      \"TransactionType\": \"Other\",
      \"ReferenceType\": \"Deposit\",
      \"ProductId\": 3,
      \"Balance\": 1.125677729436,
      \"TimeStamp\": 1678706804112
    },
    {
      \"TransactionId\": 23403,
      \"ReferenceId\": 292,
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"CR\": 0.01311447,
      \"DR\": 0.0,
      \"Counterparty\": 3,
      \"TransactionType\": \"Other\",
      \"ReferenceType\": \"Deposit\",
      \"ProductId\": 3,
      \"Balance\": 1.122515996076,
      \"TimeStamp\": 1677575188002
    },
    {
      \"TransactionId\": 22693,
      \"ReferenceId\": 286,
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"CR\": 0.0,
      \"DR\": 0.00001,
      \"Counterparty\": 3,
      \"TransactionType\": \"Other\",
      \"ReferenceType\": \"Withdraw\",
      \"ProductId\": 3,
      \"Balance\": 1.11033172,
      \"TimeStamp\": 1676348233473
    }
  ]"
}
```

Returns an array of objects as a response, each object represents a transaction.

| Key             | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TransactionId   | **integer**. The ID of the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| OMSId           | **integer**. The ID of the OMS on which the requested transactions took place.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| AccountId       | **integer**. The ID of the account which made the transactions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| CR              | **decimal**. Credit entry for the account on the order book. Funds entering an account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| DR              | **decimal**. Debit entry for the account on the order book. Funds leaving an account.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Counterparty    | **long integer**. The corresponding counter party in the trade.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| TransactionType | <p><strong>string</strong>. The type of transaction. One of:<br>- <strong>1</strong> Fee<br>- <strong>2</strong> Trade<br>- <strong>3</strong> Other<br>- <strong>4</strong> Reverse<br>- <strong>5</strong> Hold<br>- <strong>6</strong> Rebate<br>- <strong>7</strong> MarginAcquisition<br>- <strong>8</strong> MarginRelinquishByTrade<br>- <strong>9</strong> MarginInterestTransfer<br>- <strong>10</strong> MarginOperatorTransferToMarginAccount<br>- <strong>11</strong> MarginOperatorTransferToAssetAccount<br>- <strong>12</strong> MarginUserTransfer<br>- <strong>13</strong> MarginRelinquishByTransfer<br>- <strong>14</strong> MarginRelinquishByReverseTrade<br>- <strong>15</strong> Distribution<br>- <strong>16</strong> Payment<br>- <strong>21</strong> OperatorLend<br>- <strong>22</strong> OperatorReceived<br>- <strong>23</strong> Rebalance<br>- <strong>24</strong> Commission<br>- <strong>25</strong> AirDrop.</p>                                  |
| ReferenceId     | **long integer**. The ID of the action or event that triggered this transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ReferenceType   | <p><strong>integer</strong>. The type of action or event that triggered this transaction. One of:- <strong>1</strong> Trade<br>- <strong>2</strong> Deposit<br>- <strong>3</strong> Withdraw<br>- <strong>4</strong> Transfer<br>- <strong>5</strong> OrderHold<br>- <strong>6</strong> WithdrawHold<br>- <strong>7</strong> DepositHold<br>- <strong>8</strong> MarginHold<br>- <strong>9</strong> ManualHold<br>- <strong>10</strong> ManualEntry<br>- <strong>11</strong> MarginAcquisition<br>- <strong>12</strong> MarginRelinquish<br>- <strong>13</strong> MarginInterestNetting<br>- <strong>14</strong> MarginOperatorTransferToMarginAccount<br>- <strong>15</strong> MarginOperatorTransferToAssetAccount<br>- <strong>16</strong> MarginUserTransfer<br>- <strong>17</strong> MarginPositionReverseTrade<br>- <strong>18</strong> AffiliateRebate<br>- <strong>19</strong> DistributionEntry<br>- <strong>20</strong> TransferHold<br>- <strong>21</strong> AirDrop</p> |
| ProductId       | **integer**. The ID of the product on this account’s side of the transaction. For example, in a dollars-for-Bitcoin transaction, one side will have the product Dollar and the other side will have the product Bitcoin. Use **GetProduct** to return information about a product based on its ID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Balance         | **decimal**. The balance in the account after the transaction.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| TimeStamp       | **long integer**. Time at which the transaction took place, in POSIX format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

### GetAccountPositions

**Permissions:** NotbankTrading, NotbankReadOnly\
**Call Type:** Synchronous

Gets a list of Positions (Balances) on a specific account.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection & authentication code ...

await client.getAccountService().getAccountPositions({
  AccountId: 7,
  IncludePending: true
});

//parameters
{
  AccountId: number;
  IncludePending?: boolean;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.account.paramBuilders.GetAccountPositionsParamBuilder;

var response = client.getAccountService()
    .getAccountPositions(new GetAccountPositionsParamBuilder(7).includePending(true)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GetAccountPositionsRequest

response = client.get_account_positions(
    GetAccountPositionsRequest(
        account_id=7,
        include_pending=True))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetAccountPositions",
  "o": "{
    \"OMSId\": 1,
    \"AccountId\": 1,
    \"IncludePending\": true
  }"
}
```

{% endtab %}
{% endtabs %}

| Key            | Value                                                                                                                                                        |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| OMSId          | **integer**. The ID of the OMS. **required**.                                                                                                                |
| AccountId      | **integer**. The ID of the account on the OMS for which positions will be returned for. **required**.                                                        |
| IncludePending | **boolean**. If true, pending deposit and withdraw amounts will be included in the response, else they will not be included. Default is false. **optional**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetAccountPositions",
  "o": "[
    {
      \"OMSId\": 1,
      \"AccountId\": 1,
      \"ProductSymbol\": \"USD\",
      \"ProductId\": 1,
      \"Amount\": 100.95,
      \"Hold\": 0,
      \"PendingDeposits\": 0,
      \"PendingWithdraws\": 0,
      \"TotalDayDeposits\": 0,
      \"TotalMonthDeposits\": 0,
      \"TotalYearDeposits\": 0,
      \"TotalDayDepositNotional\": 0,
      \"TotalMonthDepositNotional\": 0,
      \"TotalYearDepositNotional\": 0,
      \"TotalDayWithdraws\": 0,
      \"TotalMonthWithdraws\": 0,
      \"TotalYearWithdraws\": 0,
      \"TotalDayWithdrawNotional\": 0,
      \"TotalMonthWithdrawNotional\": 0,
      \"TotalYearWithdrawNotional\": 0,
      \"NotionalProductId\": 1,
      \"NotionalProductSymbol\": \"USD\",
      \"NotionalValue\": 100.95,
      \"NotionalHoldAmount\": 0,
      \"NotionalRate\": 1,
      \"TotalDayTransferNotional\": 0
    },
    {
      \"OMSId\": 1,
      \"AccountId\": 1,
      \"ProductSymbol\": \"BTC\",
      \"ProductId\": 2,
      \"Amount\": 0,
      \"Hold\": 0,
      \"PendingDeposits\": 0,
      \"PendingWithdraws\": 0,
      \"TotalDayDeposits\": 0,
      \"TotalMonthDeposits\": 0,
      \"TotalYearDeposits\": 0,
      \"TotalDayDepositNotional\": 0,
      \"TotalMonthDepositNotional\": 0,
      \"TotalYearDepositNotional\": 0,
      \"TotalDayWithdraws\": 0,
      \"TotalMonthWithdraws\": 0,
      \"TotalYearWithdraws\": 0,
      \"TotalDayWithdrawNotional\": 0,
      \"TotalMonthWithdrawNotional\": 0,
      \"TotalYearWithdrawNotional\": 0,
      \"NotionalProductId\": 1,
      \"NotionalProductSymbol\": \"USD\",
      \"NotionalValue\": 0,
      \"NotionalHoldAmount\": 0,
      \"NotionalRate\": 30005,
      \"TotalDayTransferNotional\": 0
    }
  ]"
}

```

Returns an array of objects as a response.

| Key                        | Value                                                                                                                                                                                                                                                                                                                       |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OMSId                      | **integer**. The ID of the OMS to which the account is assigned.                                                                                                                                                                                                                                                            |
| AccountId                  | **integer**. The ID of the account whose positions/balances were retrieved.                                                                                                                                                                                                                                                 |
| ProductSymbol              | **string**. The symbol of a specific product.                                                                                                                                                                                                                                                                               |
| ProductId                  | **integer**. The ID of a specific product.                                                                                                                                                                                                                                                                                  |
| Amount                     | **decimal**. The current actual balance of the account for a specific product.                                                                                                                                                                                                                                              |
| Hold                       | **decimal**. The current actual hold amount against the current balance of the account for a specific product. A hold amount is part of the total balance or the **Amount** field value but is not available to be used for other transactions. A trade on working status of 100 units at $1 each will produce a $100 hold. |
| PendingDeposits            | **decimal**. Deposit amount for a specific product that is not yet credited to the account.                                                                                                                                                                                                                                 |
| PendingWithdraws           | **decimal**. Withdraw amount for a specific product that is not yet debited from the account                                                                                                                                                                                                                                |
| TotalDayDeposits           | **decimal**. Total amount deposited by the account for a specific product in the current day; UTC Midnight and UTC Midnight.                                                                                                                                                                                                |
| TotalMonthDeposits         | **decimal**. Total amount deposited by the account for a specific product in the current month.                                                                                                                                                                                                                             |
| TotalYearDeposits          | **decimal**. Total amount deposited by the account for a specific product in the current year.                                                                                                                                                                                                                              |
| TotalDayDepositNotional    | **decimal**. Total amount in notional value deposited by the account for a specific product in the current day.                                                                                                                                                                                                             |
| TotalMonthDepositNotional  | **decimal**. Total amount in notional value deposited by the account for a specific product in the current month.                                                                                                                                                                                                           |
| TotalYearDepositNotional   | **decimal**. Total amount in notional value deposited by the account for a specific product in the current year.                                                                                                                                                                                                            |
| TotalDayWithdraws          | **decimal**. Total amount withdrawn by the account for a specific product in the current day; UTC Midnight and UTC Midnight.                                                                                                                                                                                                |
| TotalMonthWithdraws        | **decimal**. Total amount withdrawn by the account for a specific product in the current month.                                                                                                                                                                                                                             |
| TotalYearWithdraws         | **decimal**. Total amount withdrawn by the account for a specific product in the current year.                                                                                                                                                                                                                              |
| TotalDayWithdrawNotional   | **decimal**. Total amount in notional value withdrawn by the account for a specific product in the current day.                                                                                                                                                                                                             |
| TotalMonthWithdrawNotional | **decimal**. Total amount in notional value withdrawn by the account for a specific product in the current month.                                                                                                                                                                                                           |
| TotalYearWithdrawNotional  | **decimal**. Total amount in notional value withdrawn by the account for a specific product in the current year.                                                                                                                                                                                                            |
| NotionalProductId          | **integer**. The ID of the product set as the BaseNotionalProduct on the OMS.                                                                                                                                                                                                                                               |
| NotionalProductSymbol      | **string**. The symbol of the product set as the BaseNotionalProduct on the OMS.                                                                                                                                                                                                                                            |
| NotionalValue              | **decimal**. The current actual balance in notional value of the account for a specific product.                                                                                                                                                                                                                            |
| NotionalHoldAmount         | **decimal**. The current actual hold amount in notional value against the current balance of the account for a specific product.                                                                                                                                                                                            |
| NotionalRate               | **decimal**. The current rate of a specific product against the notional product.                                                                                                                                                                                                                                           |
| TotalDayTransferNotional   | **decimal**. Total amount in notional value transfered by the account for a specific product in the current day.                                                                                                                                                                                                            |

### GetAccountInstrumentStatistics

**Permissions:** NotbankTrading, NotbankReadOnly\
**Call Type:** Synchronous

Gets a list of Instrument Statistics of a specific account.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection & authentication code ...

await client.getAccountService().getAccountInstrumentStatistics({
  AccountId: 7
});

//parameters
{
  AccountId: number;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.account.paramBuilders.GetAccountInstrumentStatisticsParamBuilder;

var response = client.getAccountService().getAccountInstrumentStatistics(
    new GetAccountInstrumentStatisticsParamBuilder().accountId(7)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GetAccountInstrumentStatisticsRequest

response = client.get_account_instrument_statistics(GetAccountInstrumentStatisticsRequest(
    account_id=7,
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetAccountInstrumentStatistics",
  "o": "{
    \"OMSId\": 1,
    \"AccountId\": 7
  }"
}
```

{% endtab %}
{% endtabs %}

| Key       | Value                                                                                                             |
| --------- | ----------------------------------------------------------------------------------------------------------------- |
| OMSId     | **integer**. The ID of the OMS. **required**.                                                                     |
| AccountId | **integer**. The ID of the account on the OMS for which instrument statistics will be returned for. **required**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetAccountInstrumentStatistics",
  "o": 
  "[
    {
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"InstrumentId\": 1,
      \"InstrumentSymbol\": \"BTCUSD\",
      \"QuantityBought\": 0,
      \"QuantitySold\": 0,
      \"NotionalBought\": 0,
      \"NotionalSold\": 0,
      \"MonthlyQuantityBought\": 0.1602,
      \"MonthlyQuantitySold\": 0.3202,
      \"MonthlyNotionalBought\": 3754.96,
      \"MonthlyNotionalSold\": 8315.0,
      \"TradeVolume\": 0,
      \"MonthlyTradeVolume\": 12069.96,
      \"TotalDayBuys\": 0,
      \"TotalDaySells\": 0,
      \"TotalMonthBuys\": 10,
      \"TotalMonthSells\": 7,
      \"NotionalConversionRate\": 0,
      \"NotionalConversionSymbol\": \"USD\",
      \"RollingMonthlyStartDate\": 0,
      \"LastTradeId\": 910,
      \"NotionalProductId\": 1,
      \"DailyNotionalTradeVolume\": 0,
      \"MonthlyNotionalTradeVolume\": 12069.96,
      \"YearlyNotionalTradeVolume\": 12069.96
    },
    {
      \"OMSId\": 1,
      \"AccountId\": 7,
      \"InstrumentId\": 2,
      \"InstrumentSymbol\": \"ETHUSD\",
      \"QuantityBought\": 0,
      \"QuantitySold\": 0,
      \"NotionalBought\": 0,
      \"NotionalSold\": 0,
      \"MonthlyQuantityBought\": 0.08,
      \"MonthlyQuantitySold\": 0,
      \"MonthlyNotionalBought\": 1874.88,
      \"MonthlyNotionalSold\": 0,
      \"TradeVolume\": 0,
      \"MonthlyTradeVolume\": 1874.88,
      \"TotalDayBuys\": 0,
      \"TotalDaySells\": 0,
      \"TotalMonthBuys\": 6,
      \"TotalMonthSells\": 0,
      \"NotionalConversionRate\": 0,
      \"NotionalConversionSymbol\": \"USD\",
      \"RollingMonthlyStartDate\": 0,
      \"LastTradeId\": 916,
      \"NotionalProductId\": 1,
      \"DailyNotionalTradeVolume\": 0,
      \"MonthlyNotionalTradeVolume\": 1874.88,
      \"YearlyNotionalTradeVolume\": 1874.88
    }
  ]"
}
```

| Key                        | Value                                                                                                          |
| -------------------------- | -------------------------------------------------------------------------------------------------------------- |
| OMSId                      | **integer**. The ID of the OMS.                                                                                |
| AccountId                  | **integer**. The ID of the account for which the instrument statistics is for.                                 |
| InstrumentId               | **integer**. The ID of the account for which the instrument statistics is for.                                 |
| InstrumentSymbol           | **string**. The symbol of a specific instrument.                                                               |
| QuantityBought             | **decimal**. Quantity of the instrument bought by the account at the current trading day.                      |
| QuantitySold               | **integer**. Quantity of the instrument sold by the account at the current trading day.                        |
| NotionalBought             | **integer**. Notional value of the instrument bought by the account at the current trading day.                |
| NotionalSold               | **integer**. Notional value of the instrument sold by the account at the current trading day.                  |
| MonthlyQuantityBought      | **integer**. Quantity of the instrument bought by the account for the current month.                           |
| MonthlyQuantitySold        | **integer**. Quantity of the instrument sold by the account for the current month.                             |
| MonthlyNotionalBought      | **integer**. Notional value of the instrument bought by the account at the current month.                      |
| MonthlyNotionalSold        | **integer**. Notional value of the instrument sold by the account at the current month.                        |
| TradeVolume                | **integer**. Total quantity of the instrument either sold or bought by the account at the current trading day. |
| MonthlyTradeVolume         | **integer**. Total quantity of the instrument either sold or bought by the account at the current month.       |
| TotalDayBuys               | **integer**. Total number of times the account bought the instrument at the current trading day.               |
| TotalDaySells              | **integer**. Total number of times the account sold the instrument at the current trading day.                 |
| TotalMonthBuys             | **integer**. Total number of times the account bought the instrument at the current month.                     |
| TotalMonthSells            | **integer**. Total number of times the account sold the instrument at the current month.                       |
| NotionalConversionRate     | **integer**. The notional conversion rate.                                                                     |
| NotionalConversionSymbol   | **string**. The notional conversion symbol.                                                                    |
| RollingMonthlyStartDate    | **integer**. The rolling monthly start date.                                                                   |
| LastTradeId                | **integer**. The ID of the most recent trade the account has for the instrument.                               |
| DailyNotionalTradeVolume   | **integer**. The notional trade volume of the account for the specific instrument at the current trading day.  |
| MonthlyNotionalTradeVolume | **integer**. The notional trade volume of the account for the specific instrument at the current month.        |
| YearlyNotionalTradeVolume  | **integer**. The notional trade volume of the account for the specific instrument at the current year.         |

### GetAccountInfo

**Permissions:** NotbankTrading, NotbankReadOnly\
**Call Type:** Synchronous

Returns detailed information about one specific account existing on a specific OMS.

If the parameter AccountId is not defined, the details of the default account of the authenticated user will be retrieved.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection & authentication code ...

await client.getAccountService().getAccountInfo({
  AccountId: 7
});

//parameters
{
  AccountId?: number;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.account.paramBuilders.GetAccountInfoParamBuilder;

var response = client.getAccountService()
    .getAccountInfo(new GetAccountInfoParamBuilder().accountId(7)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models.get_account_info_request import GetAccountInfoRequest

response = client.get_account_info(GetAccountInfoRequest(7))

```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetAccountInfo",
  "o": "{
    \"OMSId\": 1,
    \"AccountId\": 7
  }"
}
```

{% endtab %}
{% endtabs %}

| Key       | Value                                                                                                                                                                                |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| OMSId     | **integer**. The ID of the OMS on which the account exists. **required**.                                                                                                            |
| AccountId | **integer**. The ID of the account on the OMS for which information will be returned. If not defined, the default account of the authenticated user will be retrieved. **optional**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetAccountInfo",
  "o": "{
    \"OMSID\": 1,
    \"AccountId\": 7,
    \"AccountName\": \"sample\",
    \"AccountHandle\": null,
    \"FirmId\": null,
    \"FirmName\": null,
    \"AccountType\": \"Asset\",
    \"FeeGroupId\": 0,
    \"ParentID\": 0,
    \"RiskType\": \"Normal\",
    \"VerificationLevel\": 1,
    \"VerificationLevelName\": null,
    \"CreditTier\": 0,
    \"FeeProductType\": \"BaseProduct\",
    \"FeeProduct\": 0,
    \"RefererId\": 0,
    \"LoyaltyProductId\": 0,
    \"LoyaltyEnabled\": false,
    \"PriceTier\": 0,
    \"Frozen\": false
  }"
}
```

| Key                   | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OMSID                 | **integer**. The ID of the OMS on which the account resides.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| AccountId             | **integer**. The ID of the account for which information was requested.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| AccountName           | **string**. A non-unique name for the account assigned by the user.                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| AccountHandle         | **string**. A unique user-assigned name that is checked at create time by the OMS to assure its uniqueness.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| FirmId                | **string**. An arbitrary identifier assigned by a trading venue operator to a trading firm as part of the initial company, user, and account set up process. For example, Smith Financial Partners might have the ID SMFP.                                                                                                                                                                                                                                                                                                                  |
| FirmName              | **string**. A longer, non-unique version of the trading firm’s name; for example, Smith Financial Partners.                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| AccountType           | <p><strong>integer</strong>. The account type the specific account is currently set to. One of:<br>- 0 Asset<br>- 1 Liability. Default is 0</p>                                                                                                                                                                                                                                                                                                                                                                                             |
| FeeGroupId            | **integer**. Defines account attributes relating to how fees are calculated and assessed. Set by trading venue operator.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ParentID              | **integer**. Reserved for future development.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| RiskType              | <p><strong>integer</strong>. One of:<br>- 0 Unkown (an error condition)<br>- 1 Normal<br>- 2 NoRiskCheck<br>- 3 NoTrading<br>- 4 Credit<br>Returns <strong>Normal</strong> for virtually all market participants. Other types indicate account configurations assignable by the trading venue operator.</p>                                                                                                                                                                                                                                 |
| VerificationLevel     | **integer**. The verification level the account is currently at. Verification level limits the amounts of deposits and withdrawals. It is defined by and set by the trading venue operator for each account and is part of the KYC ("Know Your Customer") process, which may be automated or manual. An account can earn a higher Verification Level over time.                                                                                                                                                                             |
| VerificationLevelName | **string**. Name of the verification level.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| CreditTier            | **integer**. The credit tier the account is currently at. Default is 0. applicable to accounts with *RiskType* **Credit**                                                                                                                                                                                                                                                                                                                                                                                                                   |
| FeeProductType        | <p><strong>string</strong>. One of:<br>- BaseProduct<br>- SingleProduct<br>Trading fees may be charged by a trading venue operator (Withdrawal fees may also be charged, but that is a separate setting dependent on product and instrument). This value shows whether fees for this account’s trades are charged in the product being traded (BaseProduct, for example Bitcoin) or whether the account has a preferred fee-paying product (SingleProduct, for example USD) to use in all cases and regardless of product being traded.</p> |
| FeeProduct            | **integer**. The ID of the preferred fee product, if any. Default is 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| RefererId             | **integer**. Captures the ID of the entity who referred this account to the trading venue, usually captured for marketing purposes.                                                                                                                                                                                                                                                                                                                                                                                                         |
| LoyaltyProductId      | **integer**. The Loyalty Token is a parallel fee structure that replaces the general set of transaction fees. An exchange can promote activity on a specific cryptocurrency token by offering discounted transaction fees denominated in that token to customers who choose that fee structure. This key is the ID of the loyalty product chosen by the Exchange. There can be one Loyalty Token per OMS.                                                                                                                                   |
| LoyaltyEnabled        | **boolean**. If *true*, this account has accepted the Loyalty Token fee structure. If *false*, the account has not accepted it. Default is *false*.                                                                                                                                                                                                                                                                                                                                                                                         |
| PriceTier             | **integer**. The price tier where the account is currently at. Default is 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Frozen                | **boolean**. If *true*, account is Frozen and will not be able to perform assets outgoing transactions such as a withdrawal. If *false*, account is not frozen and can perform any transaction. Default is *false*.                                                                                                                                                                                                                                                                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.notbank.com/learn/api-reference/websocket-api/account.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
