Login as guest with store-api

When I do the user registration via the store-api as a guest:

https://my-url.com/store-api/account/register

I cannot login via

https://my-url.com/store-api/account/login

with following error message:
image

When I do exactly the same, but not as a guest, it works. That means I register with the same body data besides „guest“: true (which I deleted in the body).

Any suggestions what might be wrong, when registering as a guest.

I use shopware 6.4.13.

Were you able to find out how to login as guest?

No unfortunately not.

https://www.YourURL.com/account/guest/login
Hope this can help you. It is impossible to find…
But it seems, that it not work for itself.
Our shop sending a special link with an special order ID like this:
https://www.YourURL.com/account/guest/login?redirectTo=frontend.account.order.single.page&redirectParameters[deepLinkCode]=1234567890&loginError=0&waitTime=

I have replaced the order code that our shop generated with 1234567890.

perhaps this helps

I’m replying to this topic, because I had the same problem, and so it might be useful for people who find this forum post in the future.

A guest can’t be logged in BUT if you make the API-requests in the right order, the guest will count as „logged-in“ upon registration for the checkout step.

The right order here means creating a cart before registering a guest: (only listing the API endpoints)

  1. /store-api/context – use this token until step (5)
  2. /store-api/checkout/cart
  3. /store-api/checkout/cart/line-item
  4. /store-api/account/register – the response header will contain a new sw-context-token
  5. /store-api/checkout/order – using the new token

For the requests you can use the data from the Store-API quick guide: Registering a customer | Store API (stoplight.io)
But add "guest": true for the /store-api/account/register call.