External connections

Use these methods to manage connections to trading platforms, payment systems and other third-party service providers that are integrated with B2Core.

GET[host]/api/v2/connections

Get a list of external connections

GET[host]/api/v2/connections/{connectionId}

Get external connection details

POST[host]/api/v2/connections

Create a new external connection

PATCH[host]/api/v2/connections/{connectionId}

Update an external connection

DELETE[host]/api/v2/connections/{connectionId}

Delete an external connection

Use these methods to get a list of third-party service providers for which connections are configured in the Back Office.

GET[host]/api/v2/connections/providers

Get a list of providers

GET[host]/api/v2/connections/providers/{provider}/settings

Get provider connection details

Get a list of external connections

Use this method to obtain a list of external connections configured in the Back Office.

To obtain detailed information about a specific connection, use a separate method to get external connection details.

Request

Header parameters:

  • Authorization: Bearer <token>

Query parameters:

The following filter parameters are available for this method:

provider

The name of a service provider for which a connection is configured.

To get a list of service provider names, use the method to get a list of providers.

enabled

If true, an external connection is enabled; otherwise, false.

The following sorting parameter is available for this method:

createTime

The date and time when an external connection was configured in the Back Office.

Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.

GET[host]/api/v2/connections

curl --location -g --request GET 'https://host.name/api/v2/connections?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[provider]=IDWise&filter[enabled]=true' \
--header 'Authorization: Bearer <token>'

Response

A response includes an array of External Connection objects providing information about the connections matching the request parameters.

Get external connection details

Use this method to obtain detailed information about a specified external connection.

To obtain a list of external connections configured in the Back Office, use a separate method to get a list of external connections.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

connectionId required

The identifier of an external connection.

GET[host]/api/v2/connections/{connectionId}

curl --location --request GET 'https://host.name/api/v2/connections/1' \
--header 'Authorization: Bearer <token>'

Response

A response contains an External Connection object providing information about a specified connection.

Create a new external connection

Use this method to configure a new external connection.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Body:

Specify the following parameters for a new connection:

name string required

The external connection name.

caption string required

The external connection name used in the Back Office.

provider string required

The name of a service provider for which you want to configure a connection.

enabled boolean required

If true, a connection is enabled; otherwise, false.

providerOptions object required

The connection settings specific to a service provider.

To get the data about the connection settings required for a particular service provider, use the method to get provider connection details.

POST[host]/api/v2/products

curl --location --request POST 'https://host.name/api/v2/connections' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "b2binpay",
  "caption": "B2BinPay",
  "provider": "B2BinPay",
  "enabled": false,
  "providerOptions": {
    "location": "https://api-sandbox.b2binpay.com",
    "login": "user1",
    "password": "Qwerty123"
  }
}'

Response

A response includes an External Connection object providing information about the created connection.

Update an external connection

Use this method to update a specified external connection.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

connectionId required

The identifier of an external connection.

Body:

The following field values can be updated for a specified connection:

name string

The external connection name.

caption string

The external connection name used in the Back Office.

provider string

The name of a service provider for which a connection is configured.

enabled boolean

If true, a connection is enabled; otherwise, false.

providerOptions object

The connection settings specific to a service provider.

PATCH[host]/api/v2/connections/{connectionId}

curl --location --request PATCH 'https://host.name/api/v2/connections/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
  "name": "b2binpay_test",
  "caption": "B2BinPay",
  "provider": "B2BinPay",
  "enabled": true,
  "providerOptions": {
    "location": "https://api-sandbox.b2binpay.com",
    "login": "user2",
    "password": "Qwerty123"
}'

Response

A response includes an External Connection object providing information about the connection that was updated.

Delete an external connection

Use this method to delete a specified external connection.

Request

Header parameters:

  • Authorization: Bearer <access_token>

Path parameters:

connectionId required

The identifier of an external connection.

DELETE[host]/api/v2/connections/{connectionId}

curl --location --request DELETE 'https://ahost.name/api/v2/connections/1' \
--header 'Authorization: Bearer <token>'

Response

In case of success, no response body is returned.

Get a list of providers

Use this method to obtain a list of service providers for which connections are configured in the Back Office.

Request

Header parameters:

  • Authorization: Bearer <token>

GET[host]/api/v2/connections/providers

curl --location --request GET 'https://host.name/api/v2/connections/providers' \
--header 'Authorization: Bearer <token>'

Response

A response includes an array or string values specifying the names of service providers for which connections are configured in the Back Office.

RESPONSE EXAMPLE
[
  "B2BinPay",
  "DXtrade",
  "cTrader",
  "TwillioVoice",
  "B2Trader"
]

Get provider connection details

Use this method to obtain the data about connection settings that must be configured for a specified service provider in order to connect it to B2Core.

In the Back Office, the connection settings specified for a service provider can be found in the connection details upon navigating to System > External Connections.

Request

Header parameters:

  • Authorization: Bearer <token>

Path parameters:

provider required

The service provider name.

To get a list of service provider names, use the method to get a list of providers.

GET[host]/api/v2/connections/providers/{provider}/settings

curl --location --request GET 'https://host.name/api/v2/connections/providers/IDWise/settings' \
--header 'Authorization: Bearer <token>'

Response

A response includes an object providing the data about connection settings that must be configured for a specified service provider.

The connection settings are different for each service provider.

The response example illustrates the settings that are required for connecting to the IDWise KYC provider.

RESPONSE EXAMPLE
{
  "api_base_url": {
    "label": "API base URL",
    "rule":[
        "required",
        "url"
    ],
    "class": "RabbitCMS\\Forms\\Controls\\Input",
    "name": "api_base_url",
    "classes": [],
    "values": null,
    "messages": []
  },
  "api_key": {
    "label":"API Kky",
    "rule": "required",
    "class": "RabbitCMS\\Forms\\Controls\\Input",
    "name": "api_key",
    "classes": [],
    "values": null,
    "messages": []
  }
}