# Sub Account Information

## Get Account Settings

`GET /v2/accounts/{accountId}/account-settings/{source}`

Get the account settings for the sub account

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your account settings in our DTW smart contract on |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `accountSettings` | AccountSetting[] | Account Settings |


  Example (Account Settings response):
  ```json
  {"accountSettings":[{"settingType":"COMMISSION","setting":"0.001"},{"settingType":"COLLATERAL_CREDIT_LEVERAGE","setting":"2"}]}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |

- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/account-settings/{source}"
```

---

## Get Account Snapshot

`GET /v2/accounts/{accountId}/account-snapshot/{source}`

Get snapshot of the sub account showing balances, valuations in account asset, the available to withdraw in each asset and then credit usages. The available to withdraw is the amount of an asset that can be withdrawn whilst leaving enough balance in the account to satisfy any credit usage.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your snapshot in our DTW smart contract on (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `accountAsset` | string | Account asset (e.g. `usd`) |
  | `balances` | BalanceEntry[] |  |
  | `totalAccountAssetValuation` | string | Total valuation in account asset (e.g. `25864.23`) |
  | `totalCredit` | string | Total credit (e.g. `25864.23`) |
  | `creditUsed` | string | Credit used (e.g. `10433.1`) |


  Example (Account Snapshot response):
  ```json
  {"accountAsset":"usdc","balances":[{"asset":"usdc","balance":"33","accountAssetValuation":"33","availableToWithdraw":"33"},{"asset":"eth","balance":"4","accountAssetValuation":"8000","availableToWithdraw":"3.5665"},{"asset":"sol","balance":"-3","accountAssetValuation":"-600","availableToWithdraw":"0"}],"totalAccountAssetValuation":"7433","totalCredit":"14866","creditUsed":"600"}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |

- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/account-snapshot/{source}"
```

---

## Get Balance

`GET /v3/accounts/{accountId}/balance/{source}`

Get the balances for the sub account

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your balance in our DTW smart contract on (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `balances` | BalanceV2[] | balances |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |

- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/accounts/{accountId}/balance/{source}"
```

---

## Get Commission Rate

`GET /v2/accounts/{accountId}/commission-rate/{source}`

Get the commission rate for the specified asset pair on the sub account

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `source` | path | Yes | string | If trading via API use OFFCHAIN, else specify the blockchain you want to check your commission in our DTW smart contract on (e.g. `OFFCHAIN`) |
| `buying_asset` | query | Yes | string | Asset you with to buy (e.g. `btc`) |
| `selling_asset` | query | Yes | string | Asset you with to sell (e.g. `eth`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `buyingAsset` | string |  |
  | `sellingAsset` | string |  |
  | `commission` | string |  |


  Example (Commission Rate response):
  ```json
  {"buyingAsset":"btc","sellingAsset":"eth","commission":"0.001"}
  ```
- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid order source):
  ```json
  {"code":"INVALID_ORDER_SOURCE","description":"Order source TINMAN is invalid. Valid order sources are [OFFCHAIN, ETHEREUM, OPTIMISM, POLYGON, LINEA]"}
  ```
- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid JWT):
  ```json
  {"code":"INVALID_JWT_TOKEN","description":"Invalid JWT"}
  ```
- **403**: Invalid permissions

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


  Example (Invalid permissions):
  ```json
  {"code":"INVALID_PERMISSIONS","description":"Invalid permissions"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/commission-rate/{source}"
```

---

## Get Credit Usage

`GET /v2/accounts/{accountId}/credit/{source}`

Get credit usage for the sub account

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `source` | path | Yes | string | Please use OFFCHAIN, credit does not exist for on-chain trading currently. (e.g. `OFFCHAIN`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `totalCredit` | string | Total Credit (e.g. `12932.1`) |
  | `creditUsed` | string | Credit Used (e.g. `10120.65`) |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |

- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/accounts/{accountId}/credit/{source}"
```

---

## Get Order History

`GET /v3/accounts/{accountId}/order-history`

Returns sub account order history in chronological order (oldest first).

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `accountId` | path | Yes | string | The account you want to call to be actioned for |
| `start_time` | query | No | string | Optionally specify a start time for your query (e.g. `2025-06-04T12:50:39.465Z`) |
| `end_time` | query | No | string | Optionally specify an end time for your query (e.g. `2025-06-04T12:50:39.465Z`) |
| `page_size` | query | No | string | Optionally specify the page size. This defaults to 500 and can be a max of 2000 (e.g. `100`) |
| `before` | query | No | string | Optionally specify the before cursor from a previous query. Cannot be used in conjunction with the 'after parameter |
| `after` | query | No | string | Optionally specify the after cursor from a previous query. Cannot be used in conjunction with the 'before' parameter |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `orders` | Order[] | A page of orders |
  | `beforeCursor` | string | A cursor pointing to the earliest retrieved order |
  | `afterCursor` | string | A cursor pointing to the latest retrieved order |
  | `hasMore` | boolean | Whether more results exist beyond this page |

- **400**: Bad request

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |

- **401**: Unauthorized

  | Field | Type | Description |
  |-------|------|-------------|
  | `code` | string | Error code |
  | `description` | string | Error description |


**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v3/accounts/{accountId}/order-history"
```

---

