Search code examples
http-status-code-401spartacus-storefront

v3.0: PUT /addresses/delivery returns 401


While upgrading from 2.1 to 3.0, we noticed that the PUT /users/current/carts/{validId}/addresses/delivery?addressId={validId} returns 401 Unauthorized.

In occ-checkout-delivery.adapter.ts the method setAddress() is running the request. This method was not overwritten on our side.

Is there anyting we are missing?

Thank you.


Solution

  • I found the fix.

    Had to adjust the endpoint configuration for a particular key:

    setDeliveryAddress: 'orgUsers/${userId}/carts/${cartId}/addresses/delivery',
    

    Instead of users/, we had to use orgUsers/ due to our back end implementation.