On this page you can create multiple applications each linked to a nopCommerce store as per your requirement. Each application have it's own unique API key and you can choose to create multiple applications per store as needed.
An application in the public API plugin is directly linked to a store and a real world website with a unique domain. Application level API key is used to authorize API methods no matter if they require JWT access token authorization such as GetGuestToken which does not require access token because this method is used to generate a guest customer access token.
Store information is also mapped within an application API key and this is why this key must be sent in all request headers so the plugin code could validate the store and request url from which the requested information needs to be sent.
Once you click on the Applications menu item, It will display the applications page as shown in the image below.
To add an application, you need to provide values for following fields:
- Application name: Used to define an application name. This value is only used for identification between multiple applications and it is not used anywhere in the API. You can change application name anytime.
- Store: The nopCommerce store to which this application is mapped.
- Active: Allows you to activate / de-activate an application. You can edit this from the grid displayed above. De-activating an application will invalidate all requests where this application API key is found in header.
While generating a key and using it in postman you may get an error of Invalid key. This is due to an invalid Host Value. To set the Host value go to Configuration > Stores > Edit Store, there you can find a setting related to Host Value as shown in the image below. The host value must be the domain part and not the whole URL path, for example, it should be yourstore.com. Place a valid URL there and your error will be solved.