Skip to main content
Every account route answers 403 ACCOUNTS_DISABLED in guest only mode. None of them reveals whether an email is registered, verified or blocked, with a single exception: EMAIL_IN_USE on an authenticated email change.

Account Routes at a Glance

“guest” means the route needs X-Checkout-Session and answers 401 SESSION_INVALID without it. “none” means no session header is needed. Private routes without a valid login session answer 401 LOGIN_REQUIRED. Every body must be a JSON object; unknown fields are ignored. Strapi sends the account emails right away with the store’s email provider. The links point to your storefront, never to Strapi. They live in the templates (Settings → Email templates) and build on {{store.url}} (the storefront URL, without a trailing slash) plus {{token}} (already URL encoded): Each page reads token from the query string and posts it to the matching route. Tokens are single use. If you change your routes, ask the store owner to update the templates, in every language.
Mail clients and security scanners often open links before the customer does. Do not consume the token while the page renders. Render a button (“Confirm my email”) or post from a client effect, so a plain page load never uses the link.

Account Server Actions

src/app/(store)/account/actions.ts
login and verifyEmail send only the guest session on purpose. If an old customer cookie is still around and Strapi answers 401 CUSTOMER_SESSION_INVALID, withSession drops it and tries again.

Register

POST /account/register
Request
Response 202
The answer is always 202 for valid input, whatever the state of the email, so it never reveals whether someone already has an account. Behind the scenes, a new email gets an account and a verification email. A guest customer (one who only bought before) becomes a registered account and keeps its past orders. An unverified account gets the new password and a new email. A verified account changes nothing and gets a “someone tried to register” notice. A blocked customer gets nothing. Always show “Check your inbox to confirm your email”. Password rules: 10 to 128 characters (counted after Unicode NFC normalization), not equal to the email. No composition rules. Errors: 400 invalid_email (email), 400 required (firstName, lastName, up to 100 characters each), 400 invalid (phone, up to 40 characters), 400 WEAK_PASSWORD with details.reason set to TOO_SHORT, TOO_LONG or EQUALS_EMAIL; 401 SESSION_INVALID; 429 RATE_LIMITED; 503 ACCOUNTS_UNAVAILABLE.

Verify the Email

POST /account/verify-email
Request
Response 200
A successful verification logs the customer in: it merges the guest cart and returns a login token. Store it and drop the guest cookie. Every failure (unknown, used, expired token, blocked customer) answers 400 TOKEN_INVALID. Offer the resend form then.
src/app/(store)/account/verify-email/page.tsx
src/app/(store)/account/verify-email/verify-email-form.tsx

Resend the Verification Email

POST /account/verify-email/resend with { "email": "jane@example.com" }. Always answers 202 { "status": "ACCEPTED" }. Strapi sends an email only for a registered, unverified, unblocked account. No session needed.

Log In

POST /account/login
Request
The success answer has the same shape as the verify email answer. Store the token, drop the guest cookie, and reload the cart: it now holds the merged lines (same variants add up, codes are combined, and the guest’s destination, shipping method, gift choices and locale win when set). There is no account lockout: the limits only slow down guessing.

Forgot and Reset Password

POST /account/password/forgot with { "email": "jane@example.com" }. Always answers 202 { "status": "ACCEPTED" }. Strapi sends the reset email only to a registered, unblocked account (verified or not). No session needed. POST /account/password/reset
Request
Answers 204. The reset also marks the email verified (the link proves ownership), ends every login session of the customer and sends a “password changed” email. Send the customer to the login page. Strapi checks the password rules before it uses the token, so a weak password does not burn the link. Errors: 400 WEAK_PASSWORD (with reason), 400 TOKEN_INVALID, 401 SESSION_INVALID, 429 RATE_LIMITED. Your /account/reset-password page serves both cases: with a token in the query string, show the “new password” form; without one (the link in the “registration attempt” email), show the “forgot password” form.

Log Out

POST /account/logout answers 204, also when the session was already gone. Drop the customer cookie. Open a new guest session only when the visitor needs one again.

Profile

GET /account/me returns the profile (the customer object shown above). pendingEmail holds an email change that waits for confirmation. PUT /account/me changes only firstName, lastName, phone (send null to clear it) and locale. Send only the fields you change. It returns the updated profile.
Request
Errors: 400 required or too_long (names, up to 100 characters), 400 invalid (phone, up to 40 characters), 400 invalid_locale.

Change the Password

POST /account/password
Request
Response 200
Replace the customer cookie with the new token. The change ends every other session of the customer and sends a “password changed” email. Errors: 400 INVALID_CREDENTIALS (wrong current password; note the 400, not 401), 400 WEAK_PASSWORD, 429 RATE_LIMITED (5 tries per 15 minutes per session).

Change the Email

POST /account/email
Request
Answers 204. Strapi stores the new email as pending (it shows in pendingEmail) and sends a confirmation link to the new address. A new request replaces the previous one. Errors: 400 invalid_email or same_email (newEmail), 400 INVALID_CREDENTIALS, 409 EMAIL_IN_USE (another customer has it), 429 RATE_LIMITED. POST /account/email/confirm with { "token": "TOKEN_FROM_THE_LINK" } Needs any session, guest or login, because the link can open on another device. Answers 204. Strapi swaps the email, moves the store credits and promotion usage to the new address, ends every other login session (it keeps the current one when it belongs to that customer) and tells the old address. Errors: 400 TOKEN_INVALID, 409 EMAIL_IN_USE.

Orders

GET /account/orders?page=1&pageSize=10 Lists the customer’s orders, newest first. pageSize defaults to 10 and caps at 50. Each result has the order status shape. Use GET /orders/:publicId/status or POST /orders/:publicId/payment with the login session to follow or pay any of them.
Response 200
GET /account/orders/:publicId returns one order in the same shape. Another customer’s order answers 404 ORDER_NOT_FOUND.

Sessions

GET /account/sessions lists the customer’s live login sessions, so they can see where they are logged in:
Response 200
ipPrefix keeps only the network part of the IP (IPv4 /24, IPv6 /48). userAgent comes from the X-Storefront-Client-User-Agent header you send at login.
  • DELETE /account/sessions/:id ends one session and answers 204. It can be the current one: then drop the cookie. A session of another customer answers 404 NOT_FOUND.
  • POST /account/sessions/revoke-others ends every session except the current one and answers 204.

Blocked Customers

The store owner can block a customer. Blocking ends all their sessions. After that, login answers INVALID_CREDENTIALS, the email links answer TOKEN_INVALID, register, resend and forgot password do nothing, and guest checkout with that email answers 403 CUSTOMER_BLOCKED. Show a neutral message and the store’s support contact.