E-Commerce Guest Users

Hello Strapi Community!

I use Strapi to power an e-commerce site, which has the power to deliver items to guest users, e.g. anyone with an email and a valid address. I was doing this by embedding the user fields in an “Orders” table ( userEmail, userName, userPhone, userAddress ). However, this doesn’t play well when integrating into a PIM or real OMS, as the “Customer” or “Users” fields are held by reference into the “Order”.

I don’t want to require a guest user to have to create an account in order to checkout, but Strapi’s local/auth endpoint which creates a User in the default Users table requires a password. My alternative I am thinking of is creating a new table: “AppUsers” which contains “normal” customer fields (e.g. address, email, phonenumber), and then has a few relations: A. Orders B. Users (if registered).

I don’t love this as it is overly complicated. What does the community do in this case normally?

In most cases where I’ve seen this they just create an account in the backend anyway using some password generator to create a very complex password and proceed as if the user created the account.

1 Like

Thanks Derrick. I don’t love the solution, but it does seem like the right flow. They can always issue a password reset if needed.

Unfortunately when dealing with any service that doesn’t require an account you are opening yourself up to abuse. The only two things you can really do is accept that abuse is possible or “fake” the account and authorization.

Alternative would be to implement actual accounts.