For registration and configuration of the recommendation service, you should use the method POST /api/v5/integration-modules/{code}/edit. If module with the code {code} already exists, the method changes its settings, otherwise a new integration module of the recommendation service is created. Current parameters of the module can be viewed using the method GET /api/v5/integration-modules/{code}.
To register the service, it is necessary to specify the name integrationModule[name]
, the code integrationModule[code]
, the base URL integrationModule[baseUrl]
and the client ID integrationModule[clientId]
. The client ID is required for the user identification in the warehouse system when making callback requests. Also, you can specify the logo of the recommendation service integrationModule[logo]
, which will be displayed in the integration list of Marketplace.
In order to activate callback methods, it is necessary to pass the settings of the required callback method to integrationModule[integrations][recommendation][actions]
. You should specify code
and url
for each method. Query address is created from the base configuration of integrationModule[baseUrl]
and url
of the particular method.
Available callback methods are below.
For getting the list of recommendations, the system will run the GET
request to the method with the recommendation
code from integrationModule[integrations][recommendation][actions]
array. The following parameters will be added to the method`s url
:
id
is an internal identifier of a product
externalId
is an external identifier of a product
mode
is a type of recommendations, possible values: buying_with
- additional items, analogs
- product analogs
The system receives an object with the following fields as a response from the recommendation service:
by
displays the field by which the system identifies products, possible values are id
and externalId
ids
- an array with product identifiers