Products
Use these methods to create and manage products, product groups, product currencies and product notes.
GET[host]/api/v2/products |
|
GET[host]/api/v2/products/{productId} |
|
POST[host]/api/v2/products |
|
PUT[host]/api/v2/products/{productId} PATCH[host]/api/v2/products/{productId} |
|
DELETE[host]/api/v2/products/{productId} |
GET[host]/api/v2/products/groups |
|
GET[host]/api/v2/products/groups/{groupId} |
|
POST[host]/api/v2/products/groups |
|
PUT[host]/api/v2/products/groups/{groupId} PATCH[host]/api/v2/products/groups/{groupId} |
|
DELETE[host]/api/v2/products/groups/{groupId} |
GET[host]/api/v2/products/{productId}/currencies |
|
GET[host]/api/v2/products/{productId}/currencies/{currencyId} |
|
POST[host]/api/v2/products/{productId}/currencies |
|
PUT[host]/api/v2/products/{productId}/currencies/{currencyId} PATCH[host]/api/v2/products/{productId}/currencies/{currencyId} |
|
DELETE[host]/api/v2/products/{productId}/currencies/{currencyId} |
GET[host]/api/v2/products/{productId}/preferences |
|
GET[host]/api/v2/products/{productId}/preferences/{preferenceId} |
|
POST[host]/api/v2/products/{productId}/preferences |
|
PATCH[host]/api/v2/products/{productId}/preferences/{preferenceId} |
|
DELETE[host]/api/v2/products/{productId}/preferences/{preferenceId} |
GET[host]/api/v2/products/{productId}/restrictions |
|
GET[host]/api/v2/products/{productId}/restrictions/{restrictionId} |
|
POST[host]/api/v2/products/{productId}/restrictions |
|
PUT[host]/api/v2/products/{productId}/restrictions/{restrictionId} PATCH[host]/api/v2/products/{productId}/restrictions/{restrictionId} |
|
DELETE[host]/api/v2/products/{productId}/restrictions/{restrictionId} |
Get a list of products
Use this method to obtain a list of products available in the Back Office.
To obtain detailed information about a specific product, use a separate method to get product details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- platformId
The identifier of a platform for which a product is created.
- groupId
The identifier of a product group in which a product is included.
- type
The product type. Possible values:
personal
trade
demo
partner
liquidity
exchange
external
system
- currencyCode
The numeric code of a product currency.
- status
The product status. Possible values:
disabled
present
hidden
enabled
default
The following sorting parameters are available for this method:
- id (default)
The product identifier.
- name
The product name used in the Back Office.
- createTime
The date and time when a product was created 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/products
curl --location -g --request GET 'https://host.name/api/v2/products?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[platformId]=1&filter[groupId]=1&filter[type]=personal&filter[currencyCode]=1&filter[status]=disabled' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Product objects providing information about the products matching the request parameters.
Get product details
Use this method to obtain detailed information about a specified product.
To obtain a list of available products created in the Back Office, use a separate method to get a list of products.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
GET[host]/api/v2/products/{productId}
curl --location --request GET 'https://host.name/api/v2/products/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains a Product object providing information about the specified product.
Create a new product
Use this method to create a new product.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
Specify the following parameters for a product:
- numericCodes array required
An array of integer values specifying numeric codes of currencies enabled for a product.
- factory integer required
This parameter is set to
100
if product-associated accounts are denominated in currency subunits (for example, cents); otherwise, set to1
.- groupId integer required
The identifier of a product group in which a product is included.
- name string required
The product name used in the Back Office.
- platformId integer required
The identifier of a platform for which a product is created.
- agreementLink string
A link to a document to which a client must consent in order to open a product-associated account.
- autoCreateOnLogin boolean
If
true
, a product-associated account is created automatically for each client upon initial sign in to the B2Core UI; otherwise,false
.- caption string
The product name displayed to clients in the B2Core UI.
- defaultLeverage integer
The default leverage ratio specified for a product.
- defaultAccountPermissions array
An array of string values specifying permissions applied to product-associated accounts. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- leverages array
An array of integer values specifying optional leverage ratios specified for a product.
- linkInfo string
A link to a resource providing additional information about a product.
- mailTemplate string
The email template used to notify clients about created accounts.
- maxAccounts integer
The maximum number of accounts that can be created for a client.
- minDepositAmount integer
Applicable only for trading accounts.
The minimum required deposit amount.
- options object
The details specific to a platform for which a product is created.
- platformGroup array
An array of string values specifying groups defined on a platform for which a product is created.
- requestRequired boolean
If
true
, when opening a new account via the B2Core UI, a client request (which must be approved or rejected by an admin) is always created; otherwise,false
.- permissions array
An array of string values specifying permissions applied to a product. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- sendMailSetting string
Indicates whether to notify a client about a created account via email. Possible values:
dontSend
default
send
- startAmounts array
Applicable only for demo accounts.
An array of number values specifying the initial amounts to be deposited to demo accounts.
- type string
The product type. Possible values:
personal
trade
demo
partner
liquidity
exchange
external
system
- resources object
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
POST[host]/api/v2/products
curl --location --request POST 'https://host.name/api/v2/products' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"numericCodes": [
840
],
"factory": 1,
"groupId": 1,
"name": "mt5_live",
"platformId": 1,
"agreementLink": "Link",
"autoCreateOnLogin": true,
"caption": "MT5 Live",
"defaultLeverage": 1,
"defaultAccountPermissions": [
"deposit",
"enabled",
"trade",
"transferDeposit",
"transferWithdrawal",
"visible"
],
"leverages": [
5,
10
],
"linkInfo": "Link",
"mailTemplate": "accountCreated",
"maxAccounts": 1,
"minDepositAmount": 50,
"options": {},
"platformGroup": [
"",
""
],
"requestRequired": false,
"permissions": [
"deposit",
"enabled",
"trade",
"transferDeposit",
"transferWithdrawal",
"visible"
],
"sendMailSetting": "default",
"startAmounts": [
100,
200
],
"type": "trade",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "Lorem"
},
{
"key": "caption",
"locale": "en_US",
"value": "Lorem"
}
]
}'
Response
A response includes a Product object providing information about the created product.
Update a product
Use this method to update a specified product.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
Body:
The following field values can be updated for a specified product:
- agreementLink string
A link to a document to which a client must consent in order to open a product-associated account.
- autoCreateOnLogin boolean
If
true
, a product-associated account is created automatically for each client upon initial sign in to the B2Core UI; otherwise,false
.- caption
The product name displayed to clients in the B2Core UI.
- defaultLeverage integer
The default leverage ratio specified for a product.
- defaultAccountPermissions array
An array of string values specifying permissions applied to product-associated accounts. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- groupId integer
The identifier of a product group in which a product is included.
- leverages array
An array of integer values specifying optional leverage ratios specified for a product.
- linkInfo string
A link to a resource providing additional information about a product.
- mailTemplate string
The email template used to notify clients about created accounts.
- maxAccounts integer
The maximum number of accounts that can be created for a client.
- minDepositAmount integer
Applicable only for trading accounts.
The minimum required deposit amount.
- name
The product name used in the Back Office.
- options object
The details specific to a platform for which a product is created.
- priority
The priority index assigned to a product.
- requestRequired boolean
If
true
, when opening a new account via the B2Core UI, a client request (which must be approved or rejected by an admin) is always created; otherwise,false
.- permissions array
An array of string values specifying permissions applied to a product. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- sendMailSetting string
Indicates whether to notify a client about a created account via email. Possible values:
dontSend
default
send
- startAmounts array
Applicable only for demo accounts.
An array of number values specifying the initial amounts to be deposited to demo accounts.
- status
The product status. Possible values:
disabled
present
hidden
enabled
default
- type
The product type. Possible values:
personal
trade
demo
partner
liquidity
exchange
external
system
- resources array
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
PUT[host]/api/v2/products/{productId}
curl --location --request PUT 'https://host.name/api/v2/products/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"agreementLink": "Link",
"autoCreateOnLogin": true,
"caption": "MT5 Live",
"defaultLeverage": 1,
"defaultAccountPermissions": [
"deposit",
"enabled",
"trade",
"transferDeposit",
"transferWithdrawal",
"visible"
],
"groupId": 1,
"leverages": [
5,
10
],
"linkInfo": "Link",
"mailTemplate": "accountCreated",
"maxAccounts": 1,
"minDepositAmount": 50,
"name": "mt5_live",
"options": {},
"priority": 4,
"requestRequired": true,
"permissions": [
"deposit",
"enabled",
"trade",
"transferDeposit",
"transferWithdrawal",
"visible"
],
"sendMailSetting": "dontSend",
"startAmounts": [
100,
200
],
"status": "disabled",
"type": "trade",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "Lorem"
},
{
"key": "caption",
"locale": "en_US",
"value": "Lorem"
}
]
}'
Response
A response includes a Product object providing information about the product that was updated.
Delete a product
Use this method to delete a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
DELETE[host]/api/v2/products/{productId}
curl --location --request DELETE 'https://host.name/api/v2/products/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of product groups
Use this method to obtain a list of product groups available in the Back Office.
To obtain detailed information about a specific product group, use a separate method to get product group details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- status
The status assigned to a product group. Possible values:
disabled
enabled
- type
The product group type.
The following sorting parameters are available for this method:
- caption
The product group name.
- priority
The priority index assigned to a product group.
- createTime
The date and time when a product group was created 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/products/groups
curl --location -g --request GET 'https://host.name/api/v2/products/groups?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[status]=disabled&filter[type]=default' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Product Group objects providing information about the product groups matching the request parameters.
Get product group details
Use this method to obtain detailed information about a specified product group.
To obtain a list of available product groups created in the Back Office, use a separate method to get a list of product groups.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- groupId required
The product group identifier.
GET[host]/api/v2/products/groups/{groupId}
curl --location --request GET 'https://host.name/api/v2/products/groups/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains a Product Group object providing information about the specified product group.
Create a new product group
Use this method to create a new product group.
Request
Header parameters:
Authorization: Bearer <access_token>
Body:
Specify the following parameters for a product group:
- caption string required
The product group name.
- description string required
The product group description.
- status string required
The status assigned to a product group. Possible values:
disabled
enabled
- type string
The product group type.
- resources array
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
POST[host]/api/v2/products/groups
curl --location --request POST 'https://host.name/api/v2/products/groups' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"caption": "Stable Coins",
"description": "Stable Coins",
"status": "disabled",
"type": "default",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "Lorem"
},
{
"key": "caption",
"locale": "en_US",
"value": "Lorem"
}
]
}'
Response
A response includes a Product Group object providing information about the created product group.
Update a product group
Use this method to update a specified product group.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- groupId required
The product group identifier.
Body:
The following field values can be updated for a specified product group:
- caption string
The product group name.
- description string
The product group description.
- status string
The status assigned a product group. Possible values:
disabled
enabled
- type string
The product group type.
- priority integer
The priority index assigned to a product group.
- resources array
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
PUT[host]/api/v2/products/groups/{groupId}
curl --location --request PUT 'https://host.name/api/v2/products/groups/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data-raw '{
"caption": "stable _coins",
"status": "enabled",
"type": "default",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "Lorem"
},
{
"key": "caption",
"locale": "en_US",
"value": "Lorem"
}
],
"priority": 1
}'
Response
A response includes a Product Group object providing information about the product group that was updated.
Delete a product group
Use this method to delete a specified product group.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- groupId required
The product group identifier.
DELETE[host]/api/v2/products/groups/{groupId}
curl --location --request DELETE 'https://host.name/api/v2/products/groups/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of product currencies
Use this method to obtain a list of currencies added to a specified product.
Use a separate method to get product currency details.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameters are available for this method:
- alphabeticCode
The alphabetic code of a currency (such as
USD
).- isEnabled
If
true
, a currency is enabled for a product; otherwise,false
.
The following sorting parameters are available for this method:
- createTime
The date and time when a currency was added to a product.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
Path parameters:
- productId required
The product identifier.
GET[host]/api/v2/products/{productId}/currencies
curl --location -g --request GET 'https://host.nameg/api/v2/products/2/currencies?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[alphabeticCode]=USD&filter[isEnabled]=true' \
--header 'Authorization: Bearer <token>'
Response
A response includes an array of Product Currency objects providing information about the product currencies matching the request parameters.
Get product currency details
Use this method to obtain detailed information about a specified product currency.
Use a separate method to get a list of product currencies.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- currencyId required
The identifier of a product currency.
GET[host]/api/v2/products/{productId}/currencies/{currencyId}
curl --location --request GET 'https://host.name/api/v2/products/2/currencies/1' \
--header 'Authorization: Bearer <token>'
Response
A response contains a Product Currency object providing information about the specified product currency.
Add a new product currency
Use this method to add a new currency to a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The identifier of a product to which a currency is to be added.
Body:
Specify the following parameters when adding a new product currency:
- numericCode integer required
The numeric code of a currency to be added.
- factory integer required
This parameter is set to
100
if product-associated accounts are denominated in currency subunits (for example, cents); otherwise, set to1
.- caption string
The name specified for a product currency.
- platformGroup array
An array of string values specifying platform group names.
POST[host]/api/v2/products/{productId}/currencies
curl --location --request POST 'https://host.name/api/v2/products/2/currencies' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"numericCode": 978,
"factory": 1,
"caption": "EUR",
"platformGroup": [
"eWallet"
]
}'
Response
A response includes a Product Currency object providing information about the added product currency.
Update a product currency
Use this method to update a specified product currency.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- currencyId required
The identifier a product currency to be updated.
Body:
The following field values can be updated for a specified product currency:
- caption string
The name specified for a product currency.
- isEnabled boolean
If
true
, a currency is enabled for a product; otherwise,false
.- priority integer
The priority index assigned to a product currency.
- overwriteProductSettings boolean
If
true
, the settings specific to a product currency overwrite the settings of the product to which this currency is added.- permissions array
An array of string values specifying permissions applied to a product. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- defaultAccountPermissions array
An array of string values specifying permissions applied to accounts denominated in a product currency. Possible values:
deposit
enabled
exchange
trade
transferDeposit
transferWithdrawal
visible
withdrawal
For permission descriptions, refer to Product permissions.
- defaultLeverage integer
The default leverage ratio specified for accounts denominated in a product currency.
- leverages array
An array of integer values specifying optional leverage ratios available to accounts denominated in a product currency.
- maxAccounts integer
The maximum number of accounts denominated in a product currency that can be created for a client.
- startAmounts array
Applicable only for demo accounts.
An array of string values specifying the initial amounts to be deposited to demo accounts denominated in a product currency.
- minDepositAmount string
Applicable only for trading accounts.
The minimum deposit amount required for accounts denominated in a product currency.
- requestRequired boolean
If
true
when opening a new account via the B2Core UI, a client request (which must be approved or rejected by an admin) is always created; otherwise,false
.- autoCreateOnLogin boolean
If
true
, an account denominated in a product currency is created automatically for each client upon initial sign in to the B2Core UI; otherwise,false
.- agreementLink string
A link to a document to which a client must consent in order to open an account in a product currency.
- linkInfo string
A link to a resource providing additional information about a product.
PUT[host]/api/v2/products/{productId}/currencies/{currencyId}
curl --location --request PUT 'https://host.name/api/v2/products/2/currencies/1' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"caption": "USDP",
"isEnabled": true,
"priority": 1,
"overwriteProductSettings": false,
"permissions": [
"deposit",
"enabled",
"visible",
"withdrawal"
],
"defaultAccountPermissions": [
"deposit",
"enabled",
"visible",
"withdrawal"
],
"defaultLeverage": 1,
"leverages": [
1,
5
],
"maxAccounts": 1,
"startAmounts": [
"100.00",
"150.00"
],
"minDepositAmount": "100.00",
"requestRequired": true,
"autoCreateOnLogin": true,
"agreementLink": "https://example.url",
"linkInfo": "https://example.url"
}'
Response
A response includes a Product Currency object providing information about the product currency that was updated.
Delete a product currency
Use this method to remove a currency from a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- currencyId required
The identifier of a product currency to be removed.
DELETE[host]/api/v2/products/{productId}/currencies/{currencyId}
curl --location --request DELETE 'https://host.name/api/v2/products/2/currencies/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of product notes
Use this method to obtain a list of notes added to a specific product.
The notes can include additional information about trading accounts that clients can open based on a product. The clients can view the notes before opening trading accounts in the B2Core UI.
Request
Header parameters:
Authorization: Bearer <token>
Query parameters:
The following filter parameter is available for this method:
- title
The title specified for a product note.
The following sorting parameter is available for this method:
- createTime
The date and time when a note was added to a product.
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
Path parameters:
- productId required
The product identifier.
GET[host]/api/v2/products/{productId}/preferences
curl --location -g 'https://host.name/api/v2/products/1/preferences?limit=10&offset=0&sort_order=desc&sort_by=createTime&filter[title]=title' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response includes an array of Product Note objects providing information about the notes matching the request parameters.
Get product note details
Use this method to obtain detailed information about a specific note added to a product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- preferenceId required
The identifier of a product note.
GET[host]/api/v2/products/{productId}/preferences/{preferenceId}
curl --location 'https://host.name/api/v2/products/1/preferences/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja'
Response
A response contains a Product Note object providing information about the specified note.
Add a new product note
Use this method to add a new note to a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The identifier of a product to which you want to add a note.
Body:
Specify the following parameters when adding a new product note:
- title string required
The title specified for a product note.
- value string required
The text of a note.
- resources object
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
POST[host]/api/v2/products/{productId}/preferences
curl --location 'https://host.name/api/v2/products/1/preferences' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data '{
"title": "title",
"value": "value",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "ja_JP",
"value": "value"
}
]
}'
Response
A response includes a Product Note object providing information about the added note.
Update a product note
Use this method to update a specified product note.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- preferenceId required
The identifier a product note to be updated.
Body:
The following field values can be updated for a specified product note:
- title string
The title specified for a product note.
- value string
The text of a note.
- resources object
An array of resource objects, specifying localized strings for user interface pages displayed to a client.
PATCH[host]/api/v2/products/{productId}/preferences/{preferenceId}
curl --location --request PATCH 'https://host.name/api/v2/products/1/preferences/1' \
--header 'Authorization: Bearer <token>' \
--header 'accept-language: ja' \
--data '{
"title": "Title",
"value": "Text",
"resources": [
{
"key": "caption",
"locale": "ru_RU",
"value": "value"
},
{
"key": "caption",
"locale": "ja_JP",
"value": "value"
}
]
}'
Response
A response includes a Product Note object providing information about the note that was updated.
Delete a product note
Use this method to remove a note that was previously added to a product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- preferenceId required
The identifier of a product note to be removed.
DELETE[host]/api/v2/products/{productId}/preferences/{preferenceId}
curl --location --request DELETE 'https://host.name/api/v2/products/1/preferences/1' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.
Get a list of product restrictions
Use this method to obtain a list of restrictions added for a specified product.
Use a separate method to get product restriction details.
Request
Header parameters:
Authorization: Bearer <token>
Path parameters:
- productId required
The product identifier.
Query parameters:
The following filter parameter is available for this method:
- name string
The product restriction name. Possible values:
country
client_type
product_country
verification_level_restriction
product_verification_auto_create
client_ib_parent
Refer to the Query parameters section in the API Overview for details on applying filter and sorting parameters.
GET[host]/api/v2/products/{productId}/restrictions
curl --location -g --request GET 'https://host.name/api/v2/products/1/restrictions?limit=10&offset=0&sort_order=desc&filter[name]=name' \
--header 'Authorization: Bearer <token>' \
Response
A response includes an array of Product Restriction objects providing information about the product restrictions matching the request parameters.
Get product restriction details
Use this method to obtain detailed information about a specified product restriction.
Use a separate method to get a list of product restrictions.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- restrictionId required
The identifier of a product restriction.
GET[host]/api/v2/products/{productId}/restrictions/{restrictionId}
curl --location -g --request GET 'https://host.name/api/v2/products/1/restrictions/22' \
--header 'Authorization: Bearer <token>' \
Response
A response contains a Product Restriction object providing information about the specified product restriction.
Add a new product restriction
Use this method to add a new restriction for a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The identifier of a product for which you want to add a restriction.
Body:
Specify the following parameters when adding a new product restriction:
- name integer required
The product restriction name.
- isEnabled boolean required
If
true
, a restriction is enabled for a product; otherwise,false
.- type string required
A string value specifying the type of a product restriction. Possible values:
allow
deny
- ids array
An array of integer values identifying the client types to which a restriction applies.
POST[host]/api/v2/products/{productId}/restrictions
curl --location --request POST 'https://host.name/api/v2/products/1/restrictions' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"name": "country",
"isEnabled": "1",
"type": "allow",
"ids": [
"2",
"33"
]
}'
Response
A response includes a Product Restriction object providing information about the added product restriction.
Update a product restriction
Use this method to update a specified product restriction.
Note
Instead of the method described below, you can use a similar method that uses the HTTP verb PATCH.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The identifier of a product for which you want to update a restriction.
- restrictionId required
The identifier of a product restriction to be updated.
Body:
Specify the following parameters when updating a product restriction:
- isEnabled boolean
If
true
, a restriction is enabled for a product; otherwise,false
.- type string
A string value specifying the type of a product restriction. Possible values:
allow
deny
- ids array
An array of integer values identifying the instances (such as countries, client types or others) to which a restriction applies.
PUT[host]/api/v2/products/{productId}/restrictions/{restrictionId}
curl --location --request PUT 'https://host.name/api/v2/products/1/restrictions/22' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"isEnabled": "1",
"type": "deny",
"ids": [
"2",
"33"
]
}'
Response
A response includes a Product Restriction object providing information about the product restriction that was updated.
Delete a product restriction
Use this method to remove a restriction for a specified product.
Request
Header parameters:
Authorization: Bearer <access_token>
Path parameters:
- productId required
The product identifier.
- restrictionId required
The identifier of a product restriction to be removed.
DELETE[host]/api/v2/products/{productId}/restrictions/{restrictionId}
curl --location --request DELETE 'https://host.name/api/v2/products/1/restrictions/22' \
--header 'Authorization: Bearer <token>'
Response
In case of success, no response body is returned.