# How to integrate B2TRADER

This instruction describes how to create a platform, product group, and products that are required for enabling B2TRADER functionalities via the the B2CORE Back Office.

{% hint style="info" %}
Before you start configuring the B2TRADER platform and product in the Back Office, make sure that a connection to B2TRADER 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 B2TRADER

To create a platform for B2TRADER:

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

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

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

* 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.
* In the **Available connection providers** dropdown, select **B2TraderBrokeragePlatform**.
* In the **Connection** dropdown, select the previously configured B2TRADER connection.
  {% 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.
* Make sure that **No** is selected in the **Demo** dropdown.
* In the **Status** dropdown, select **Enabled**.
  {% 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 B2TRADER

To create a product group for B2TRADER:

{% 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. This caption will be assigned to the product group in the Back Office and will be visible to clients in the B2CORE UI.
* 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 B2TRADER

To manage both live and demo accounts, as well as **Hedging** and **Netting** types, separate products must be created for B2TRADER in the B2CORE Back Office.

To create a product for B2TRADER:

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

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

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

* In the **Platform group** dropdown, select the appropriate group existing on the B2TRADER platform.
* In the **Currency** dropdown, select the currency for the product. The available currency options in B2CORE depend on the settings of the selected platform group.
* In the **Account type** dropdown, select **Hedging** or **Netting**.
* In the **Name** field, enter a unique name for the product.
* In the **Group** dropdown, select the previously created [product group](#how-to-create-a-product-group-for-b2trader) to include the product into that group.
* 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 **Name** field, you can modify the product name. The name must be unique.
* In the **Caption** field, enter a caption for the product. This caption will be assigned to the product in the Back Office and will be visible to clients in the B2CORE UI.
* In the **Default** leverage field, enter the default leverage ratio that will be assigned to accounts created automatically when the **Auto creation on login** option is triggered.
* In the **Leverage** field, enter one or more leverage ratios that client can select when creating accounts via the B2CORE UI.
* In the **Rights** and **Default account rights** dropdowns, select the required permissions that will be applied to the product (such as `Enabled`, `Deposit`, `Withdraw`, `Visible`, `Transfer deposit`, `Transfer withdraw`, and `Exchange`).
* 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, select:
  * **Send** or **Default** — to automatically send email notifications to clients when new accounts are created, providing them with the necessary details to start trading.
  * **Don't send** — to disable email notifications about new accounts.
* In the **Mail template** dropdown, select the email template `accountCreated` that will be used to send notifications about new accounts.
* In the **Start amount** field, specify the amount that will be automatically deposited to *demo* accounts upon their creation.
* In the **Auto creation on login** dropdown, select:
  * **Yes** – to automatically create accounts based on the product settings when clients first sign in to the B2CORE UI.
  * **No** – to create accounts based on this product manually.
* In the **Agreement link** field, specify a link to the document to which clients must consent in order to open accounts via the B2CORE UI.
* In the **Link info** field, specify a link to a resource with additional product information, which clients can access when creating accounts via the B2CORE UI.
* On the **Currencies** tab, you can review the currency associated with the product and add more currencies if necessary. The available currency options are limited by the settings of the platform groups configured on the B2TRADER platform.
* After configuring the product settings, activate it by selecting **Enabled** in the **Status** dropdown.
  {% endstep %}

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

B2TRADER accounts can now be created based on the product via the Back Office or B2CORE UI. Any changes to product settings will directly impact how the product is displayed and functions for clients in the B2CORE UI.
