# TradingAPIApi

All URIs are relative to *https://api.metacopier.io*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**closeAllPositions**](#closeallpositions) | **POST** /rest/api/v1/accounts/{accountId}/actions/closeAllPositions | Close all account positions|
|[**closePosition**](#closeposition) | **DELETE** /rest/api/v1/accounts/{accountId}/positions/{positionId} | Close an account position|
|[**getHistoryPositions**](#gethistorypositions) | **GET** /rest/api/v1/accounts/{accountId}/history/positions | Get account history positions|
|[**getInformation**](#getinformation) | **GET** /rest/api/v1/accounts/{accountId}/information | Get account information|
|[**getPositions**](#getpositions) | **GET** /rest/api/v1/accounts/{accountId}/positions | Get account positions|
|[**getQuote**](#getquote) | **GET** /rest/api/v1/accounts/{accountId}/quote/{symbol} | Get market quote for a symbol|
|[**getSymbol**](#getsymbol) | **GET** /rest/api/v1/accounts/{accountId}/symbols/{symbol} | Get a specific account symbol|
|[**getSymbols**](#getsymbols) | **GET** /rest/api/v1/accounts/{accountId}/symbols | Get account symbols|
|[**modifyPosition**](#modifyposition) | **PUT** /rest/api/v1/accounts/{accountId}/positions/{positionId} | Modify an account position|
|[**openPosition**](#openposition) | **POST** /rest/api/v1/accounts/{accountId}/positions | Open an account position|
|[**sendOrder**](#sendorder) | **POST** /rest/api/v1/accounts/{accountId}/orders | Send an account order|

# **closeAllPositions**
> closeAllPositions()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)

const { status, data } = await apiInstance.closeAllPositions(
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | No Content |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **closePosition**
> closePosition()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let positionId: string; // (default to undefined)

const { status, data } = await apiInstance.closePosition(
    accountId,
    positionId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|
| **positionId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | No Content |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getHistoryPositions**
> Array<PositionDTO> getHistoryPositions()

The history is not updated in real-time. There may be a delay of up to 3 minutes

### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let start: string; //ISO 8601 (default to undefined)
let stop: string; //ISO 8601 (default to undefined)

const { status, data } = await apiInstance.getHistoryPositions(
    accountId,
    start,
    stop
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|
| **start** | [**string**] | ISO 8601 | defaults to undefined|
| **stop** | [**string**] | ISO 8601 | defaults to undefined|


### Return type

**Array<PositionDTO>**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getInformation**
> AccountInformationDTO getInformation()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)

const { status, data } = await apiInstance.getInformation(
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

**AccountInformationDTO**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getPositions**
> Array<PositionDTO> getPositions()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)

const { status, data } = await apiInstance.getPositions(
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

**Array<PositionDTO>**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getQuote**
> MarketQuoteDTO getQuote()

Fetches the current bid price, ask price, and timestamp for a specific trading symbol. Note: Not all platforms support real-time quote fetching. If there is no response or an error is returned, it means the platform does not support this feature.

### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let symbol: string; //Symbol name (e.g., EURUSD, GBPJPY) (default to undefined)

const { status, data } = await apiInstance.getQuote(
    accountId,
    symbol
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|
| **symbol** | [**string**] | Symbol name (e.g., EURUSD, GBPJPY) | defaults to undefined|


### Return type

**MarketQuoteDTO**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getSymbol**
> SymbolDTO getSymbol()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let symbol: string; //Symbol name (e.g., EURUSD, GBPJPY) (default to undefined)

const { status, data } = await apiInstance.getSymbol(
    accountId,
    symbol
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|
| **symbol** | [**string**] | Symbol name (e.g., EURUSD, GBPJPY) | defaults to undefined|


### Return type

**SymbolDTO**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **getSymbols**
> Array<SymbolDTO> getSymbols()


### Example

```typescript
import {
    TradingAPIApi,
    Configuration
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)

const { status, data } = await apiInstance.getSymbols(
    accountId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

**Array<SymbolDTO>**

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **modifyPosition**
> modifyPosition(positionRequestDTO)

For partial close you can use this endpoint. Only volume, open price, take profit, and stop loss can be modified.

### Example

```typescript
import {
    TradingAPIApi,
    Configuration,
    PositionRequestDTO
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let positionId: string; // (default to undefined)
let positionRequestDTO: PositionRequestDTO; //

const { status, data } = await apiInstance.modifyPosition(
    accountId,
    positionId,
    positionRequestDTO
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **positionRequestDTO** | **PositionRequestDTO**|  | |
| **accountId** | [**string**] |  | defaults to undefined|
| **positionId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | No Content |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **openPosition**
> openPosition(positionRequestDTO)


### Example

```typescript
import {
    TradingAPIApi,
    Configuration,
    PositionRequestDTO
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let positionRequestDTO: PositionRequestDTO; //

const { status, data } = await apiInstance.openPosition(
    accountId,
    positionRequestDTO
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **positionRequestDTO** | **PositionRequestDTO**|  | |
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | No Content |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **sendOrder**
> sendOrder(positionRequestDTO)

Places an order and returns immediately. The endpoint does not wait for the trade to be executed and therefore does not confirm whether the execution was successful or not. To open positions, use the /positions endpoint.

### Example

```typescript
import {
    TradingAPIApi,
    Configuration,
    PositionRequestDTO
} from 'js-metacopier-api';

const configuration = new Configuration();
const apiInstance = new TradingAPIApi(configuration);

let accountId: string; // (default to undefined)
let positionRequestDTO: PositionRequestDTO; //

const { status, data } = await apiInstance.sendOrder(
    accountId,
    positionRequestDTO
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **positionRequestDTO** | **PositionRequestDTO**|  | |
| **accountId** | [**string**] |  | defaults to undefined|


### Return type

void (empty response body)

### Authorization

[ApiKeyAuth](../README.md#ApiKeyAuth)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: Not defined


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**204** | No Content |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

