Check User type is customer or guest in Rest Webapi Magento 2.

Check Current user type using programmatically with Rest Web API. It’s used when you interact with the Webapi in Magento 2.

The difference between Customer and Guest user type is resource access. Customer User type has anonymous or self permission are allowed where later one access only Resources with anonymous permission.

Magento store the constant user type value in Magento\Authorization\Model\UserContextInterface.

The given Approach is useful for getting a customer type in Web API management. while you are working for the third party API and need to find out Customer Related information.

Verify List of User type based on the output integer value,

Leave a Reply