# Deposit/Withdrawal Information

Endpoints to maintain your deposit and withdrawal addresses across fiat and digital assets.

## Get Fund Locations

`GET /v2/fund-locations`

Get the list of available locations for withdrawals

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `locations` | string[] |  |


  Example (Fund locations):
  ```json
  {"locations":["FIAT","ETHEREUM","TRON","SOLANA","BITCOIN","BITCOIN_CASH","DOGECOIN","XRPL","LITECOIN"]}
  ```
- **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/fund-locations" \
  -H "Authorization: Bearer <token>"
```

---

## Get Withdrawal Bank Details

`GET /v2/withdrawal-bank-details`

Get bank details for a fiat asset. These are the approved bank accounts that you can withdraw to. If no asset is provided, all bank details are returned.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `asset` | query | No | string | The fiat asset to get bank details for. If omitted, all bank details are returned. (e.g. `GBP`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `bankDetails` | BankDetail[] | List of bank details for the requested asset |


  Example (Single Bank Details):
  ```json
  {"bankDetails":[{"asset":"USD","bankName":"Test Bank One","accountName":"Test Account Holder","iban":"****2345","bic":"****GB22","intermediaryBic":"****GB2L","accountNumber":"****2345","sortCode":"****8001","status":"APPROVED"}]}
  ```
- **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"}
  ```
- **404**: Bank details not found

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


  Example (Not found):
  ```json
  {"code":"NOT_FOUND","description":"No bank details found for the specified asset"}
  ```
- **503**: Custody provider not reachable or unavailable

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


  Example (Service unavailable):
  ```json
  {"code":"SERVICE_UNAVAILABLE_ERROR","description":"Service unavailable"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/withdrawal-bank-details" \
  -H "Authorization: Bearer <token>"
```

---

## Create Withdrawal Bank Details

`POST /v2/withdrawal-bank-details`

Submit new bank details for withdrawal. The bank details will be in PENDING status until approved.

**Request Body** _(required)_

  | Field | Type | Description |
  |-------|------|-------------|
  | `asset` | string | The fiat asset code (e.g. `usd`) |
  | `bankName` | string | Bank name (e.g. `Test Bank One`) |
  | `accountName` | string | Account name (e.g. `Test Account Holder`) |
  | `iban` | string | International Bank Account Number (e.g. `GB00TEST01234567890123456`) |
  | `bic` | string | Bank Identifier Code (e.g. `TESTGB22`) |
  | `intermediaryBic` | string | Intermediary Bank Identifier Code (e.g. `TESTGB2L`) |
  | `accountNumber` | string | Account number (e.g. `01234567`) |
  | `sortCode` | string | Sort code (e.g. `000001`) |

**Responses**

- **201**: Created

  | Field | Type | Description |
  |-------|------|-------------|
  | `asset` | string | The fiat asset code (e.g. `USD`) |
  | `bankName` | string | Bank name (e.g. `Test Bank One`) |
  | `accountName` | string | Account name (e.g. `Test Account Holder`) |
  | `iban` | string | International Bank Account Number (masked for withdrawal) (e.g. `GB00TEST01234567890123456`) |
  | `bic` | string | Bank Identifier Code (masked for withdrawal) (e.g. `TESTGB22`) |
  | `intermediaryBic` | string | Intermediary Bank Identifier Code (masked for withdrawal) (e.g. `TESTGB2L`) |
  | `accountNumber` | string | Account number (masked for withdrawal) (e.g. `00012345`) |
  | `sortCode` | string | Sort code (masked for withdrawal) (e.g. `042231`) |
  | `status` | string | The approval status of the bank details. Only present for withdrawal bank details. (e.g. `APPROVED`) |

- **400**: Bad request

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


  Example (Invalid bank details request):
  ```json
  {"code":"INVALID_BANK_DETAILS_REQUEST","description":"Invalid bank details request"}
  ```
- **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"}
  ```
- **503**: Custody provider not reachable or unavailable

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


  Example (Service unavailable):
  ```json
  {"code":"SERVICE_UNAVAILABLE_ERROR","description":"Service unavailable"}
  ```

**Example**

```bash
curl -X POST "https://api.demo.omniaexchange.com/api/v2/withdrawal-bank-details" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"asset": "usd", "bankName": "Test Bank One", "accountName": "Test Account Holder", "iban": "GB00TEST01234567890123456", "bic": "TESTGB22", "intermediaryBic": "TESTGB2L", "accountNumber": "01234567", "sortCode": "000001"}'
```

---

## Delete Withdrawal Bank Details

`DELETE /v2/withdrawal-bank-details`

Delete withdrawal bank details by asset and bank name.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `asset` | query | Yes | string | The fiat asset of the withdrawal bank details to delete. (e.g. `USD`) |
| `bank_name` | query | Yes | string | The bank name of the withdrawal bank details to delete. (e.g. `ClearBank`) |

**Responses**

- **204**: Deleted
- **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"}
  ```
