\Magento\Checkout\Model\Session\Proxy $checkoutSession
$quoteId = $this->checkoutSession->getQuote()->getId();

When accessing this code from rest api $quoteId is null, but when accessed from frontend value is available.

resource for my webapi is "self". Why am I not able to access quote data when accessing from rest api, is there something wrong ? Thanks!

  • What are you trying to do? You can not use the built-in Magento rest endpoints to achieve that?
    – Dan Staver
    Feb 11, 2022 at 2:32

1 Answer 1


Check this Is there customer session support via Magento's REST api?

One further thing to keep in mind is that the session you have established to communicate to the API is separate to the session a customer has.

If you have an idea to use quote in your custom API you might pass quoteId to it, but its not actually safe way. Better to create Controller if its possible and manage things there


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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