How to delete customer by REST Web API Magento 2?

Customer Delete using REST Web API in Magento 2 comes with URL endpoint  V1/customers/:customerId and DELETE Action.

You need to replace  :customerId in the URL with the actual customer id. Continue reading “How to delete customer by REST Web API Magento 2?”

Magento Error The consumer isn’t authorized to access %resources in Rest API using postman.

While you work with REST API in Magento and you got the error like, The consumer isn’t authorized to access %resources.

Error Response will look like this,

"message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "self"
    },

Continue reading “Magento Error The consumer isn’t authorized to access %resources in Rest API using postman.”

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. Continue reading “Check User type is customer or guest in Rest Webapi Magento 2.”