POST /auth/refresh
/api/store/[slug]/auth/refreshExchanges a Supabase refresh token for a fresh access/refresh token pair so a storefront customer session can outlive the ~1h access-token expiry without re-running the OTP flow.
Path parameters
slugstringrequiredBusiness store slug; 404 if no business matches.
Body parameters
refresh_tokenstringrequiredThe Supabase refresh token from a prior verify-code or refresh response. Trimmed, min 20 characters. Rotated on success (the returned token supersedes it).
Responses
The request succeeded.
The key or customer token is missing, malformed, or no longer valid.
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 401 (invalid/expired refresh token or no matching customer), 404 (business not found), 429 (refresh rate limit).