HCL Commerce Version 9.1.6.0 or later

Testing REST APIs

HCL Commerce supports the OpenAPI 3.0 specification from Version 9.1.6.0 onwards. You can use the Swagger specification to test any RESTful APIs that are documented in OAS files.

Before you begin

To view the Rest APIs with the Swagger interface, use the Swagger Editor. You can set up a local copy of the editor and user interface; for more information see Setting up a local Swagger instance.

About this task

To test the HCL Commerce Rest APIs, complete the following steps:

Procedure

  1. Start the servers.
  2. Access the Swagger specification by downloading the specification files. For more information, see HCL Commerce REST API.
  3. Open the Swagger specification using the Swagger Editor.
  4. Update the hostname and port for the applications. The following ports are assigned by default:
    • Transaction server: 5443
    • Tooling: 8000
    • xC: 9443
    • Query: 30900
    • Ingest: 30800
    • HCL Commerce Version 9.1.12.0 or laterApproval: 6643
  5. Log in to your starter store as a Site Administrator or pass in the credentials directly in the OAS specification.
    HCL Commerce Version 9.1.6.0 or laterNote: Logging in to the store sets up the security tokens so that you can make REST calls from Swagger. Although you can still view the REST resources in Swagger, failing to log in or pass in credentials with the appropriate permissions prevents you from running any REST calls from Swagger.
  6. Test your endpoints.
If you encounter CORS related issues, update the CORS configuration with the correct Swagger Editor/UI domain. For more information about configuring CORS, see Configuring Cross-Origin Resource Sharing (CORS) headers.