# How to integrate DXtrade

This instruction describes how to create platforms, product groups, and products that are required for enabling DXtrade via the Back Office.

To manage live and demo trading accounts, you must configure two separate platforms and products. However, if both live and demo accounts are located on the same DXtrade platform in your infrastructure and are separated only by groups, it isn’t necessary to create two platforms. In this case, create one platform and two products — one for live accounts and one for demo accounts — in the B2CORE Back Office.

{% hint style="info" %}
Before you start configuring DXtrade platforms and products in the Back Office, make sure that a connection to DXtrade has already been set up by your account manager who is assigned the permissions to manage external connections.
{% endhint %}

## How to create a platform for DXtrade

If both live and demo accounts are located on the same DXtrade platform in your infrastructure, create a single platform in the B2CORE Back Office. If they are located on separate platforms, create two separate platforms for DXtrade.

To create a platform for DXtrade:

{% stepper %}
{% step %}
Navigate to **Products** > **Platforms**.
{% endstep %}

{% step %}
Click the **Create** in the upper-right page corner, and then select **DXtrade** in the dropdown.

* In the **Name** field, enter a name that you want to use for the platform.
* In the **Caption** field, enter a caption that will be applied to the platform in the Back Office (such as **DXtrade Live** or **DXtrade Demo**).
* In the **Available connection providers** dropdown, select **DXtrade**.
* In the **Connection** dropdown, select **DXtrade**.
  {% endstep %}

{% step %}
Click **Save** to proceed.
{% endstep %}

{% step %}
On the **Edit platform** page, specify the following settings:

* In the **Short caption** field, you can optionally specify a short platform name.
* If you configure a demo platform for DXtrade, select **Yes** in the **Demo** dropdown; otherwise, make sure that **No** is selected.
* In the **Status** dropdown, select **Enabled**.
* In the **Web Terminal URL**, optionally specify the URL of the web trading terminal for DXtrade. If specified, the **Trade** button will be displayed on account cards in the B2CORE UI, enabling clients to open the web terminal by clicking the button.
  {% endstep %}

{% step %}
Click **Test connection** to validate the connection settings.

The checkmark displayed on the **Test connection** button indicates that the connection has been configured properly.
{% endstep %}

{% step %}
After the connection settings have been successfully validated, click **Save**.
{% endstep %}
{% endstepper %}

## How to create a product group for DXtrade

To create a product group for DXtrade:

{% stepper %}
{% step %}
Navigate to **Products** > **Groups**.
{% endstep %}

{% step %}
Click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
On the **Create group** page, fill in the following fields:

* In the **Caption** field, enter a caption that you want to use for the group.
* In the **Description** field, enter a group description.
* In the **Type** dropdown, select **Default**.
  {% endstep %}

{% step %}
Click **Save** to create the product group.
{% endstep %}
{% endstepper %}

## How to create a product for DXtrade

To separate live and demo accounts, two products must be created in the B2CORE Back Office — one for live accounts and one for demo accounts.

To create a product for DXtrade:

{% stepper %}
{% step %}
Navigate to **Products** > **Products**.
{% endstep %}

{% step %}
Click the **Create** in the upper-right page corner, and then select the previously created [DXtrade platform](#how-to-create-a-platform-for-dxtrade) in the dropdown.
{% endstep %}

{% step %}
In the **Create product** popup, fill in the following fields:

* In the **Platform Group** dropdown, select **Default**.
* In the **Currency** dropdown, select one or more currencies that you want to enable for the product.
* In the **Account number prefix** field, enter a prefix to be added to DXtrade account numbers. This helps distinguish, for example, live and demo accounts or accounts belonging to different brands within one DXtrade infrastructure. The maximum prefix length is 14 characters.

{% hint style="info" %}
The prefix is applied only to newly created accounts. Existing accounts remain unchanged.
{% endhint %}

* Set up the following DXtrade-specific settings: **Auto Execution**, **Commissions**, **Financing**, **Limits**, **Margining**, **Spreads**, and **Trading**, which are used to customize trading conditions on the DXtrade platform.

{% hint style="warning" %}
After the product is created, the DXtrade-specific settings can't be modified.
{% endhint %}

* In the **Name** field, enter a name that you want to use for the product.
* In the **Group** dropdown, select the previously created [product group](#how-to-create-a-product-group-for-dxtrade).
* In the **Type** dropdown, select:
  * **Trade** — if you create a product for managing live accounts
  * **Demo** — if you create a product for managing demo accounts
    {% endstep %}

{% step %}
Click **Save** to proceed.
{% endstep %}

{% step %}
On the **Edit product** page, specify the following product settings:

* In the **Rights** and **Default account rights** dropdowns, select the required permissions that will be applied to the product (such as `Enabled`, `Visible`, `Trade enabled`, `Transfer deposit`, and `Transfer withdraw`).
* In the **Max accounts** field, enter an integer value to define the maximum number of accounts that clients can create when using this product.
  * To set no limit on the number of accounts, specify **-1**.
  * To forbid clients to create accounts, specify **0**.
* In the **Mail** dropdown, **Don't send** must be selected. Upon creating the first account, a client receives an email with the credentials for the trading terminal. No emails are sent when subsequent accounts are created.
* In the **Start amount** field, specify the amount that will be automatically deposited to demo trading accounts upon their opening.
* In the **Auto creation on login** dropdown, select either of the two values:
  * **Yes** — to automatically create trading accounts based on the product settings for all clients upon their first sign in to the B2CORE UI.
  * **No** — to create trading accounts manually.
* In the **Status** dropdown, select **Enabled**.
* If you want to enable additional currencies for the product, add them on the **Currencies** tab.

You may also want to configure the other product settings available on the **Edit product** page.
{% endstep %}

{% step %}
Click **Save** to create the product.
{% endstep %}
{% endstepper %}

All settings changes made on the **Edit product** page will directly impact how the product is displayed and functions in the B2CORE UI for clients.
