Authentication Endpoints
The authentication endpoints provide comprehensive user management, session handling, and security features for the Shop API. All authentication flows are designed for modern mobile and web applications.All authentication endpoints are automatically documented below from the OpenAPI specification. This overview categorizes endpoints by functionality and provides usage context.
Endpoint Categories
QR Code Authentication
Desktop-to-mobile authentication flow for seamless login:POST /{locale}/shop/auth/qr-login/generate- Generate QR sessionPOST /{locale}/shop/auth/qr-login/poll/{sessionId}- Poll session statusPOST /{locale}/shop/ably/token- Get Ably WebSocket token
Session Management
JWT token lifecycle and session handling:POST /{locale}/shop/auth/refresh- Refresh expired access tokenPOST /{locale}/shop/auth/logout- End user sessionGET /{locale}/shop/auth/me- Get current user information
- Access tokens expire after 1 hour
- Refresh tokens are valid for 30 days
- Automatic token rotation on refresh
User Profile Management
Comprehensive user data and preferences management:GET /{locale}/shop/auth/me- Get complete user profilePUT /{locale}/shop/auth/profile- Update user details (name, email)GET /{locale}/shop/auth/preferences- Get user preferencesPUT /{locale}/shop/auth/preferences- Update notification/privacy settings
User Statistics & Analytics
User engagement and loyalty metrics:GET /{locale}/shop/auth/statistics- Get user loyalty statistics- Includes: total cards, points balance, coupons, achievements
Account Management
Advanced account operations:DELETE /{locale}/shop/auth/account- Delete/deactivate user account
Authentication Methods Required
| Endpoint Group | Authentication | Notes |
|---|---|---|
| QR Generation | API Credentials | Public endpoints |
| Session Management | JWT Token | User context required |
| Profile Management | JWT Token | User context required |
| Statistics | JWT Token | User context required |
Common Use Cases
Desktop QR Login
Scenario: Desktop application login via mobileResponse Examples
Successful Login Response
User Statistics Response
Security Features
Rate Limiting
- QR Login: 10 per hour per session
- API Calls: 1000 per hour per JWT token
Anti-Fraud Protection
- Device Tracking: Suspicious device detection
- IP Monitoring: Unusual location alerts
- Session Security: Automatic logout on suspicious activity
Data Protection
- GDPR Compliant: Right to deletion and data export
- Phone Verification: Required for all registrations
- Secure Storage: Encrypted sensitive data
- Audit Logging: Complete authentication activity logs
Error Handling
Common authentication errors and their resolutions:| Error Code | Description | Solution |
|---|---|---|
TOKEN_EXPIRED | JWT token expired | Use refresh token endpoint |
QR_SESSION_EXPIRED | QR login session expired | Generate new QR session |
Next Steps
Loyalty Cards API
Manage customer loyalty cards after authentication
Points System API
Award and redeem loyalty points for authenticated users
User Preferences
Customize user experience and notification settings
Error Handling Guide
Implement robust error handling for auth flows
Interactive Testing: All authentication endpoints can be tested directly below using the auto-generated API reference. Use the staging environment for safe testing.