- **404**: Bank details not found

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


  Example (Not found):
  ```json
  {"code":"NOT_FOUND","description":"No bank details found for the specified asset"}
  ```
- **503**: Custody provider not reachable or unavailable

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


  Example (Service unavailable):
  ```json
  {"code":"SERVICE_UNAVAILABLE_ERROR","description":"Service unavailable"}
  ```

**Example**

```bash
curl -X DELETE "https://api.demo.omniaexchange.com/api/v2/withdrawal-bank-details" \
  -H "Authorization: Bearer <token>"
```

---

## Get Deposit Bank Details

`GET /v2/deposit-bank-details`

Get bank details to deposit fiat assets to. If no asset is provided, all bank details are returned.

**Parameters**

| Name | In | Required | Type | Description |
|------|-----|----------|------|-------------|
| `asset` | query | No | string | The fiat asset to get bank details for. If omitted, all bank details are returned. (e.g. `GBP`) |

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `bankDetails` | BankDetail[] | List of bank details for the requested asset |


  Example (Single Bank Details):
  ```json
  {"bankDetails":[{"asset":"USD","bankName":"Test Bank One","accountName":"Test Account Holder","iban":"GB00TEST01234567890123456","bic":"TESTGB22","intermediaryBic":"TESTGB2L","accountNumber":"00012345","sortCode":"042238001"}]}
  ```
- **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"}
  ```
- **404**: Bank details not found

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


  Example (Not found):
  ```json
  {"code":"NOT_FOUND","description":"No bank details found for the specified asset"}
  ```
- **503**: Custody provider not reachable or unavailable

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


  Example (Service unavailable):
  ```json
  {"code":"SERVICE_UNAVAILABLE_ERROR","description":"Service unavailable"}
  ```

**Example**

```bash
curl "https://api.demo.omniaexchange.com/api/v2/deposit-bank-details" \
  -H "Authorization: Bearer <token>"
```

---

## Get Deposit Reference

`GET /v2/deposit-reference`

Get the deposit reference for the authenticated user. This reference must be quoted when making a bank transfer for fiat deposits.

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `depositReference` | string | The deposit reference to quote when making a bank transfer (e.g. `LMXG/1234567890`) |


  Example (Deposit Reference):
  ```json
  {"depositReference":"LMXG/1234567890"}
  ```
- **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/deposit-reference" \
  -H "Authorization: Bearer <token>"
```

---

## Get Deposit Addresses

`GET /v2/deposit-addresses`

Get all deposit addresses associated with your account. These are the addresses you can use to deposit funds.

**Responses**

- **200**: Ok

  | Field | Type | Description |
  |-------|------|-------------|
  | `addresses` | DepositAddress[] | List of deposit addresses associated with your account |


  Example (Deposit Addresses):
  ```json
  {"addresses":[{"address":"0x1234567890abcdef1234567890abcdef12345678","depositAddressReference":"Main ETH deposit","depositLocation":"ETHEREUM"}]}
  ```
- **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/deposit-addresses" \
  -H "Authorization: Bearer <token>"
```

---

## Create Deposit Address

`POST /v2/deposit-addresses`

Request a new deposit address on a specified blockchain. If one already exists for the specified blockchain, it will be returned instead of creating a new one.

**Request Body** _(required)_

  | Field | Type | Description |
  |-------|------|-------------|
  | `depositLocation` | string | Blockchain network to generate a deposit address on (e.g. `ETHEREUM`) |
  | `depositAddressReference` | string | Label for the deposit address (e.g. `Main ETH deposit`) |

**Responses**

- **201**: Created

  | Field | Type | Description |
  |-------|------|-------------|
  | `address` | string | The deposit address (e.g. `0x1234567890abcdef1234567890abcdef12345678`) |
  | `depositAddressReference` | string | Deposit address reference (e.g. `Main ETH deposit`) |
  | `depositLocation` | string | The deposit location (e.g. `ETHEREUM`) |

- **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 -X POST "https://api.demo.omniaexchange.com/api/v2/deposit-addresses" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"depositLocation": "ETHEREUM", "depositAddressReference": "Main ETH deposit"}'
```

---

