POST /auth/verify-code
/api/store/[slug]/auth/verify-codeVerifies the emailed OTP code and returns Supabase access/refresh tokens plus the storefront customer record (created on first login).
Path parameters
slugstringrequiredBusiness store slug; 404 if no business matches.
Body parameters
emailstringrequiredCustomer email address. Trimmed and lowercased, valid email, max 255 characters. Must match the email the code was sent to.
codestringrequiredThe one-time passcode. Exactly 8 characters, numeric digits only (regex ^\d{8}$).
Responses
The request succeeded.
A field failed validation. The response names the fields that failed, not just the first.
No such store, or no such record inside it.
Too many requests. Back off and retry after the window in the response.
What comes back
200: { success: true, access_token, refresh_token, customer: { id, email, created_at } }. Errors: { success: false, error } with 400 (invalid/expired code or validation), 404 (business not found), or 429 (too many attempts; the body also carries retryAfter).