1

In postman , I tried to add the product to the cart for registered user using this API :

/rest/V1/carts/mine

but I am facing an error like

{
    "message": "Consumer is not authorized to access %resources",
    "parameters": {
        "resources": "self"
    }
}
1

Please follow the below steps:-

Step 1:- consider the registered user login details(from website) so that you will get authentication key hence follow the below step first

note:- please note down it will useful for next following steps at header section

Method:- POST http://yoursite.com/rest/V1/integration/customer/token?username=test@gmail.com&password=test@123

screenshot:- enter image description here

Step 2:- Create Cart APi along with the adding header section keys and values as shown below and it will generate cart id.

enter image description here

Method:- POST http://yoursite.com/rest/V1/carts/mine

Step 3:- Get Cart details Method:- GET http://yoursite.com/rest/V1/carts/mine

enter image description here

Step 4:- Add item to Cart Method:- POST http://yoursite.com/rest/V1/carts/mine/items Note:- don't forget to add authentication key and value & Content-Type is application/json in the postman app at header section

Body section:

{ "cart_item": { "quote_id": "15", "sku": "24-MB03", "qty": 1 } }

enter image description here

Step 5:- Method GET http://yoursite.com/rest/V1/carts/mine

1: enter image description here

1: enter image description here

1: enter image description here

1: enter image description here

1: enter image description here

  • I'm still getting the same error. I got the token and after that sending request to /rest/default/V1/carts/mine. Any idea? – Bhargav Nanekalva May 31 '18 at 6:33
  • magento ver 1.9.2.3,I am work with REST API in POSTMAN, i have all oAuth 1.0 details like Consumer Key,Consumer Secret,Access Token,Token Secret. Now i moved to oAuth 2.0, how can i get my all oAuth 2.0 details? @Nagaraju Kasa – zus Oct 30 '18 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.