Authentication
The authentication method used in Lidia APIs varies depending on the API group. PIM API and Commerce Engine services operate with different authentication structures. Therefore, when developing an integration, the correct authorization method must be applied according to the API group being used.
PIM Authentication
Client ID and AppKey information are used for authentication in PIM API requests. This information is included in the request body sent to the PIM API.
- Client ID: Represents the integration user or the relevant customer account.
- AppKey: It is the API access key and is used to authorize requests.
- Usage: The Client ID and AppKey fields are included in the body sent to PIM endpoints.
curl --request POST \
--url https://{pim-api-url}/api/v2/query/products \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '{
"clientId": "{clientId}",
"appKey": "{appKey}",
"pageIndex": 0,
"pageSize": 25
}'Commerce Engine Authentication
Authentication in Commerce Engine services is performed with a Bearer token. After the token is obtained, it is sent through the Authorization header in service requests.
- Authorization Header: The token is sent through the header in every service request.
- Usage: The same authorization approach is applied in Metadata, Inventory, Order, and other Commerce Engine services.
curl --request GET \
--url https://{commerce-engine-base-url}/{service-path} \
--header 'accept: application/json' \
--header 'authorization: Bearer {access_token}'Authentication Flow
During integration, the first step is to prepare the authentication information suitable for the API group to be used. On the PIM side, requests are sent directly with Client ID and AppKey. On the Commerce Engine side, authorized requests are made to the relevant service endpoints using a Bearer token.
Determine whether the integration requirement will proceed through the PIM API or Commerce Engine services.
Obtain the required access credentials by contacting the Lidia team. Use Client ID and AppKey for PIM; use Bearer token information for Commerce Engine.
Add the authentication information and perform a connection and authorization check through a simple query endpoint.
For successful requests, 2xx status codes are expected. In case of authentication or authorization errors, a 401 or 403 response may be returned.
Updated 18 days ago