Customer accounts
Sign shoppers in with a password or a one-time code by email, SMS or WhatsApp, and give them their orders, addresses, bookings, wishlist and points. Ask the store first whether it has accounts at all.
Ask the store first
A store chooses whether shoppers have accounts and who may open one. Show sign-in and sign-up only where they work:
const { accounts, sign_ups } = await shop.customer.accountSettings();accountsoff | optional | requiredoff: guests only.optional: shoppers may sign in.required: checkout needs a signed-in customer.sign_upsopen | approval | invitedopen: anyone can sign up.approval: a new account waits for the store.invited: no sign-up form; the store invites people.
A password
import { isAccountRequest } from "@snizu/storefront";
const result = await shop.customer.signUp({ email, password, first_name: "Salma", locale: "ar" });
if (isAccountRequest(result)) {
showNotice("The store reviews new accounts. You'll get an email once yours is approved.");
}
const customer = await shop.customer.signIn(email, password);A password is 12 to 128 characters. requestPasswordReset(email) emails a code, and confirmPasswordReset sets the new password with it and signs in.
A code by email, SMS or WhatsApp
Shoppers can sign in without a password. Ask where this store can send a code, then send it and check it:
const channels = await shop.customer.signInCodeChannels(); // ["email", "sms", "whatsapp"]
await shop.customer.requestCode({ channel: "whatsapp", phone: "0100 123 4567" });
const result = await shop.customer.verifyCode({ phone: "0100 123 4567", code: "٤٨٢٩١٥" });The phone can be written any usual way, read in the store's country, and the code's six digits can come with spaces, dashes or Arabic-Indic digits. When the code opens a new account, the answer has created: true; give first_name, last_name, email and email_marketing with the code to fill it in. Where the store approves new accounts, the answer is a pending request instead, as with a password.
Refusals to expect
409 accounts_offThe store has no customer accounts.409 sign_up_invite_onlyThe store opens accounts by invitation only.409 account_pendingThe account still waits for the store's approval.
Signed in
The session token lives where the cart's does, and every call about the customer carries it. Signing in links the cart to the customer, and signOut() forgets both.
me(), update(changes), changePassword()The account, and changing it.setBirthday("MM-DD")too.addresses(), addAddress(), updateAddress(), removeAddress()Their address book.orders(), order(id), tracking(id), downloads(id)Their orders, newest first, where each parcel is, and the files and codes of a paid order.buyAgain(orderId)Puts what's still for sale from a past order in the cart, at today's prices, and says what was left out and why. Start a cart first.subscriptions(), changeSubscription(id, action)Skip the next renewal, pause, resume or cancel.bookings(), cancelBooking(id), rescheduleBooking(id, …)Their bookings of the store's services, upcoming first. Cancelling one paid online refunds it, within the service's rules.wishlist(), saveToWishlist(), removeFromWishlist()Saved products.wishlistEnabled()says whether the store offers wishlists;shareWishlist()gives a link, andsharedWishlist(token)reads one.loyalty(), redeemPoints(points)Their points or cashback, tier and history, and turning points into store credit.store.loyaltyProgram()describes the programme to everyone.fields(), setFields(values)The customer fields the store lets shoppers set themselves, such as a shoe size.company()The company the customer buys for, ornullfor a retail customer.
Without an account
An order's email and text link to its status page with a token. orderStatus.get(token) reads that order for anyone holding the link, confirm and cancel act on an order that waits for the customer, and find(number, contact) gets the token from the order number and the email or phone it was placed with.
Was this page helpful?
Updated 25 Nov 2026