As a prerequisite, you must have an application API key with you as described in the Step 1 on the Authentication page.


To use the postman collection that you have just imported in the Getting started page, please click on the File > New menu item in your postman as displayed in the image below.


public-api-postman-new-file-menu


Once you click on the New menu item, a pop-up will be shown as displayed in the image below.


public-api-postman-new-pop-up


In the pop-up displayed as shown in the image above, please click on the Environment. It will open a new tab in the postman.


Please provide an environment name and add two variables named url and access-token into the newly created environment. For the url, please provide your nopCommerce store url without "/" for which you want to use the API plugin as displayed in the image below.


public-api-postman-environment-variable-url


Once this is done, please click on the PublicAPI collection name from the collection browser and then click on Pre-request Script tab. In the Pre-request Script tab, kindly replace the value as displayed in the image below with the application API key.


public-api-postman-pre-request-script-tab


Next step is to create a guest access token. In order to do that, you need to create a request in postman on GetGuestToken method. To create a request as shown in the image below, go to PublicAPI > Customer > GetGuestToken method in the postman collection and click on the Send button. Please make sure you have also selected the environment as displayed.


public-api-postman-getguesttoken


Once the request is successfully made, you will see a response similar to the response as displayed in the image below.


public-api-getguesttoken-response-postman


You need to save the AccessToken, RefreshToken and the RefreshTokenExpiration somewhere in order to create request on the other methods. Also, you will need to replace CURRENT VALUE for access-token variable with the guest AccessToken in the API environment which you created earlier as displayed in the image below.


To do that, please go to Environments and then click on the environment you created in your postman.


public-api-postman-environment-edit


To login and authenticate the guest customer you just created in above steps, you need to create a request on the Login method. To create a request as shown in the image below, go to PublicAPI > Customer > Login method in the postman collection then write credentials in the request Body and click on the Send button. Please make sure you have also selected the environment as displayed.


public-api-postman-login-request


On success you will get the response as displayed in the image below with the new AccessToken, RefreshToken and the RefreshTokenExpiration. In order to authenticate other requests with the logged in customer, you just need to replace access-token variable value in your API environment inside postman with the new AccessToken you received in this response.


public-api-postman-login-response