3

Unable to add items to cart

Trying to setup local spartacus with 2011 Commerce Cloud and spartacussampledata. Few restful endpoints are throwing 401 unauthorized access. Followed this link for setup: https://sap.github.io/spartacus-docs/building-the-spartacus-storefront-from-libraries

Irus
  • 81
  • 7

2 Answers2

0

To shed some light on the issue.

If you are receiving a response from the backend that says It's not allowed to execute this call from the current channel, then you have misconfigured your storefront.

Basically, the endpoint is most likely hitting an endpoint used for B2B or B2C depending on which 'channel' you are currently in.

For example, in the screenshot, you are currently in B2C, but you are most likely calling the B2B channel. You should be calling the endpoint with users/${userId}/carts/${cartId}/entries?quantity=${quantity}, but instead, you are calling an endpoint with orgUsers/${userId}/carts/${cartId}/entries?quantity=${quantity}.

Notice users vs orgUsers as the difference.

BrianGJ
  • 166
  • 3
0

I would like to contribute!

Here in my project I am instantiating a Spartacua TUA (Telco Utilities Accelerator)

I've been having this problem "It's not allowed to execute this call from the current channel" and in my case the solution was to review the property "api.compatibility.b2c.channels" which was with the B2B value for the B2C store. I changed the value and it worked correctly again!